diff --git a/sdk/schema.json b/sdk/schema.json index 90b75c457c..c0633659a3 100644 --- a/sdk/schema.json +++ b/sdk/schema.json @@ -5098,24 +5098,6 @@ }, "description": "Filter by slug." }, - { - "name": "is_member", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter by membership. If `true`, only organizations the user is a member of are returned. If `false`, only organizations the user is not a member of are returned.", - "title": "Is Member" - }, - "description": "Filter by membership. If `true`, only organizations the user is a member of are returned. If `false`, only organizations the user is not a member of are returned." - }, { "name": "page", "in": "query", @@ -10161,9 +10143,9 @@ } ], "title": "OrganizationID Filter", - "description": "Filter by organization ID. **Required unless you use an organization token.**" + "description": "Filter by organization ID." }, - "description": "Filter by organization ID. **Required unless you use an organization token.**" + "description": "Filter by organization ID." }, { "name": "query", @@ -10331,7 +10313,6 @@ } }, "x-polar-allowed-subjects": [ - "Anonymous", "Organization", "User" ], @@ -10520,7 +10501,6 @@ } }, "x-polar-allowed-subjects": [ - "Anonymous", "Organization", "User" ], @@ -13776,67 +13756,44 @@ } ] } - } - }, - "webhooks": { - "checkout.created": { - "post": { - "summary": "checkout.created", - "description": "Sent when a new checkout is created.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointcheckout_created_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookCheckoutCreatedPayload" - } + }, + "/v1/storefronts/{slug}": { + "get": { + "tags": [ + "storefronts" + ], + "summary": "Get Organization Storefront", + "description": "Get an organization storefront by slug.", + "operationId": "storefronts:get", + "parameters": [ + { + "name": "slug", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Slug" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/Storefront" } } } - } - } - } - }, - "checkout.updated": { - "post": { - "summary": "checkout.updated", - "description": "Sent when a checkout is updated.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointcheckout_updated_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookCheckoutUpdatedPayload" - } - } }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", + "404": { + "description": "Organization not found.", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/ResourceNotFound" + } } } }, @@ -13850,30 +13807,172 @@ } } } - } + }, + "x-speakeasy-group": "storefronts", + "x-speakeasy-name-override": "get", + "x-speakeasy-ignore": true } }, - "order.created": { - "post": { - "summary": "order.created", - "description": "Sent when a new order is created.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointorder_created_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookOrderCreatedPayload" - } - } + "/v1/custom-fields/": { + "get": { + "tags": [ + "custom-fields", + "documented" + ], + "summary": "List Custom Fields", + "description": "List custom fields.", + "operationId": "custom-fields:list", + "security": [ + { + "oidc": [ + "custom_fields:read", + "custom_fields:write" + ] }, - "required": true - }, + { + "pat": [] + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "resourceRoot": "/v1/organizations", + "resourceName": "Organization", + "displayProperty": "name" + } + }, + { + "type": "array", + "items": { + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "resourceRoot": "/v1/organizations", + "resourceName": "Organization", + "displayProperty": "name" + } + } + }, + { + "type": "null" + } + ], + "title": "OrganizationID Filter", + "description": "Filter by organization ID." + }, + "description": "Filter by organization ID." + }, + { + "name": "query", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by custom field name or slug.", + "title": "Query" + }, + "description": "Filter by custom field name or slug." + }, + { + "name": "type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/CustomFieldType" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomFieldType" + } + }, + { + "type": "null" + } + ], + "title": "CustomFieldType Filter", + "description": "Filter by custom field type." + }, + "description": "Filter by custom field type." + }, + { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Page number, defaults to 1.", + "default": 1, + "title": "Page" + }, + "description": "Page number, defaults to 1." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Size of a page, defaults to 10. Maximum is 100.", + "default": 10, + "title": "Limit" + }, + "description": "Size of a page, defaults to 10. Maximum is 100." + }, + { + "name": "sorting", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomFieldSortProperty" + } + }, + { + "type": "null" + } + ], + "description": "Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.", + "default": [ + "slug" + ], + "title": "Sorting" + }, + "description": "Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order." + } + ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/ListResource__" + } } } }, @@ -13887,67 +13986,81 @@ } } } - } - } - }, - "subscription.created": { - "post": { - "summary": "subscription.created", - "description": "Sent when a new subscription is created.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointsubscription_created_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookSubscriptionCreatedPayload" - } - } - }, - "required": true }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } + "x-polar-allowed-subjects": [ + "Organization", + "User" + ], + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "limit", + "in": "parameters", + "type": "limit" } + ], + "outputs": { + "results": "$.items", + "numPages": "$.pagination.max_page" + } + }, + "x-speakeasy-group": "custom-fields", + "x-speakeasy-name-override": "list", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "list", + "source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.list({});\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();" }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } + { + "lang": "python", + "label": "list", + "source": "from polar_sdk import Polar\n\ns = Polar(\n access_token=\"\",\n)\n\nres = s.custom_fields.list()\n\nif res is not None:\n while True:\n # handle items\n\n res = res.next()\n if res is None:\n break" } - } - } - }, - "subscription.updated": { + ] + }, "post": { - "summary": "subscription.updated", - "description": "Sent when a subscription is updated. This event fires for all changes to the subscription, including renewals.\n\nIf you want more specific events, you can listen to `subscription.active`, `subscription.canceled`, and `subscription.revoked`.\n\nTo listen specifically for renewals, you can listen to `order.created` events and check the `billing_reason` field.\n\n**Discord & Slack support:** On cancellation and revocation. Renewals are skipped.", - "operationId": "_endpointsubscription_updated_post", + "tags": [ + "custom-fields", + "documented" + ], + "summary": "Create Custom Field", + "description": "Create a custom field.", + "operationId": "custom-fields:create", + "security": [ + { + "oidc": [ + "custom_fields:write" + ] + }, + { + "pat": [] + } + ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookSubscriptionUpdatedPayload" + "$ref": "#/components/schemas/CustomFieldCreate" } } - }, - "required": true + } }, "responses": { - "200": { - "description": "Successful Response", + "201": { + "description": "Custom field created.", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/CustomField" + } } } }, @@ -13961,67 +14074,79 @@ } } } - } + }, + "x-polar-allowed-subjects": [ + "Organization", + "User" + ], + "x-speakeasy-group": "custom-fields", + "x-speakeasy-name-override": "create", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "create", + "source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.create({\n slug: \"\",\n name: \"\",\n properties: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "python", + "label": "create", + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\ns = Polar(\n access_token=\"\",\n)\n\nres = s.custom_fields.create(request={\n \"type\": polar_sdk.CustomFieldCreateNumberType.NUMBER,\n \"slug\": \"\",\n \"name\": \"\",\n \"properties\": {},\n})\n\nif res is not None:\n # handle response\n pass" + } + ] } }, - "subscription.active": { - "post": { - "summary": "subscription.active", - "description": "Sent when a subscription becomes active,\nwhether because it's a new paid subscription or because payment was recovered.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointsubscription_active_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookSubscriptionActivePayload" - } - } + "/v1/custom-fields/{id}": { + "get": { + "tags": [ + "custom-fields", + "documented" + ], + "summary": "Get Custom Field", + "description": "Get a custom field by ID.", + "operationId": "custom-fields:get", + "security": [ + { + "oidc": [ + "custom_fields:read", + "custom_fields:write" + ] }, - "required": true - }, + { + "pat": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid4", + "description": "The custom field ID.", + "title": "Id" + }, + "description": "The custom field ID." + } + ], "responses": { "200": { "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "422": { - "description": "Validation Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HTTPValidationError" + "$ref": "#/components/schemas/CustomField" } } } - } - } - } - }, - "subscription.canceled": { - "post": { - "summary": "subscription.canceled", - "description": "Sent when a subscription is canceled by the user.\nThey might still have access until the end of the current period.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointsubscription_canceled_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookSubscriptionCanceledPayload" - } - } }, - "required": true - }, - "responses": { - "200": { - "description": "Successful Response", + "404": { + "description": "Custom field not found.", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/ResourceNotFound" + } } } }, @@ -14035,30 +14160,86 @@ } } } - } - } - }, - "subscription.revoked": { - "post": { - "summary": "subscription.revoked", - "description": "Sent when a subscription is revoked, the user looses access immediately.\nHappens when the subscription is canceled, or payment is past due.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointsubscription_revoked_post", + }, + "x-polar-allowed-subjects": [ + "Organization", + "User" + ], + "x-speakeasy-group": "custom-fields", + "x-speakeasy-name-override": "get", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "get", + "source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.get({\n id: \"\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "python", + "label": "get", + "source": "from polar_sdk import Polar\n\ns = Polar(\n access_token=\"\",\n)\n\nres = s.custom_fields.get(id=\"\")\n\nif res is not None:\n # handle response\n pass" + } + ] + }, + "patch": { + "tags": [ + "custom-fields", + "documented" + ], + "summary": "Update Custom Field", + "description": "Update a custom field.", + "operationId": "custom-fields:update", + "security": [ + { + "oidc": [ + "custom_fields:write" + ] + }, + { + "pat": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid4", + "description": "The custom field ID.", + "title": "Id" + }, + "description": "The custom field ID." + } + ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookSubscriptionRevokedPayload" + "$ref": "#/components/schemas/CustomFieldUpdate" } } - }, - "required": true + } }, "responses": { "200": { - "description": "Successful Response", + "description": "Custom field updated.", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/CustomField" + } + } + } + }, + "404": { + "description": "Custom field not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceNotFound" + } } } }, @@ -14072,25 +14253,121 @@ } } } - } - } - }, - "product.created": { - "post": { - "summary": "product.created", - "description": "Sent when a new product is created.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointproduct_created_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookProductCreatedPayload" - } - } - }, - "required": true }, - "responses": { + "x-polar-allowed-subjects": [ + "Organization", + "User" + ], + "x-speakeasy-group": "custom-fields", + "x-speakeasy-name-override": "update", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "update", + "source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n const result = await polar.customFields.update({\n id: \"\",\n customFieldUpdate: {},\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "python", + "label": "update", + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\ns = Polar(\n access_token=\"\",\n)\n\nres = s.custom_fields.update(id=\"\", custom_field_update={\n \"type\": polar_sdk.CustomFieldUpdateTextType.TEXT,\n})\n\nif res is not None:\n # handle response\n pass" + } + ] + }, + "delete": { + "tags": [ + "custom-fields", + "documented" + ], + "summary": "Delete Custom Field", + "description": "Delete a custom field.", + "operationId": "custom-fields:delete", + "security": [ + { + "oidc": [ + "custom_fields:write" + ] + }, + { + "pat": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid4", + "description": "The custom field ID.", + "title": "Id" + }, + "description": "The custom field ID." + } + ], + "responses": { + "204": { + "description": "Custom field deleted." + }, + "404": { + "description": "Custom field not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceNotFound" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "x-polar-allowed-subjects": [ + "Organization", + "User" + ], + "x-speakeasy-group": "custom-fields", + "x-speakeasy-name-override": "delete", + "x-codeSamples": [ + { + "lang": "typescript", + "label": "delete", + "source": "import { Polar } from \"@polar-sh/sdk\";\n\nconst polar = new Polar({\n accessToken: process.env[\"POLAR_ACCESS_TOKEN\"] ?? \"\",\n});\n\nasync function run() {\n await polar.customFields.delete({\n id: \"\",\n });\n\n\n}\n\nrun();" + }, + { + "lang": "python", + "label": "delete", + "source": "from polar_sdk import Polar\n\ns = Polar(\n access_token=\"\",\n)\n\ns.custom_fields.delete(id=\"\")\n\n# Use the SDK ..." + } + ] + } + } + }, + "webhooks": { + "checkout.created": { + "post": { + "summary": "checkout.created", + "description": "Sent when a new checkout is created.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointcheckout_created_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookCheckoutCreatedPayload" + } + } + }, + "required": true + }, + "responses": { "200": { "description": "Successful Response", "content": { @@ -14112,16 +14389,16 @@ } } }, - "product.updated": { + "checkout.updated": { "post": { - "summary": "product.updated", - "description": "Sent when a product is updated.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointproduct_updated_post", + "summary": "checkout.updated", + "description": "Sent when a checkout is updated.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointcheckout_updated_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookProductUpdatedPayload" + "$ref": "#/components/schemas/WebhookCheckoutUpdatedPayload" } } }, @@ -14149,16 +14426,16 @@ } } }, - "pledge.created": { + "order.created": { "post": { - "summary": "pledge.created", - "description": "Sent when a new pledge is created. Note that this does mean that the pledge has been paid yet.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointpledge_created_post", + "summary": "order.created", + "description": "Sent when a new order is created.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointorder_created_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookPledgeCreatedPayload" + "$ref": "#/components/schemas/WebhookOrderCreatedPayload" } } }, @@ -14186,16 +14463,16 @@ } } }, - "pledge.updated": { + "subscription.created": { "post": { - "summary": "pledge.updated", - "description": "Sent when a pledge is updated.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointpledge_updated_post", + "summary": "subscription.created", + "description": "Sent when a new subscription is created.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointsubscription_created_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookPledgeUpdatedPayload" + "$ref": "#/components/schemas/WebhookSubscriptionCreatedPayload" } } }, @@ -14223,16 +14500,16 @@ } } }, - "donation.created": { + "subscription.updated": { "post": { - "summary": "donation.created", - "description": "Sent when a new donation is created.\n\n**Discord & Slack support:** Full", - "operationId": "_endpointdonation_created_post", + "summary": "subscription.updated", + "description": "Sent when a subscription is updated. This event fires for all changes to the subscription, including renewals.\n\nIf you want more specific events, you can listen to `subscription.active`, `subscription.canceled`, and `subscription.revoked`.\n\nTo listen specifically for renewals, you can listen to `order.created` events and check the `billing_reason` field.\n\n**Discord & Slack support:** On cancellation and revocation. Renewals are skipped.", + "operationId": "_endpointsubscription_updated_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookDonationCreatedPayload" + "$ref": "#/components/schemas/WebhookSubscriptionUpdatedPayload" } } }, @@ -14260,16 +14537,16 @@ } } }, - "organization.updated": { + "subscription.active": { "post": { - "summary": "organization.updated", - "description": "Sent when a organization is updated.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointorganization_updated_post", + "summary": "subscription.active", + "description": "Sent when a subscription becomes active,\nwhether because it's a new paid subscription or because payment was recovered.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointsubscription_active_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookOrganizationUpdatedPayload" + "$ref": "#/components/schemas/WebhookSubscriptionActivePayload" } } }, @@ -14297,16 +14574,16 @@ } } }, - "benefit.created": { + "subscription.canceled": { "post": { - "summary": "benefit.created", - "description": "Sent when a new benefit is created.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointbenefit_created_post", + "summary": "subscription.canceled", + "description": "Sent when a subscription is canceled by the user.\nThey might still have access until the end of the current period.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointsubscription_canceled_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookBenefitCreatedPayload" + "$ref": "#/components/schemas/WebhookSubscriptionCanceledPayload" } } }, @@ -14334,16 +14611,16 @@ } } }, - "benefit.updated": { + "subscription.revoked": { "post": { - "summary": "benefit.updated", - "description": "Sent when a benefit is updated.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointbenefit_updated_post", + "summary": "subscription.revoked", + "description": "Sent when a subscription is revoked, the user looses access immediately.\nHappens when the subscription is canceled, or payment is past due.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointsubscription_revoked_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookBenefitUpdatedPayload" + "$ref": "#/components/schemas/WebhookSubscriptionRevokedPayload" } } }, @@ -14371,16 +14648,16 @@ } } }, - "benefit_grant.created": { + "product.created": { "post": { - "summary": "benefit_grant.created", - "description": "Sent when a new benefit grant is created.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointbenefit_grant_created_post", + "summary": "product.created", + "description": "Sent when a new product is created.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointproduct_created_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookBenefitGrantCreatedPayload" + "$ref": "#/components/schemas/WebhookProductCreatedPayload" } } }, @@ -14408,16 +14685,16 @@ } } }, - "benefit_grant.updated": { + "product.updated": { "post": { - "summary": "benefit_grant.updated", - "description": "Sent when a new benefit grant is updated.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointbenefit_grant_updated_post", + "summary": "product.updated", + "description": "Sent when a product is updated.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointproduct_updated_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookBenefitGrantUpdatedPayload" + "$ref": "#/components/schemas/WebhookProductUpdatedPayload" } } }, @@ -14445,16 +14722,16 @@ } } }, - "benefit_grant.revoked": { + "pledge.created": { "post": { - "summary": "benefit_grant.revoked", - "description": "Sent when a new benefit grant is revoked.\n\n**Discord & Slack support:** Basic", - "operationId": "_endpointbenefit_grant_revoked_post", + "summary": "pledge.created", + "description": "Sent when a new pledge is created. Note that this does mean that the pledge has been paid yet.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointpledge_created_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookBenefitGrantRevokedPayload" + "$ref": "#/components/schemas/WebhookPledgeCreatedPayload" } } }, @@ -14481,217 +14758,1774 @@ } } } - } - }, - "components": { - "schemas": { - "Account": { - "properties": { - "id": { - "type": "string", - "format": "uuid", - "title": "Id" - }, - "account_type": { - "$ref": "#/components/schemas/AccountType" - }, - "status": { - "$ref": "#/components/schemas/Status" - }, - "stripe_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + }, + "pledge.updated": { + "post": { + "summary": "pledge.updated", + "description": "Sent when a pledge is updated.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointpledge_updated_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookPledgeUpdatedPayload" } - ], - "title": "Stripe Id" + } }, - "open_collective_slug": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} } - ], - "title": "Open Collective Slug" + } }, - "is_details_submitted": { + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "donation.created": { + "post": { + "summary": "donation.created", + "description": "Sent when a new donation is created.\n\n**Discord & Slack support:** Full", + "operationId": "_endpointdonation_created_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookDonationCreatedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "organization.updated": { + "post": { + "summary": "organization.updated", + "description": "Sent when a organization is updated.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointorganization_updated_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookOrganizationUpdatedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "benefit.created": { + "post": { + "summary": "benefit.created", + "description": "Sent when a new benefit is created.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointbenefit_created_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookBenefitCreatedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "benefit.updated": { + "post": { + "summary": "benefit.updated", + "description": "Sent when a benefit is updated.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointbenefit_updated_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookBenefitUpdatedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "benefit_grant.created": { + "post": { + "summary": "benefit_grant.created", + "description": "Sent when a new benefit grant is created.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointbenefit_grant_created_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookBenefitGrantCreatedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "benefit_grant.updated": { + "post": { + "summary": "benefit_grant.updated", + "description": "Sent when a new benefit grant is updated.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointbenefit_grant_updated_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookBenefitGrantUpdatedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "benefit_grant.revoked": { + "post": { + "summary": "benefit_grant.revoked", + "description": "Sent when a new benefit grant is revoked.\n\n**Discord & Slack support:** Basic", + "operationId": "_endpointbenefit_grant_revoked_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookBenefitGrantRevokedPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Account": { + "properties": { + "id": { + "type": "string", + "format": "uuid", + "title": "Id" + }, + "account_type": { + "$ref": "#/components/schemas/AccountType" + }, + "status": { + "$ref": "#/components/schemas/Status" + }, + "stripe_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Stripe Id" + }, + "open_collective_slug": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Open Collective Slug" + }, + "is_details_submitted": { + "type": "boolean", + "title": "Is Details Submitted" + }, + "is_charges_enabled": { + "type": "boolean", + "title": "Is Charges Enabled" + }, + "is_payouts_enabled": { + "type": "boolean", + "title": "Is Payouts Enabled" + }, + "country": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "title": "Country" + }, + "users": { + "items": { + "$ref": "#/components/schemas/UserBase" + }, + "type": "array", + "title": "Users" + }, + "organizations": { + "items": { + "$ref": "#/components/schemas/Organization" + }, + "type": "array", + "title": "Organizations" + } + }, + "type": "object", + "required": [ + "id", + "account_type", + "status", + "stripe_id", + "open_collective_slug", + "is_details_submitted", + "is_charges_enabled", + "is_payouts_enabled", + "country", + "users", + "organizations" + ], + "title": "Account" + }, + "AccountCreate": { + "properties": { + "account_type": { + "$ref": "#/components/schemas/AccountType" + }, + "open_collective_slug": { + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "Open Collective Slug" + }, + "country": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "title": "Country", + "description": "Two letter uppercase country code" + } + }, + "type": "object", + "required": [ + "account_type", + "country" + ], + "title": "AccountCreate" + }, + "AccountLink": { + "properties": { + "url": { + "type": "string", + "title": "Url" + } + }, + "type": "object", + "required": [ + "url" + ], + "title": "AccountLink" + }, + "AccountType": { + "type": "string", + "enum": [ + "stripe", + "open_collective" + ], + "title": "AccountType" + }, + "Address": { + "properties": { + "line1": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Line1" + }, + "line2": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Line2" + }, + "postal_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Postal Code" + }, + "city": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "City" + }, + "state": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "State" + }, + "country": { + "type": "string", + "pattern": "^\\w{2}$", + "title": "Country" + } + }, + "type": "object", + "required": [ + "country" + ], + "title": "Address" + }, + "AdvertisementCampaign": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Modified At", + "description": "Last modification timestamp of the object." + }, + "id": { + "type": "string", + "format": "uuid4", + "title": "Id" + }, + "image_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Image Url" + }, + "image_url_dark": { + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], + "title": "Image Url Dark" + }, + "text": { + "type": "string", + "title": "Text" + }, + "link_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Link Url" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "image_url", + "image_url_dark", + "text", + "link_url" + ], + "title": "AdvertisementCampaign" + }, + "AdvertisementCampaignListResource": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/AdvertisementCampaign" + }, + "type": "array", + "title": "Items" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + }, + "dimensions": { + "prefixItems": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ], + "items": { + "type": "integer" + }, + "type": "array", + "maxItems": 2, + "minItems": 2, + "title": "Dimensions", + "description": "The dimensions (width, height) in pixels of the advertisement images." + } + }, + "type": "object", + "required": [ + "items", + "pagination", + "dimensions" + ], + "title": "AdvertisementCampaignListResource" + }, + "AdvertisementSortProperty": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "granted_at", + "-granted_at", + "views", + "-views", + "clicks", + "-clicks" + ], + "title": "AdvertisementSortProperty" + }, + "AlreadyCanceledSubscription": { + "properties": { + "type": { + "type": "string", + "enum": [ + "AlreadyCanceledSubscription" + ], + "const": "AlreadyCanceledSubscription", + "title": "Type" + }, + "detail": { + "type": "string", + "title": "Detail" + } + }, + "type": "object", + "required": [ + "type", + "detail" + ], + "title": "AlreadyCanceledSubscription" + }, + "Article": { + "properties": { + "id": { + "type": "string", + "format": "uuid4", + "title": "Id" + }, + "slug": { + "type": "string", + "title": "Slug" + }, + "title": { + "type": "string", + "title": "Title" + }, + "body": { + "type": "string", + "title": "Body" + }, + "byline": { + "$ref": "#/components/schemas/BylineProfile" + }, + "visibility": { + "$ref": "#/components/schemas/ArticleVisibility" + }, + "user_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "published_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Published At" + }, + "paid_subscribers_only": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Paid Subscribers Only" + }, + "paid_subscribers_only_ends_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Paid Subscribers Only Ends At" + }, + "is_preview": { + "type": "boolean", + "title": "Is Preview" + }, + "is_pinned": { + "type": "boolean", + "title": "Is Pinned" + }, + "notify_subscribers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Notify Subscribers" + }, + "notifications_sent_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Notifications Sent At" + }, + "email_sent_to_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Email Sent To Count" + }, + "og_image_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Og Image Url" + }, + "og_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Og Description" + } + }, + "type": "object", + "required": [ + "id", + "slug", + "title", + "body", + "byline", + "visibility", + "user_id", + "organization_id", + "organization", + "published_at", + "paid_subscribers_only", + "paid_subscribers_only_ends_at", + "is_preview", + "is_pinned", + "notify_subscribers", + "notifications_sent_at", + "email_sent_to_count", + "og_image_url", + "og_description" + ], + "title": "Article" + }, + "ArticleByline": { + "type": "string", + "enum": [ + "user", + "organization" + ], + "title": "ArticleByline" + }, + "ArticleCreate": { + "properties": { + "title": { + "type": "string", + "minLength": 1, + "title": "Title", + "description": "Title of the article." + }, + "slug": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Slug", + "description": "Slug of the article to be used in URLs. If no slug is provided one will be generated from the title." + }, + "body": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Body", + "description": "Body in string format. Either one of body or body_base64 is required." + }, + "body_base64": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Body Base64", + "description": "Body in base64-encoded format. Can be helpful to bypass Web Application Firewalls (WAF). Either one of body or body_base64 is required." + }, + "organization_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } + }, + { + "type": "null" + } + ], + "title": "Organization Id", + "description": "The ID of the organization owning the article. **Required unless you use an organization token.**" + }, + "byline": { + "$ref": "#/components/schemas/ArticleByline", + "description": "If the user or organization should be credited in the byline.", + "default": "organization" + }, + "visibility": { + "$ref": "#/components/schemas/ArticleVisibility", + "default": "private" + }, + "paid_subscribers_only": { + "type": "boolean", + "title": "Paid Subscribers Only", + "description": "Set to true to only make this article available for subscribers to a paid subscription tier in the organization.", + "default": false + }, + "paid_subscribers_only_ends_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Paid Subscribers Only Ends At", + "description": "If specified, time at which the article should no longer be restricted to paid subscribers. Only relevant if `paid_subscribers_only` is true." + }, + "published_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Published At", + "description": "Time of publishing. If this date is in the future, the post will be scheduled to publish at this time. If visibility is 'public', published_at will default to the current time." + }, + "notify_subscribers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Notify Subscribers", + "description": "Set to true to deliver this article via email and/or notifications to subscribers." + }, + "is_pinned": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Pinned", + "description": "If the article should be pinned" + }, + "og_image_url": { + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], + "title": "Og Image Url", + "description": "Custom og:image URL value" + }, + "og_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Og Description", + "description": "Custom og:description value" + } + }, + "type": "object", + "required": [ + "title" + ], + "title": "ArticleCreate" + }, + "ArticlePreview": { + "properties": { + "email": { + "type": "string", + "format": "email", + "title": "Email", + "description": "Email address to send the preview to. The user must be registered on Polar." + } + }, + "type": "object", + "required": [ + "email" + ], + "title": "ArticlePreview" + }, + "ArticleReceivers": { + "properties": { + "free_subscribers": { + "type": "integer", + "title": "Free Subscribers" + }, + "premium_subscribers": { + "type": "integer", + "title": "Premium Subscribers" + }, + "organization_members": { + "type": "integer", + "title": "Organization Members" + } + }, + "type": "object", + "required": [ + "free_subscribers", + "premium_subscribers", + "organization_members" + ], + "title": "ArticleReceivers" + }, + "ArticleUpdate": { + "properties": { + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" + }, + "body": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Body", + "description": "Body in string format. body and body_base64 are mutually exclusive." + }, + "body_base64": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Body Base64", + "description": "Body in base64-encoded format. Can be helpful to bypass Web Application Firewalls (WAF). body and body_base64 are mutually exclusive." + }, + "slug": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Slug" + }, + "byline": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArticleByline" + }, + { + "type": "null" + } + ], + "description": "If the user or organization should be credited in the byline." + }, + "visibility": { + "anyOf": [ + { + "$ref": "#/components/schemas/ArticleVisibility" + }, + { + "type": "null" + } + ] + }, + "paid_subscribers_only": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Paid Subscribers Only", + "description": "Set to true to only make this article available for subscribers to a paid subscription tier in the organization." + }, + "paid_subscribers_only_ends_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Paid Subscribers Only Ends At", + "description": "If specified, time at which the article should no longer be restricted to paid subscribers. Only relevant if `paid_subscribers_only` is true." + }, + "published_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Published At", + "description": "Time of publishing. If this date is in the future, the post will be scheduled to publish at this time." + }, + "notify_subscribers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Notify Subscribers", + "description": "Set to true to deliver this article via email and/or notifications to subscribers." + }, + "is_pinned": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Pinned", + "description": "If the article should be pinned" + }, + "og_image_url": { + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], + "title": "Og Image Url", + "description": "Custom og:image URL value" + }, + "og_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Og Description", + "description": "Custom og:description value" + } + }, + "type": "object", + "title": "ArticleUpdate" + }, + "ArticleVisibility": { + "type": "string", + "enum": [ + "public", + "hidden", + "private" + ], + "title": "ArticleVisibility" + }, + "Assignee": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "login": { + "type": "string", + "title": "Login" + }, + "html_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Html Url" + }, + "avatar_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Avatar Url" + } + }, + "type": "object", + "required": [ + "id", + "login", + "html_url", + "avatar_url" + ], + "title": "Assignee" + }, + "AttachedCustomField": { + "properties": { + "custom_field_id": { + "type": "string", + "format": "uuid4", + "title": "Custom Field Id", + "description": "ID of the custom field." + }, + "custom_field": { + "$ref": "#/components/schemas/CustomField" + }, + "order": { + "type": "integer", + "title": "Order", + "description": "Order of the custom field in the resource." + }, + "required": { "type": "boolean", - "title": "Is Details Submitted" + "title": "Required", + "description": "Whether the value is required for this custom field." + } + }, + "type": "object", + "required": [ + "custom_field_id", + "custom_field", + "order", + "required" + ], + "title": "AttachedCustomField", + "description": "Schema of a custom field attached to a resource." + }, + "AttachedCustomFieldCreate": { + "properties": { + "custom_field_id": { + "type": "string", + "format": "uuid4", + "title": "Custom Field Id", + "description": "ID of the custom field to attach." + }, + "required": { + "type": "boolean", + "title": "Required", + "description": "Whether the value is required for this custom field." + } + }, + "type": "object", + "required": [ + "custom_field_id", + "required" + ], + "title": "AttachedCustomFieldCreate", + "description": "Schema to attach a custom field to a resource." + }, + "Author": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "login": { + "type": "string", + "title": "Login" + }, + "html_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Html Url" + }, + "avatar_url": { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", + "title": "Avatar Url" + } + }, + "type": "object", + "required": [ + "id", + "login", + "html_url", + "avatar_url" + ], + "title": "Author" + }, + "AuthorizeOrganization": { + "properties": { + "id": { + "type": "string", + "format": "uuid4", + "title": "Id" + }, + "slug": { + "type": "string", + "title": "Slug" + }, + "avatar_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Avatar Url" + } + }, + "type": "object", + "required": [ + "id", + "slug", + "avatar_url" + ], + "title": "AuthorizeOrganization" + }, + "AuthorizeResponseOrganization": { + "properties": { + "client": { + "$ref": "#/components/schemas/OAuth2ClientPublic" + }, + "sub_type": { + "type": "string", + "enum": [ + "organization" + ], + "const": "organization", + "title": "Sub Type" + }, + "sub": { + "anyOf": [ + { + "$ref": "#/components/schemas/AuthorizeOrganization" + }, + { + "type": "null" + } + ] + }, + "scopes": { + "items": { + "$ref": "#/components/schemas/Scope" + }, + "type": "array", + "title": "Scopes" + }, + "organizations": { + "items": { + "$ref": "#/components/schemas/AuthorizeOrganization" + }, + "type": "array", + "title": "Organizations" + } + }, + "type": "object", + "required": [ + "client", + "sub_type", + "sub", + "scopes", + "organizations" + ], + "title": "AuthorizeResponseOrganization" + }, + "AuthorizeResponseUser": { + "properties": { + "client": { + "$ref": "#/components/schemas/OAuth2ClientPublic" + }, + "sub_type": { + "type": "string", + "enum": [ + "user" + ], + "const": "user", + "title": "Sub Type" + }, + "sub": { + "anyOf": [ + { + "$ref": "#/components/schemas/AuthorizeUser" + }, + { + "type": "null" + } + ] + }, + "scopes": { + "items": { + "$ref": "#/components/schemas/Scope" + }, + "type": "array", + "title": "Scopes" + } + }, + "type": "object", + "required": [ + "client", + "sub_type", + "sub", + "scopes" + ], + "title": "AuthorizeResponseUser" + }, + "AuthorizeUser": { + "properties": { + "id": { + "type": "string", + "format": "uuid4", + "title": "Id" + }, + "email": { + "type": "string", + "format": "email", + "title": "Email" + }, + "avatar_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Avatar Url" + } + }, + "type": "object", + "required": [ + "id", + "email", + "avatar_url" + ], + "title": "AuthorizeUser" + }, + "Benefit": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitArticles" + }, + { + "$ref": "#/components/schemas/BenefitAds" + }, + { + "$ref": "#/components/schemas/BenefitCustom" + }, + { + "$ref": "#/components/schemas/BenefitDiscord" + }, + { + "$ref": "#/components/schemas/BenefitGitHubRepository" + }, + { + "$ref": "#/components/schemas/BenefitDownloadables" + }, + { + "$ref": "#/components/schemas/BenefitLicenseKeys" + } + ] + }, + "BenefitAds": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Modified At", + "description": "Last modification timestamp of the object." + }, + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." }, - "is_charges_enabled": { + "type": { + "type": "string", + "enum": [ + "ads" + ], + "const": "ads", + "title": "Type" + }, + "description": { + "type": "string", + "title": "Description", + "description": "The description of the benefit." + }, + "selectable": { "type": "boolean", - "title": "Is Charges Enabled" + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." }, - "is_payouts_enabled": { + "deletable": { "type": "boolean", - "title": "Is Payouts Enabled" + "title": "Deletable", + "description": "Whether the benefit is deletable." }, - "country": { + "organization_id": { "type": "string", - "maxLength": 2, - "minLength": 2, - "title": "Country" - }, - "users": { - "items": { - "$ref": "#/components/schemas/UserBase" - }, - "type": "array", - "title": "Users" + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." }, - "organizations": { - "items": { - "$ref": "#/components/schemas/Organization" - }, - "type": "array", - "title": "Organizations" + "properties": { + "$ref": "#/components/schemas/BenefitAdsProperties" } }, "type": "object", "required": [ + "created_at", + "modified_at", "id", - "account_type", - "status", - "stripe_id", - "open_collective_slug", - "is_details_submitted", - "is_charges_enabled", - "is_payouts_enabled", - "country", - "users", - "organizations" + "type", + "description", + "selectable", + "deletable", + "organization_id", + "properties" ], - "title": "Account" + "title": "BenefitAds", + "description": "A benefit of type `ads`.\n\nUse it so your backers can display ads on your README, website, etc." }, - "AccountCreate": { + "BenefitAdsCreate": { "properties": { - "account_type": { - "$ref": "#/components/schemas/AccountType" + "type": { + "type": "string", + "enum": [ + "ads" + ], + "const": "ads", + "title": "Type" }, - "open_collective_slug": { + "description": { + "type": "string", + "maxLength": 42, + "minLength": 3, + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." + }, + "organization_id": { "anyOf": [ { "type": "string", - "minLength": 1 + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } ], - "title": "Open Collective Slug" + "title": "Organization Id", + "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" }, - "country": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "title": "Country", - "description": "Two letter uppercase country code" + "properties": { + "$ref": "#/components/schemas/BenefitAdsProperties" } }, "type": "object", "required": [ - "account_type", - "country" + "type", + "description", + "properties" ], - "title": "AccountCreate" + "title": "BenefitAdsCreate" }, - "AccountLink": { + "BenefitAdsProperties": { "properties": { - "url": { - "type": "string", - "title": "Url" + "image_height": { + "type": "integer", + "title": "Image Height", + "description": "The height of the displayed ad.", + "default": 400 + }, + "image_width": { + "type": "integer", + "title": "Image Width", + "description": "The width of the displayed ad.", + "default": 400 } }, "type": "object", - "required": [ - "url" - ], - "title": "AccountLink" - }, - "AccountType": { - "type": "string", - "enum": [ - "stripe", - "open_collective" - ], - "title": "AccountType" + "title": "BenefitAdsProperties", + "description": "Properties for a benefit of type `ads`." }, - "Address": { + "BenefitAdsSubscriber": { "properties": { - "line1": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { "anyOf": [ { - "type": "string" + "type": "string", + "format": "date-time" }, { "type": "null" } ], - "title": "Line1" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "line2": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." + }, + "type": { + "type": "string", + "enum": [ + "ads" ], - "title": "Line2" + "const": "ads", + "title": "Type" }, - "postal_code": { + "description": { + "type": "string", + "title": "Description", + "description": "The description of the benefit." + }, + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." + }, + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "grants": { + "items": { + "$ref": "#/components/schemas/BenefitGrantAds" + }, + "type": "array", + "title": "Grants" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "properties": { + "$ref": "#/components/schemas/BenefitAdsProperties" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id", + "grants", + "organization", + "properties" + ], + "title": "BenefitAdsSubscriber" + }, + "BenefitAdsUpdate": { + "properties": { + "description": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 42, + "minLength": 3 }, { "type": "null" } ], - "title": "Postal Code" + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." }, - "city": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "ads" ], - "title": "City" + "const": "ads", + "title": "Type" }, - "state": { + "properties": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BenefitAdsProperties" }, { "type": "null" } - ], - "title": "State" - }, - "country": { - "type": "string", - "pattern": "^\\w{2}$", - "title": "Country" + ] } }, "type": "object", "required": [ - "country" + "type" ], - "title": "Address" + "title": "BenefitAdsUpdate" }, - "AdvertisementCampaign": { + "BenefitArticles": { "properties": { "created_at": { "type": "string", @@ -14715,39 +16549,40 @@ "id": { "type": "string", "format": "uuid4", - "title": "Id" + "title": "Id", + "description": "The ID of the benefit." }, - "image_url": { + "type": { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", - "title": "Image Url" - }, - "image_url_dark": { - "anyOf": [ - { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri" - }, - { - "type": "null" - } + "enum": [ + "articles" ], - "title": "Image Url Dark" + "const": "articles", + "title": "Type" }, - "text": { + "description": { "type": "string", - "title": "Text" + "title": "Description", + "description": "The description of the benefit." }, - "link_url": { + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." + }, + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", - "title": "Link Url" + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "properties": { + "$ref": "#/components/schemas/BenefitArticlesProperties" } }, "type": "object", @@ -14755,134 +16590,172 @@ "created_at", "modified_at", "id", - "image_url", - "image_url_dark", - "text", - "link_url" + "type", + "description", + "selectable", + "deletable", + "organization_id", + "properties" ], - "title": "AdvertisementCampaign" + "title": "BenefitArticles", + "description": "A benefit of type `articles`.\n\nUse it to grant access to posts." }, - "AdvertisementCampaignListResource": { + "BenefitArticlesProperties": { "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/AdvertisementCampaign" - }, - "type": "array", - "title": "Items" - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" - }, - "dimensions": { - "prefixItems": [ - { - "type": "integer" - }, - { - "type": "integer" - } - ], - "items": { - "type": "integer" - }, - "type": "array", - "maxItems": 2, - "minItems": 2, - "title": "Dimensions", - "description": "The dimensions (width, height) in pixels of the advertisement images." + "paid_articles": { + "type": "boolean", + "title": "Paid Articles", + "description": "Whether the user can access paid articles." } }, "type": "object", "required": [ - "items", - "pagination", - "dimensions" - ], - "title": "AdvertisementCampaignListResource" - }, - "AdvertisementSortProperty": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "granted_at", - "-granted_at", - "views", - "-views", - "clicks", - "-clicks" + "paid_articles" ], - "title": "AdvertisementSortProperty" + "title": "BenefitArticlesProperties", + "description": "Properties for a benefit of type `articles`." }, - "AlreadyCanceledSubscription": { + "BenefitArticlesSubscriber": { "properties": { - "type": { + "created_at": { "type": "string", - "enum": [ - "AlreadyCanceledSubscription" + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } ], - "const": "AlreadyCanceledSubscription", - "title": "Type" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "detail": { - "type": "string", - "title": "Detail" - } - }, - "type": "object", - "required": [ - "type", - "detail" - ], - "title": "AlreadyCanceledSubscription" - }, - "Article": { - "properties": { "id": { "type": "string", "format": "uuid4", - "title": "Id" + "title": "Id", + "description": "The ID of the benefit." }, - "slug": { + "type": { "type": "string", - "title": "Slug" + "enum": [ + "articles" + ], + "const": "articles", + "title": "Type" }, - "title": { + "description": { "type": "string", - "title": "Title" + "title": "Description", + "description": "The description of the benefit." }, - "body": { + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." + }, + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { "type": "string", - "title": "Body" + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." }, - "byline": { - "$ref": "#/components/schemas/BylineProfile" + "grants": { + "items": { + "$ref": "#/components/schemas/BenefitGrantSubscriber" + }, + "type": "array", + "title": "Grants" }, - "visibility": { - "$ref": "#/components/schemas/ArticleVisibility" + "organization": { + "$ref": "#/components/schemas/Organization" }, - "user_id": { + "properties": { + "$ref": "#/components/schemas/BenefitArticlesSubscriberProperties" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id", + "grants", + "organization", + "properties" + ], + "title": "BenefitArticlesSubscriber" + }, + "BenefitArticlesSubscriberProperties": { + "properties": { + "paid_articles": { + "type": "boolean", + "title": "Paid Articles", + "description": "Whether the user can access paid articles." + } + }, + "type": "object", + "required": [ + "paid_articles" + ], + "title": "BenefitArticlesSubscriberProperties", + "description": "Properties available to subscribers for a benefit of type `articles`." + }, + "BenefitArticlesUpdate": { + "properties": { + "description": { "anyOf": [ { "type": "string", - "format": "uuid4" + "maxLength": 42, + "minLength": 3 }, { "type": "null" } ], - "title": "User Id" + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." }, - "organization_id": { + "type": { "type": "string", - "format": "uuid4", - "title": "Organization Id" - }, - "organization": { - "$ref": "#/components/schemas/Organization" + "enum": [ + "articles" + ], + "const": "articles", + "title": "Type" + } + }, + "type": "object", + "required": [ + "type" + ], + "title": "BenefitArticlesUpdate" + }, + "BenefitBase": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." }, - "published_at": { + "modified_at": { "anyOf": [ { "type": "string", @@ -14892,51 +16765,63 @@ "type": "null" } ], - "title": "Published At" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "paid_subscribers_only": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Paid Subscribers Only" + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." }, - "paid_subscribers_only_ends_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "title": "Paid Subscribers Only Ends At" + "type": { + "$ref": "#/components/schemas/BenefitType", + "description": "The type of the benefit." }, - "is_preview": { + "description": { + "type": "string", + "title": "Description", + "description": "The description of the benefit." + }, + "selectable": { "type": "boolean", - "title": "Is Preview" + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." }, - "is_pinned": { + "deletable": { "type": "boolean", - "title": "Is Pinned" + "title": "Deletable", + "description": "Whether the benefit is deletable." }, - "notify_subscribers": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Notify Subscribers" + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id" + ], + "title": "BenefitBase" + }, + "BenefitCustom": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." }, - "notifications_sent_at": { + "modified_at": { "anyOf": [ { "type": "string", @@ -14946,117 +16831,85 @@ "type": "null" } ], - "title": "Notifications Sent At" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "email_sent_to_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Email Sent To Count" + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." }, - "og_image_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "custom" ], - "title": "Og Image Url" + "const": "custom", + "title": "Type" }, - "og_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Og Description" + "description": { + "type": "string", + "title": "Description", + "description": "The description of the benefit." + }, + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." + }, + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "properties": { + "$ref": "#/components/schemas/BenefitCustomProperties" + }, + "is_tax_applicable": { + "type": "boolean", + "title": "Is Tax Applicable", + "description": "Whether the benefit is taxable." } }, "type": "object", "required": [ + "created_at", + "modified_at", "id", - "slug", - "title", - "body", - "byline", - "visibility", - "user_id", - "organization_id", - "organization", - "published_at", - "paid_subscribers_only", - "paid_subscribers_only_ends_at", - "is_preview", - "is_pinned", - "notify_subscribers", - "notifications_sent_at", - "email_sent_to_count", - "og_image_url", - "og_description" - ], - "title": "Article" - }, - "ArticleByline": { - "type": "string", - "enum": [ - "user", - "organization" - ], - "title": "ArticleByline" - }, - "ArticleCreate": { - "properties": { - "title": { - "type": "string", - "minLength": 1, - "title": "Title", - "description": "Title of the article." - }, - "slug": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Slug", - "description": "Slug of the article to be used in URLs. If no slug is provided one will be generated from the title." - }, - "body": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type", + "description", + "selectable", + "deletable", + "organization_id", + "properties", + "is_tax_applicable" + ], + "title": "BenefitCustom", + "description": "A benefit of type `custom`.\n\nUse it to grant any kind of benefit that doesn't fit in the other types." + }, + "BenefitCustomCreate": { + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" ], - "title": "Body", - "description": "Body in string format. Either one of body or body_base64 is required." + "const": "custom", + "title": "Type" }, - "body_base64": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Body Base64", - "description": "Body in base64-encoded format. Can be helpful to bypass Web Application Firewalls (WAF). Either one of body or body_base64 is required." + "description": { + "type": "string", + "maxLength": 42, + "minLength": 3, + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." }, "organization_id": { "anyOf": [ @@ -15075,227 +16928,247 @@ } ], "title": "Organization Id", - "description": "The ID of the organization owning the article. **Required unless you use an organization token.**" - }, - "byline": { - "$ref": "#/components/schemas/ArticleByline", - "description": "If the user or organization should be credited in the byline.", - "default": "organization" - }, - "visibility": { - "$ref": "#/components/schemas/ArticleVisibility", - "default": "private" + "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" }, - "paid_subscribers_only": { + "is_tax_applicable": { "type": "boolean", - "title": "Paid Subscribers Only", - "description": "Set to true to only make this article available for subscribers to a paid subscription tier in the organization.", - "default": false + "title": "Is Tax Applicable", + "description": "Whether the benefit is taxable." }, - "paid_subscribers_only_ends_at": { + "properties": { + "$ref": "#/components/schemas/BenefitCustomCreateProperties" + } + }, + "type": "object", + "required": [ + "type", + "description", + "is_tax_applicable", + "properties" + ], + "title": "BenefitCustomCreate", + "description": "Schema to create a benefit of type `custom`." + }, + "BenefitCustomCreateProperties": { + "properties": { + "note": { "anyOf": [ { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Private note to be shared with users who have this benefit granted." }, { "type": "null" } ], - "title": "Paid Subscribers Only Ends At", - "description": "If specified, time at which the article should no longer be restricted to paid subscribers. Only relevant if `paid_subscribers_only` is true." - }, - "published_at": { + "title": "Note" + } + }, + "type": "object", + "title": "BenefitCustomCreateProperties", + "description": "Properties for creating a benefit of type `custom`." + }, + "BenefitCustomProperties": { + "properties": { + "note": { "anyOf": [ { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Private note to be shared with users who have this benefit granted." }, { "type": "null" } ], - "title": "Published At", - "description": "Time of publishing. If this date is in the future, the post will be scheduled to publish at this time. If visibility is 'public', published_at will default to the current time." + "title": "Note" + } + }, + "type": "object", + "required": [ + "note" + ], + "title": "BenefitCustomProperties", + "description": "Properties for a benefit of type `custom`." + }, + "BenefitCustomSubscriber": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." }, - "notify_subscribers": { + "modified_at": { "anyOf": [ { - "type": "boolean" + "type": "string", + "format": "date-time" }, { "type": "null" } ], - "title": "Notify Subscribers", - "description": "Set to true to deliver this article via email and/or notifications to subscribers." + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "is_pinned": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Is Pinned", - "description": "If the article should be pinned" + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." }, - "og_image_url": { - "anyOf": [ - { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "custom" ], - "title": "Og Image Url", - "description": "Custom og:image URL value" + "const": "custom", + "title": "Type" }, - "og_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Og Description", - "description": "Custom og:description value" - } - }, - "type": "object", - "required": [ - "title" - ], - "title": "ArticleCreate" - }, - "ArticlePreview": { - "properties": { - "email": { + "description": { "type": "string", - "format": "email", - "title": "Email", - "description": "Email address to send the preview to. The user must be registered on Polar." - } - }, - "type": "object", - "required": [ - "email" - ], - "title": "ArticlePreview" - }, - "ArticleReceivers": { - "properties": { - "free_subscribers": { - "type": "integer", - "title": "Free Subscribers" + "title": "Description", + "description": "The description of the benefit." }, - "premium_subscribers": { - "type": "integer", - "title": "Premium Subscribers" + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." }, - "organization_members": { - "type": "integer", - "title": "Organization Members" + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "grants": { + "items": { + "$ref": "#/components/schemas/BenefitGrantSubscriber" + }, + "type": "array", + "title": "Grants" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "properties": { + "$ref": "#/components/schemas/BenefitCustomSubscriberProperties" } }, "type": "object", "required": [ - "free_subscribers", - "premium_subscribers", - "organization_members" + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id", + "grants", + "organization", + "properties" ], - "title": "ArticleReceivers" + "title": "BenefitCustomSubscriber" }, - "ArticleUpdate": { + "BenefitCustomSubscriberProperties": { "properties": { - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Title" - }, - "body": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Body", - "description": "Body in string format. body and body_base64 are mutually exclusive." - }, - "body_base64": { + "note": { "anyOf": [ { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Private note to be shared with users who have this benefit granted." }, { "type": "null" } ], - "title": "Body Base64", - "description": "Body in base64-encoded format. Can be helpful to bypass Web Application Firewalls (WAF). body and body_base64 are mutually exclusive." - }, - "slug": { + "title": "Note" + } + }, + "type": "object", + "required": [ + "note" + ], + "title": "BenefitCustomSubscriberProperties", + "description": "Properties available to subscribers for a benefit of type `custom`." + }, + "BenefitCustomUpdate": { + "properties": { + "description": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 42, + "minLength": 3 }, { "type": "null" } ], - "title": "Slug" + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." }, - "byline": { - "anyOf": [ - { - "$ref": "#/components/schemas/ArticleByline" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "custom" ], - "description": "If the user or organization should be credited in the byline." + "const": "custom", + "title": "Type" }, - "visibility": { + "properties": { "anyOf": [ { - "$ref": "#/components/schemas/ArticleVisibility" + "$ref": "#/components/schemas/BenefitCustomProperties" }, { "type": "null" } ] + } + }, + "type": "object", + "required": [ + "type" + ], + "title": "BenefitCustomUpdate" + }, + "BenefitDiscord": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." }, - "paid_subscribers_only": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Paid Subscribers Only", - "description": "Set to true to only make this article available for subscribers to a paid subscription tier in the organization." - }, - "paid_subscribers_only_ends_at": { + "modified_at": { "anyOf": [ { "type": "string", @@ -15305,331 +17178,301 @@ "type": "null" } ], - "title": "Paid Subscribers Only Ends At", - "description": "If specified, time at which the article should no longer be restricted to paid subscribers. Only relevant if `paid_subscribers_only` is true." + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "published_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "title": "Published At", - "description": "Time of publishing. If this date is in the future, the post will be scheduled to publish at this time." + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." }, - "notify_subscribers": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "discord" ], - "title": "Notify Subscribers", - "description": "Set to true to deliver this article via email and/or notifications to subscribers." + "const": "discord", + "title": "Type" }, - "is_pinned": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } + "description": { + "type": "string", + "title": "Description", + "description": "The description of the benefit." + }, + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." + }, + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "properties": { + "$ref": "#/components/schemas/BenefitDiscordProperties" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id", + "properties" + ], + "title": "BenefitDiscord", + "description": "A benefit of type `discord`.\n\nUse it to automatically invite your backers to a Discord server." + }, + "BenefitDiscordCreate": { + "properties": { + "type": { + "type": "string", + "enum": [ + "discord" ], - "title": "Is Pinned", - "description": "If the article should be pinned" + "const": "discord", + "title": "Type" }, - "og_image_url": { + "description": { + "type": "string", + "maxLength": 42, + "minLength": 3, + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." + }, + "organization_id": { "anyOf": [ { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri" + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } ], - "title": "Og Image Url", - "description": "Custom og:image URL value" + "title": "Organization Id", + "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" }, - "og_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Og Description", - "description": "Custom og:description value" + "properties": { + "$ref": "#/components/schemas/BenefitDiscordCreateProperties" } }, "type": "object", - "title": "ArticleUpdate" - }, - "ArticleVisibility": { - "type": "string", - "enum": [ - "public", - "hidden", - "private" + "required": [ + "type", + "description", + "properties" ], - "title": "ArticleVisibility" + "title": "BenefitDiscordCreate" }, - "Assignee": { + "BenefitDiscordCreateProperties": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "login": { - "type": "string", - "title": "Login" - }, - "html_url": { + "guild_token": { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", - "title": "Html Url" + "title": "Guild Token" }, - "avatar_url": { + "role_id": { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", - "title": "Avatar Url" + "title": "Role Id", + "description": "The ID of the Discord role to grant." } }, "type": "object", "required": [ - "id", - "login", - "html_url", - "avatar_url" + "guild_token", + "role_id" ], - "title": "Assignee" + "title": "BenefitDiscordCreateProperties", + "description": "Properties to create a benefit of type `discord`." }, - "Author": { + "BenefitDiscordProperties": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "login": { + "guild_id": { "type": "string", - "title": "Login" + "title": "Guild Id", + "description": "The ID of the Discord server." }, - "html_url": { + "role_id": { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", - "title": "Html Url" + "title": "Role Id", + "description": "The ID of the Discord role to grant." }, - "avatar_url": { + "guild_token": { "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", - "title": "Avatar Url" + "title": "Guild Token", + "readOnly": true } }, "type": "object", "required": [ - "id", - "login", - "html_url", - "avatar_url" + "guild_id", + "role_id", + "guild_token" ], - "title": "Author" + "title": "BenefitDiscordProperties", + "description": "Properties for a benefit of type `discord`." }, - "AuthorizeOrganization": { + "BenefitDiscordSubscriber": { "properties": { - "id": { - "type": "string", - "format": "uuid4", - "title": "Id" - }, - "slug": { + "created_at": { "type": "string", - "title": "Slug" + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." }, - "avatar_url": { + "modified_at": { "anyOf": [ { - "type": "string" + "type": "string", + "format": "date-time" }, { "type": "null" } ], - "title": "Avatar Url" - } - }, - "type": "object", - "required": [ - "id", - "slug", - "avatar_url" - ], - "title": "AuthorizeOrganization" - }, - "AuthorizeResponseOrganization": { - "properties": { - "client": { - "$ref": "#/components/schemas/OAuth2ClientPublic" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "sub_type": { + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the benefit." + }, + "type": { "type": "string", "enum": [ - "organization" + "discord" ], - "const": "organization", - "title": "Sub Type" + "const": "discord", + "title": "Type" }, - "sub": { - "anyOf": [ - { - "$ref": "#/components/schemas/AuthorizeOrganization" - }, - { - "type": "null" - } - ] + "description": { + "type": "string", + "title": "Description", + "description": "The description of the benefit." }, - "scopes": { - "items": { - "$ref": "#/components/schemas/Scope" - }, - "type": "array", - "title": "Scopes" + "selectable": { + "type": "boolean", + "title": "Selectable", + "description": "Whether the benefit is selectable when creating a product." }, - "organizations": { + "deletable": { + "type": "boolean", + "title": "Deletable", + "description": "Whether the benefit is deletable." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "grants": { "items": { - "$ref": "#/components/schemas/AuthorizeOrganization" + "$ref": "#/components/schemas/BenefitGrantSubscriber" }, "type": "array", - "title": "Organizations" + "title": "Grants" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "properties": { + "$ref": "#/components/schemas/BenefitDiscordSubscriberProperties" } }, "type": "object", "required": [ - "client", - "sub_type", - "sub", - "scopes", - "organizations" + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id", + "grants", + "organization", + "properties" ], - "title": "AuthorizeResponseOrganization" + "title": "BenefitDiscordSubscriber" }, - "AuthorizeResponseUser": { + "BenefitDiscordSubscriberProperties": { "properties": { - "client": { - "$ref": "#/components/schemas/OAuth2ClientPublic" - }, - "sub_type": { + "guild_id": { "type": "string", - "enum": [ - "user" - ], - "const": "user", - "title": "Sub Type" - }, - "sub": { - "anyOf": [ - { - "$ref": "#/components/schemas/AuthorizeUser" - }, - { - "type": "null" - } - ] - }, - "scopes": { - "items": { - "$ref": "#/components/schemas/Scope" - }, - "type": "array", - "title": "Scopes" + "title": "Guild Id", + "description": "The ID of the Discord server." } }, "type": "object", "required": [ - "client", - "sub_type", - "sub", - "scopes" + "guild_id" ], - "title": "AuthorizeResponseUser" + "title": "BenefitDiscordSubscriberProperties", + "description": "Properties available to subscribers for a benefit of type `discord`." }, - "AuthorizeUser": { + "BenefitDiscordUpdate": { "properties": { - "id": { - "type": "string", - "format": "uuid4", - "title": "Id" + "description": { + "anyOf": [ + { + "type": "string", + "maxLength": 42, + "minLength": 3 + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." }, - "email": { + "type": { "type": "string", - "format": "email", - "title": "Email" + "enum": [ + "discord" + ], + "const": "discord", + "title": "Type" }, - "avatar_url": { + "properties": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BenefitDiscordCreateProperties" }, { "type": "null" } - ], - "title": "Avatar Url" + ] } }, "type": "object", "required": [ - "id", - "email", - "avatar_url" + "type" ], - "title": "AuthorizeUser" - }, - "Benefit": { - "anyOf": [ - { - "$ref": "#/components/schemas/BenefitArticles" - }, - { - "$ref": "#/components/schemas/BenefitAds" - }, - { - "$ref": "#/components/schemas/BenefitCustom" - }, - { - "$ref": "#/components/schemas/BenefitDiscord" - }, - { - "$ref": "#/components/schemas/BenefitGitHubRepository" - }, - { - "$ref": "#/components/schemas/BenefitDownloadables" - }, - { - "$ref": "#/components/schemas/BenefitLicenseKeys" - } - ] + "title": "BenefitDiscordUpdate" }, - "BenefitAds": { + "BenefitDownloadables": { "properties": { "created_at": { "type": "string", @@ -15659,9 +17502,9 @@ "type": { "type": "string", "enum": [ - "ads" + "downloadables" ], - "const": "ads", + "const": "downloadables", "title": "Type" }, "description": { @@ -15686,7 +17529,7 @@ "description": "The ID of the organization owning the benefit." }, "properties": { - "$ref": "#/components/schemas/BenefitAdsProperties" + "$ref": "#/components/schemas/BenefitDownloadablesProperties" } }, "type": "object", @@ -15701,17 +17544,16 @@ "organization_id", "properties" ], - "title": "BenefitAds", - "description": "A benefit of type `ads`.\n\nUse it so your backers can display ads on your README, website, etc." + "title": "BenefitDownloadables" }, - "BenefitAdsCreate": { + "BenefitDownloadablesCreate": { "properties": { "type": { "type": "string", "enum": [ - "ads" + "downloadables" ], - "const": "ads", + "const": "downloadables", "title": "Type" }, "description": { @@ -15741,7 +17583,7 @@ "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" }, "properties": { - "$ref": "#/components/schemas/BenefitAdsProperties" + "$ref": "#/components/schemas/BenefitDownloadablesCreateProperties" } }, "type": "object", @@ -15750,28 +17592,59 @@ "description", "properties" ], - "title": "BenefitAdsCreate" + "title": "BenefitDownloadablesCreate" }, - "BenefitAdsProperties": { + "BenefitDownloadablesCreateProperties": { "properties": { - "image_height": { - "type": "integer", - "title": "Image Height", - "description": "The height of the displayed ad.", - "default": 400 + "archived": { + "additionalProperties": { + "type": "boolean" + }, + "type": "object", + "title": "Archived", + "default": {} }, - "image_width": { - "type": "integer", - "title": "Image Width", - "description": "The width of the displayed ad.", - "default": 400 + "files": { + "items": { + "type": "string", + "format": "uuid4" + }, + "type": "array", + "title": "Files" } }, "type": "object", - "title": "BenefitAdsProperties", - "description": "Properties for a benefit of type `ads`." + "required": [ + "files" + ], + "title": "BenefitDownloadablesCreateProperties" }, - "BenefitAdsSubscriber": { + "BenefitDownloadablesProperties": { + "properties": { + "archived": { + "additionalProperties": { + "type": "boolean" + }, + "type": "object", + "title": "Archived" + }, + "files": { + "items": { + "type": "string", + "format": "uuid4" + }, + "type": "array", + "title": "Files" + } + }, + "type": "object", + "required": [ + "archived", + "files" + ], + "title": "BenefitDownloadablesProperties" + }, + "BenefitDownloadablesSubscriber": { "properties": { "created_at": { "type": "string", @@ -15801,9 +17674,9 @@ "type": { "type": "string", "enum": [ - "ads" + "downloadables" ], - "const": "ads", + "const": "downloadables", "title": "Type" }, "description": { @@ -15827,15 +17700,18 @@ "title": "Organization Id", "description": "The ID of the organization owning the benefit." }, - "properties": { - "$ref": "#/components/schemas/BenefitAdsProperties" - }, "grants": { "items": { - "$ref": "#/components/schemas/BenefitGrantAds" + "$ref": "#/components/schemas/BenefitGrantSubscriber" }, "type": "array", "title": "Grants" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "properties": { + "$ref": "#/components/schemas/BenefitDownloadablesSubscriberProperties" } }, "type": "object", @@ -15848,12 +17724,30 @@ "selectable", "deletable", "organization_id", - "properties", - "grants" + "grants", + "organization", + "properties" ], - "title": "BenefitAdsSubscriber" + "title": "BenefitDownloadablesSubscriber" }, - "BenefitAdsUpdate": { + "BenefitDownloadablesSubscriberProperties": { + "properties": { + "active_files": { + "items": { + "type": "string", + "format": "uuid4" + }, + "type": "array", + "title": "Active Files" + } + }, + "type": "object", + "required": [ + "active_files" + ], + "title": "BenefitDownloadablesSubscriberProperties" + }, + "BenefitDownloadablesUpdate": { "properties": { "description": { "anyOf": [ @@ -15872,119 +17766,29 @@ "type": { "type": "string", "enum": [ - "ads" + "downloadables" ], - "const": "ads", + "const": "downloadables", "title": "Type" }, "properties": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitAdsProperties" - }, - { - "type": "null" - } - ] - } - }, - "type": "object", - "required": [ - "type" - ], - "title": "BenefitAdsUpdate" - }, - "BenefitArticles": { - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." - }, - "modified_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" + "$ref": "#/components/schemas/BenefitDownloadablesCreateProperties" }, { - "type": "null" - } - ], - "title": "Modified At", - "description": "Last modification timestamp of the object." - }, - "id": { - "type": "string", - "format": "uuid4", - "title": "Id", - "description": "The ID of the benefit." - }, - "type": { - "type": "string", - "enum": [ - "articles" - ], - "const": "articles", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." - }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." - }, - "organization_id": { - "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." - }, - "properties": { - "$ref": "#/components/schemas/BenefitArticlesProperties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", - "properties" - ], - "title": "BenefitArticles", - "description": "A benefit of type `articles`.\n\nUse it to grant access to posts." - }, - "BenefitArticlesProperties": { - "properties": { - "paid_articles": { - "type": "boolean", - "title": "Paid Articles", - "description": "Whether the user can access paid articles." + "type": "null" + } + ] } }, "type": "object", "required": [ - "paid_articles" + "type" ], - "title": "BenefitArticlesProperties", - "description": "Properties for a benefit of type `articles`." + "title": "BenefitDownloadablesUpdate" }, - "BenefitArticlesSubscriber": { + "BenefitGitHubRepository": { "properties": { "created_at": { "type": "string", @@ -16014,9 +17818,9 @@ "type": { "type": "string", "enum": [ - "articles" + "github_repository" ], - "const": "articles", + "const": "github_repository", "title": "Type" }, "description": { @@ -16041,7 +17845,7 @@ "description": "The ID of the organization owning the benefit." }, "properties": { - "$ref": "#/components/schemas/BenefitArticlesSubscriberProperties" + "$ref": "#/components/schemas/BenefitGitHubRepositoryProperties" } }, "type": "object", @@ -16056,55 +17860,175 @@ "organization_id", "properties" ], - "title": "BenefitArticlesSubscriber" + "title": "BenefitGitHubRepository", + "description": "A benefit of type `github_repository`.\n\nUse it to automatically invite your backers to a private GitHub repository." }, - "BenefitArticlesSubscriberProperties": { + "BenefitGitHubRepositoryCreate": { "properties": { - "paid_articles": { - "type": "boolean", - "title": "Paid Articles", - "description": "Whether the user can access paid articles." + "type": { + "type": "string", + "enum": [ + "github_repository" + ], + "const": "github_repository", + "title": "Type" + }, + "description": { + "type": "string", + "maxLength": 42, + "minLength": 3, + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." + }, + "organization_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } + }, + { + "type": "null" + } + ], + "title": "Organization Id", + "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" + }, + "properties": { + "$ref": "#/components/schemas/BenefitGitHubRepositoryCreateProperties" } }, "type": "object", "required": [ - "paid_articles" + "type", + "description", + "properties" ], - "title": "BenefitArticlesSubscriberProperties", - "description": "Properties available to subscribers for a benefit of type `articles`." + "title": "BenefitGitHubRepositoryCreate" }, - "BenefitArticlesUpdate": { + "BenefitGitHubRepositoryCreateProperties": { "properties": { - "description": { + "repository_id": { "anyOf": [ { "type": "string", - "maxLength": 42, - "minLength": 3 + "format": "uuid4" }, { "type": "null" } ], - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "title": "Repository Id" }, - "type": { + "repository_owner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Repository Owner", + "description": "The owner of the repository.", + "examples": [ + "polarsource" + ] + }, + "repository_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Repository Name", + "description": "The name of the repository.", + "examples": [ + "private_repo" + ] + }, + "permission": { "type": "string", "enum": [ - "articles" + "pull", + "triage", + "push", + "maintain", + "admin" ], - "const": "articles", - "title": "Type" + "title": "Permission", + "description": "The permission level to grant. Read more about roles and their permissions on [GitHub documentation](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role)." } }, "type": "object", "required": [ - "type" + "permission" ], - "title": "BenefitArticlesUpdate" + "title": "BenefitGitHubRepositoryCreateProperties", + "description": "Properties to create a benefit of type `github_repository`." }, - "BenefitBase": { + "BenefitGitHubRepositoryProperties": { + "properties": { + "repository_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4" + }, + { + "type": "null" + } + ], + "title": "Repository Id" + }, + "repository_owner": { + "type": "string", + "title": "Repository Owner", + "description": "The owner of the repository.", + "examples": [ + "polarsource" + ] + }, + "repository_name": { + "type": "string", + "title": "Repository Name", + "description": "The name of the repository.", + "examples": [ + "private_repo" + ] + }, + "permission": { + "type": "string", + "enum": [ + "pull", + "triage", + "push", + "maintain", + "admin" + ], + "title": "Permission", + "description": "The permission level to grant. Read more about roles and their permissions on [GitHub documentation](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role)." + } + }, + "type": "object", + "required": [ + "repository_id", + "repository_owner", + "repository_name", + "permission" + ], + "title": "BenefitGitHubRepositoryProperties", + "description": "Properties for a benefit of type `github_repository`." + }, + "BenefitGitHubRepositorySubscriber": { "properties": { "created_at": { "type": "string", @@ -16132,8 +18056,12 @@ "description": "The ID of the benefit." }, "type": { - "$ref": "#/components/schemas/BenefitType", - "description": "The type of the benefit." + "type": "string", + "enum": [ + "github_repository" + ], + "const": "github_repository", + "title": "Type" }, "description": { "type": "string", @@ -16150,27 +18078,111 @@ "title": "Deletable", "description": "Whether the benefit is deletable." }, - "organization_id": { + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the benefit." + }, + "grants": { + "items": { + "$ref": "#/components/schemas/BenefitGrantSubscriber" + }, + "type": "array", + "title": "Grants" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "properties": { + "$ref": "#/components/schemas/BenefitGitHubRepositorySubscriberProperties" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "type", + "description", + "selectable", + "deletable", + "organization_id", + "grants", + "organization", + "properties" + ], + "title": "BenefitGitHubRepositorySubscriber" + }, + "BenefitGitHubRepositorySubscriberProperties": { + "properties": { + "repository_owner": { + "type": "string", + "title": "Repository Owner", + "description": "The owner of the repository.", + "examples": [ + "polarsource" + ] + }, + "repository_name": { + "type": "string", + "title": "Repository Name", + "description": "The name of the repository.", + "examples": [ + "private_repo" + ] + } + }, + "type": "object", + "required": [ + "repository_owner", + "repository_name" + ], + "title": "BenefitGitHubRepositorySubscriberProperties", + "description": "Properties available to subscribers for a benefit of type `github_repository`." + }, + "BenefitGitHubRepositoryUpdate": { + "properties": { + "description": { + "anyOf": [ + { + "type": "string", + "maxLength": 42, + "minLength": 3 + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." + }, + "type": { "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." + "enum": [ + "github_repository" + ], + "const": "github_repository", + "title": "Type" + }, + "properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitGitHubRepositoryCreateProperties" + }, + { + "type": "null" + } + ] } }, "type": "object", "required": [ - "created_at", - "modified_at", - "id", - "type", - "description", - "selectable", - "deletable", - "organization_id" + "type" ], - "title": "BenefitBase" + "title": "BenefitGitHubRepositoryUpdate" }, - "BenefitCustom": { + "BenefitGrant": { "properties": { "created_at": { "type": "string", @@ -16195,173 +18207,125 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the benefit." + "description": "The ID of the grant." }, - "type": { - "type": "string", - "enum": [ - "custom" + "granted_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } ], - "const": "custom", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." - }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." - }, - "organization_id": { - "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." - }, - "properties": { - "$ref": "#/components/schemas/BenefitCustomProperties" + "title": "Granted At", + "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." }, - "is_tax_applicable": { + "is_granted": { "type": "boolean", - "title": "Is Tax Applicable", - "description": "Whether the benefit is taxable." - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", - "properties", - "is_tax_applicable" - ], - "title": "BenefitCustom", - "description": "A benefit of type `custom`.\n\nUse it to grant any kind of benefit that doesn't fit in the other types." - }, - "BenefitCustomCreate": { - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "const": "custom", - "title": "Type" - }, - "description": { - "type": "string", - "maxLength": 42, - "minLength": 3, - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "title": "Is Granted", + "description": "Whether the benefit is granted." }, - "organization_id": { + "revoked_at": { "anyOf": [ { "type": "string", - "format": "uuid4", - "description": "The organization ID.", - "x-polar-selector-widget": { - "displayProperty": "name", - "resourceName": "Organization", - "resourceRoot": "/v1/organizations" - } + "format": "date-time" }, { "type": "null" } ], - "title": "Organization Id", - "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" + "title": "Revoked At", + "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." }, - "is_tax_applicable": { + "is_revoked": { "type": "boolean", - "title": "Is Tax Applicable", - "description": "Whether the benefit is taxable." + "title": "Is Revoked", + "description": "Whether the benefit is revoked." }, - "properties": { - "$ref": "#/components/schemas/BenefitCustomCreateProperties" - } - }, - "type": "object", - "required": [ - "type", - "description", - "is_tax_applicable", - "properties" - ], - "title": "BenefitCustomCreate", - "description": "Schema to create a benefit of type `custom`." - }, - "BenefitCustomCreateProperties": { - "properties": { - "note": { + "subscription_id": { "anyOf": [ { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Private note to be shared with users who have this benefit granted." + "type": "string", + "format": "uuid4" }, { "type": "null" } ], - "title": "Note" - } - }, - "type": "object", - "title": "BenefitCustomCreateProperties", - "description": "Properties for creating a benefit of type `custom`." - }, - "BenefitCustomProperties": { - "properties": { - "note": { + "title": "Subscription Id", + "description": "The ID of the subscription that granted this benefit." + }, + "order_id": { "anyOf": [ { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Private note to be shared with users who have this benefit granted." + "type": "string", + "format": "uuid4" }, { "type": "null" } ], - "title": "Note" + "title": "Order Id", + "description": "The ID of the order that granted this benefit." + }, + "user_id": { + "type": "string", + "format": "uuid4", + "title": "User Id", + "description": "The ID of the user concerned by this grant." + }, + "benefit_id": { + "type": "string", + "format": "uuid4", + "title": "Benefit Id", + "description": "The ID of the benefit concerned by this grant." + }, + "properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitGrantDiscordProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantGitHubRepositoryProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantDownloadablesProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantAdsProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantCustomProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantArticlesProperties" + } + ], + "title": "Properties" } }, "type": "object", "required": [ - "note" + "created_at", + "modified_at", + "id", + "is_granted", + "is_revoked", + "subscription_id", + "order_id", + "user_id", + "benefit_id", + "properties" ], - "title": "BenefitCustomProperties", - "description": "Properties for a benefit of type `custom`." + "title": "BenefitGrant" }, - "BenefitCustomSubscriber": { + "BenefitGrantAds": { "properties": { "created_at": { "type": "string", @@ -16386,191 +18350,84 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the benefit." - }, - "type": { - "type": "string", - "enum": [ - "custom" - ], - "const": "custom", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." - }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." - }, - "organization_id": { - "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." - }, - "grants": { - "items": { - "$ref": "#/components/schemas/BenefitGrantSubscriber" - }, - "type": "array", - "title": "Grants" + "description": "The ID of the grant." }, - "properties": { - "$ref": "#/components/schemas/BenefitCustomSubscriberProperties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", - "grants", - "properties" - ], - "title": "BenefitCustomSubscriber" - }, - "BenefitCustomSubscriberProperties": { - "properties": { - "note": { + "granted_at": { "anyOf": [ { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Private note to be shared with users who have this benefit granted." + "type": "string", + "format": "date-time" }, { "type": "null" } ], - "title": "Note" - } - }, - "type": "object", - "required": [ - "note" - ], - "title": "BenefitCustomSubscriberProperties", - "description": "Properties available to subscribers for a benefit of type `custom`." - }, - "BenefitCustomUpdate": { - "properties": { - "description": { + "title": "Granted At", + "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." + }, + "is_granted": { + "type": "boolean", + "title": "Is Granted", + "description": "Whether the benefit is granted." + }, + "revoked_at": { "anyOf": [ { "type": "string", - "maxLength": 42, - "minLength": 3 + "format": "date-time" }, { "type": "null" } ], - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "title": "Revoked At", + "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." }, - "type": { - "type": "string", - "enum": [ - "custom" - ], - "const": "custom", - "title": "Type" + "is_revoked": { + "type": "boolean", + "title": "Is Revoked", + "description": "Whether the benefit is revoked." }, - "properties": { + "subscription_id": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitCustomProperties" + "type": "string", + "format": "uuid4" }, { "type": "null" } - ] - } - }, - "type": "object", - "required": [ - "type" - ], - "title": "BenefitCustomUpdate" - }, - "BenefitDiscord": { - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." + ], + "title": "Subscription Id", + "description": "The ID of the subscription that granted this benefit." }, - "modified_at": { + "order_id": { "anyOf": [ { "type": "string", - "format": "date-time" + "format": "uuid4" }, { "type": "null" } ], - "title": "Modified At", - "description": "Last modification timestamp of the object." + "title": "Order Id", + "description": "The ID of the order that granted this benefit." }, - "id": { + "user_id": { "type": "string", "format": "uuid4", - "title": "Id", - "description": "The ID of the benefit." - }, - "type": { - "type": "string", - "enum": [ - "discord" - ], - "const": "discord", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." - }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." + "title": "User Id", + "description": "The ID of the user concerned by this grant." }, - "organization_id": { + "benefit_id": { "type": "string", "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." + "title": "Benefit Id", + "description": "The ID of the benefit concerned by this grant." }, "properties": { - "$ref": "#/components/schemas/BenefitDiscordProperties" + "$ref": "#/components/schemas/BenefitGrantAdsSubscriberProperties" } }, "type": "object", @@ -16578,112 +18435,126 @@ "created_at", "modified_at", "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", + "is_granted", + "is_revoked", + "subscription_id", + "order_id", + "user_id", + "benefit_id", "properties" ], - "title": "BenefitDiscord", - "description": "A benefit of type `discord`.\n\nUse it to automatically invite your backers to a Discord server." + "title": "BenefitGrantAds" }, - "BenefitDiscordCreate": { + "BenefitGrantAdsProperties": { "properties": { - "type": { - "type": "string", - "enum": [ - "discord" - ], - "const": "discord", - "title": "Type" - }, - "description": { + "advertisement_campaign_id": { "type": "string", - "maxLength": 42, - "minLength": 3, - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." - }, - "organization_id": { + "title": "Advertisement Campaign Id" + } + }, + "type": "object", + "required": [ + "advertisement_campaign_id" + ], + "title": "BenefitGrantAdsProperties" + }, + "BenefitGrantAdsSubscriberProperties": { + "properties": { + "advertisement_campaign_id": { "anyOf": [ { "type": "string", - "format": "uuid4", - "description": "The organization ID.", - "x-polar-selector-widget": { - "displayProperty": "name", - "resourceName": "Organization", - "resourceRoot": "/v1/organizations" - } + "format": "uuid4" }, { "type": "null" } ], - "title": "Organization Id", - "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" - }, - "properties": { - "$ref": "#/components/schemas/BenefitDiscordCreateProperties" + "title": "Advertisement Campaign Id", + "description": "The ID of the enabled advertisement campaign for this benefit grant." } }, "type": "object", - "required": [ - "type", - "description", - "properties" - ], - "title": "BenefitDiscordCreate" + "title": "BenefitGrantAdsSubscriberProperties" + }, + "BenefitGrantArticlesProperties": { + "properties": {}, + "type": "object", + "title": "BenefitGrantArticlesProperties" + }, + "BenefitGrantCustomProperties": { + "properties": {}, + "type": "object", + "title": "BenefitGrantCustomProperties" }, - "BenefitDiscordCreateProperties": { + "BenefitGrantDiscordProperties": { "properties": { - "guild_token": { + "guild_id": { "type": "string", - "title": "Guild Token" + "title": "Guild Id" }, "role_id": { "type": "string", - "title": "Role Id", - "description": "The ID of the Discord role to grant." + "title": "Role Id" + }, + "account_id": { + "type": "string", + "title": "Account Id" } }, "type": "object", - "required": [ - "guild_token", - "role_id" - ], - "title": "BenefitDiscordCreateProperties", - "description": "Properties to create a benefit of type `discord`." + "title": "BenefitGrantDiscordProperties" }, - "BenefitDiscordProperties": { + "BenefitGrantDownloadablesProperties": { "properties": { - "guild_id": { + "files": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Files" + } + }, + "type": "object", + "title": "BenefitGrantDownloadablesProperties" + }, + "BenefitGrantGitHubRepositoryProperties": { + "properties": { + "repository_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Repository Id" + }, + "repository_owner": { "type": "string", - "title": "Guild Id", - "description": "The ID of the Discord server." + "title": "Repository Owner" }, - "role_id": { + "repository_name": { "type": "string", - "title": "Role Id", - "description": "The ID of the Discord role to grant." + "title": "Repository Name" }, - "guild_token": { + "permission": { "type": "string", - "title": "Guild Token", - "readOnly": true + "enum": [ + "pull", + "triage", + "push", + "maintain", + "admin" + ], + "title": "Permission" } }, "type": "object", - "required": [ - "guild_id", - "role_id", - "guild_token" - ], - "title": "BenefitDiscordProperties", - "description": "Properties for a benefit of type `discord`." + "title": "BenefitGrantGitHubRepositoryProperties" }, - "BenefitDiscordSubscriber": { + "BenefitGrantLicenseKeys": { "properties": { "created_at": { "type": "string", @@ -16708,39 +18579,84 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the benefit." + "description": "The ID of the grant." }, - "type": { - "type": "string", - "enum": [ - "discord" + "granted_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } ], - "const": "discord", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." + "title": "Granted At", + "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." }, - "selectable": { + "is_granted": { "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." + "title": "Is Granted", + "description": "Whether the benefit is granted." }, - "deletable": { + "revoked_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Revoked At", + "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." + }, + "is_revoked": { "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." + "title": "Is Revoked", + "description": "Whether the benefit is revoked." }, - "organization_id": { + "subscription_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4" + }, + { + "type": "null" + } + ], + "title": "Subscription Id", + "description": "The ID of the subscription that granted this benefit." + }, + "order_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4" + }, + { + "type": "null" + } + ], + "title": "Order Id", + "description": "The ID of the order that granted this benefit." + }, + "user_id": { "type": "string", "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." + "title": "User Id", + "description": "The ID of the user concerned by this grant." + }, + "benefit_id": { + "type": "string", + "format": "uuid4", + "title": "Benefit Id", + "description": "The ID of the benefit concerned by this grant." }, "properties": { - "$ref": "#/components/schemas/BenefitDiscordSubscriberProperties" + "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" } }, "type": "object", @@ -16748,72 +18664,147 @@ "created_at", "modified_at", "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", + "is_granted", + "is_revoked", + "subscription_id", + "order_id", + "user_id", + "benefit_id", "properties" ], - "title": "BenefitDiscordSubscriber" + "title": "BenefitGrantLicenseKeys" }, - "BenefitDiscordSubscriberProperties": { + "BenefitGrantLicenseKeysProperties": { "properties": { - "guild_id": { + "license_key_id": { "type": "string", - "title": "Guild Id", - "description": "The ID of the Discord server." + "title": "License Key Id" + }, + "display_key": { + "type": "string", + "title": "Display Key" } }, "type": "object", - "required": [ - "guild_id" - ], - "title": "BenefitDiscordSubscriberProperties", - "description": "Properties available to subscribers for a benefit of type `discord`." + "title": "BenefitGrantLicenseKeysProperties" }, - "BenefitDiscordUpdate": { + "BenefitGrantSubscriber": { "properties": { - "description": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Modified At", + "description": "Last modification timestamp of the object." + }, + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the grant." + }, + "granted_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Granted At", + "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." + }, + "is_granted": { + "type": "boolean", + "title": "Is Granted", + "description": "Whether the benefit is granted." + }, + "revoked_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Revoked At", + "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." + }, + "is_revoked": { + "type": "boolean", + "title": "Is Revoked", + "description": "Whether the benefit is revoked." + }, + "subscription_id": { "anyOf": [ { "type": "string", - "maxLength": 42, - "minLength": 3 + "format": "uuid4" }, { "type": "null" } ], - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." - }, - "type": { - "type": "string", - "enum": [ - "discord" - ], - "const": "discord", - "title": "Type" + "title": "Subscription Id", + "description": "The ID of the subscription that granted this benefit." }, - "properties": { + "order_id": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitDiscordCreateProperties" + "type": "string", + "format": "uuid4" }, { "type": "null" } - ] + ], + "title": "Order Id", + "description": "The ID of the order that granted this benefit." + }, + "user_id": { + "type": "string", + "format": "uuid4", + "title": "User Id", + "description": "The ID of the user concerned by this grant." + }, + "benefit_id": { + "type": "string", + "format": "uuid4", + "title": "Benefit Id", + "description": "The ID of the benefit concerned by this grant." } }, "type": "object", "required": [ - "type" + "created_at", + "modified_at", + "id", + "is_granted", + "is_revoked", + "subscription_id", + "order_id", + "user_id", + "benefit_id" ], - "title": "BenefitDiscordUpdate" + "title": "BenefitGrantSubscriber" }, - "BenefitDownloadables": { + "BenefitGrantWebhook": { "properties": { "created_at": { "type": "string", @@ -16838,211 +18829,140 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the benefit." + "description": "The ID of the grant." }, - "type": { - "type": "string", - "enum": [ - "downloadables" + "granted_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } ], - "const": "downloadables", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." + "title": "Granted At", + "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." }, - "deletable": { + "is_granted": { "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." - }, - "organization_id": { - "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." + "title": "Is Granted", + "description": "Whether the benefit is granted." }, - "properties": { - "$ref": "#/components/schemas/BenefitDownloadablesProperties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", - "properties" - ], - "title": "BenefitDownloadables" - }, - "BenefitDownloadablesCreate": { - "properties": { - "type": { - "type": "string", - "enum": [ - "downloadables" + "revoked_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } ], - "const": "downloadables", - "title": "Type" + "title": "Revoked At", + "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." }, - "description": { - "type": "string", - "maxLength": 42, - "minLength": 3, - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "is_revoked": { + "type": "boolean", + "title": "Is Revoked", + "description": "Whether the benefit is revoked." }, - "organization_id": { + "subscription_id": { "anyOf": [ { "type": "string", - "format": "uuid4", - "description": "The organization ID.", - "x-polar-selector-widget": { - "displayProperty": "name", - "resourceName": "Organization", - "resourceRoot": "/v1/organizations" - } + "format": "uuid4" }, { "type": "null" } ], - "title": "Organization Id", - "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" + "title": "Subscription Id", + "description": "The ID of the subscription that granted this benefit." }, - "properties": { - "$ref": "#/components/schemas/BenefitDownloadablesCreateProperties" - } - }, - "type": "object", - "required": [ - "type", - "description", - "properties" - ], - "title": "BenefitDownloadablesCreate" - }, - "BenefitDownloadablesCreateProperties": { - "properties": { - "archived": { - "additionalProperties": { - "type": "boolean" - }, - "type": "object", - "title": "Archived", - "default": {} + "order_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4" + }, + { + "type": "null" + } + ], + "title": "Order Id", + "description": "The ID of the order that granted this benefit." }, - "files": { - "items": { - "type": "string", - "format": "uuid4" - }, - "type": "array", - "title": "Files" - } - }, - "type": "object", - "required": [ - "files" - ], - "title": "BenefitDownloadablesCreateProperties" - }, - "BenefitDownloadablesProperties": { - "properties": { - "archived": { - "additionalProperties": { - "type": "boolean" - }, - "type": "object", - "title": "Archived" + "user_id": { + "type": "string", + "format": "uuid4", + "title": "User Id", + "description": "The ID of the user concerned by this grant." }, - "files": { - "items": { - "type": "string", - "format": "uuid4" - }, - "type": "array", - "title": "Files" - } - }, - "type": "object", - "required": [ - "archived", - "files" - ], - "title": "BenefitDownloadablesProperties" - }, - "BenefitDownloadablesSubscriber": { - "properties": { - "created_at": { + "benefit_id": { "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." + "format": "uuid4", + "title": "Benefit Id", + "description": "The ID of the benefit concerned by this grant." }, - "modified_at": { + "properties": { "anyOf": [ { - "type": "string", - "format": "date-time" + "$ref": "#/components/schemas/BenefitGrantDiscordProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantGitHubRepositoryProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantDownloadablesProperties" }, { - "type": "null" + "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantAdsProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantCustomProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantArticlesProperties" } ], - "title": "Modified At", - "description": "Last modification timestamp of the object." + "title": "Properties" }, - "id": { - "type": "string", - "format": "uuid4", - "title": "Id", - "description": "The ID of the benefit." + "benefit": { + "$ref": "#/components/schemas/Benefit", + "title": "Benefit" }, - "type": { - "type": "string", - "enum": [ - "downloadables" + "previous_properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitGrantDiscordProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantGitHubRepositoryProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantDownloadablesProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantAdsProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantCustomProperties" + }, + { + "$ref": "#/components/schemas/BenefitGrantArticlesProperties" + }, + { + "type": "null" + } ], - "const": "downloadables", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." - }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." - }, - "organization_id": { - "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." - }, - "properties": { - "$ref": "#/components/schemas/BenefitDownloadablesSubscriberProperties" + "title": "Previous Properties" } }, "type": "object", @@ -17050,74 +18970,62 @@ "created_at", "modified_at", "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", - "properties" + "is_granted", + "is_revoked", + "subscription_id", + "order_id", + "user_id", + "benefit_id", + "properties", + "benefit" ], - "title": "BenefitDownloadablesSubscriber" + "title": "BenefitGrantWebhook" }, - "BenefitDownloadablesSubscriberProperties": { + "BenefitLicenseKeyActivationProperties": { "properties": { - "active_files": { - "items": { - "type": "string", - "format": "uuid4" - }, - "type": "array", - "title": "Active Files" + "limit": { + "type": "integer", + "maximum": 50, + "exclusiveMinimum": 0, + "title": "Limit" + }, + "enable_user_admin": { + "type": "boolean", + "title": "Enable User Admin" } }, "type": "object", "required": [ - "active_files" + "limit", + "enable_user_admin" ], - "title": "BenefitDownloadablesSubscriberProperties" + "title": "BenefitLicenseKeyActivationProperties" }, - "BenefitDownloadablesUpdate": { + "BenefitLicenseKeyExpirationProperties": { "properties": { - "description": { - "anyOf": [ - { - "type": "string", - "maxLength": 42, - "minLength": 3 - }, - { - "type": "null" - } - ], - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "ttl": { + "type": "integer", + "exclusiveMinimum": 0, + "title": "Ttl" }, - "type": { + "timeframe": { "type": "string", "enum": [ - "downloadables" + "year", + "month", + "day" ], - "const": "downloadables", - "title": "Type" - }, - "properties": { - "anyOf": [ - { - "$ref": "#/components/schemas/BenefitDownloadablesCreateProperties" - }, - { - "type": "null" - } - ] + "title": "Timeframe" } }, "type": "object", "required": [ - "type" + "ttl", + "timeframe" ], - "title": "BenefitDownloadablesUpdate" + "title": "BenefitLicenseKeyExpirationProperties" }, - "BenefitGitHubRepository": { + "BenefitLicenseKeys": { "properties": { "created_at": { "type": "string", @@ -17147,9 +19055,9 @@ "type": { "type": "string", "enum": [ - "github_repository" + "license_keys" ], - "const": "github_repository", + "const": "license_keys", "title": "Type" }, "description": { @@ -17174,7 +19082,7 @@ "description": "The ID of the organization owning the benefit." }, "properties": { - "$ref": "#/components/schemas/BenefitGitHubRepositoryProperties" + "$ref": "#/components/schemas/BenefitLicenseKeysProperties" } }, "type": "object", @@ -17189,17 +19097,16 @@ "organization_id", "properties" ], - "title": "BenefitGitHubRepository", - "description": "A benefit of type `github_repository`.\n\nUse it to automatically invite your backers to a private GitHub repository." + "title": "BenefitLicenseKeys" }, - "BenefitGitHubRepositoryCreate": { + "BenefitLicenseKeysCreate": { "properties": { "type": { "type": "string", "enum": [ - "github_repository" + "license_keys" ], - "const": "github_repository", + "const": "license_keys", "title": "Type" }, "description": { @@ -17229,7 +19136,7 @@ "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" }, "properties": { - "$ref": "#/components/schemas/BenefitGitHubRepositoryCreateProperties" + "$ref": "#/components/schemas/BenefitLicenseKeysCreateProperties" } }, "type": "object", @@ -17238,126 +19145,112 @@ "description", "properties" ], - "title": "BenefitGitHubRepositoryCreate" + "title": "BenefitLicenseKeysCreate" }, - "BenefitGitHubRepositoryCreateProperties": { + "BenefitLicenseKeysCreateProperties": { "properties": { - "repository_id": { + "prefix": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "type": "string" }, { "type": "null" } ], - "title": "Repository Id" + "title": "Prefix" }, - "repository_owner": { + "expires": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BenefitLicenseKeyExpirationProperties" }, { "type": "null" } - ], - "title": "Repository Owner", - "description": "The owner of the repository.", - "examples": [ - "polarsource" ] }, - "repository_name": { + "activations": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BenefitLicenseKeyActivationProperties" }, { "type": "null" } - ], - "title": "Repository Name", - "description": "The name of the repository.", - "examples": [ - "private_repo" ] }, - "permission": { - "type": "string", - "enum": [ - "pull", - "triage", - "push", - "maintain", - "admin" + "limit_usage": { + "anyOf": [ + { + "type": "integer", + "exclusiveMinimum": 0 + }, + { + "type": "null" + } ], - "title": "Permission", - "description": "The permission level to grant. Read more about roles and their permissions on [GitHub documentation](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role)." + "title": "Limit Usage" } }, "type": "object", - "required": [ - "permission" - ], - "title": "BenefitGitHubRepositoryCreateProperties", - "description": "Properties to create a benefit of type `github_repository`." + "title": "BenefitLicenseKeysCreateProperties" }, - "BenefitGitHubRepositoryProperties": { + "BenefitLicenseKeysProperties": { "properties": { - "repository_id": { + "prefix": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Prefix" + }, + "expires": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitLicenseKeyExpirationProperties" }, { "type": "null" } - ], - "title": "Repository Id" - }, - "repository_owner": { - "type": "string", - "title": "Repository Owner", - "description": "The owner of the repository.", - "examples": [ - "polarsource" ] }, - "repository_name": { - "type": "string", - "title": "Repository Name", - "description": "The name of the repository.", - "examples": [ - "private_repo" + "activations": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitLicenseKeyActivationProperties" + }, + { + "type": "null" + } ] }, - "permission": { - "type": "string", - "enum": [ - "pull", - "triage", - "push", - "maintain", - "admin" + "limit_usage": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } ], - "title": "Permission", - "description": "The permission level to grant. Read more about roles and their permissions on [GitHub documentation](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role)." + "title": "Limit Usage" } }, "type": "object", "required": [ - "repository_id", - "repository_owner", - "repository_name", - "permission" + "prefix", + "expires", + "activations", + "limit_usage" ], - "title": "BenefitGitHubRepositoryProperties", - "description": "Properties for a benefit of type `github_repository`." + "title": "BenefitLicenseKeysProperties" }, - "BenefitGitHubRepositorySubscriber": { + "BenefitLicenseKeysSubscriber": { "properties": { "created_at": { "type": "string", @@ -17387,9 +19280,9 @@ "type": { "type": "string", "enum": [ - "github_repository" + "license_keys" ], - "const": "github_repository", + "const": "license_keys", "title": "Type" }, "description": { @@ -17413,8 +19306,18 @@ "title": "Organization Id", "description": "The ID of the organization owning the benefit." }, + "grants": { + "items": { + "$ref": "#/components/schemas/BenefitGrantLicenseKeys" + }, + "type": "array", + "title": "Grants" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, "properties": { - "$ref": "#/components/schemas/BenefitGitHubRepositorySubscriberProperties" + "$ref": "#/components/schemas/BenefitLicenseKeysSubscriberProperties" } }, "type": "object", @@ -17427,79 +19330,249 @@ "selectable", "deletable", "organization_id", + "grants", + "organization", "properties" ], - "title": "BenefitGitHubRepositorySubscriber" + "title": "BenefitLicenseKeysSubscriber" }, - "BenefitGitHubRepositorySubscriberProperties": { + "BenefitLicenseKeysSubscriberProperties": { "properties": { - "repository_owner": { - "type": "string", - "title": "Repository Owner", - "description": "The owner of the repository.", - "examples": [ - "polarsource" + "prefix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Prefix" + }, + "expires": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitLicenseKeyExpirationProperties" + }, + { + "type": "null" + } ] }, - "repository_name": { - "type": "string", - "title": "Repository Name", - "description": "The name of the repository.", - "examples": [ - "private_repo" + "activations": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitLicenseKeyActivationProperties" + }, + { + "type": "null" + } ] + }, + "limit_usage": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Limit Usage" } }, "type": "object", "required": [ - "repository_owner", - "repository_name" + "prefix", + "expires", + "activations", + "limit_usage" ], - "title": "BenefitGitHubRepositorySubscriberProperties", - "description": "Properties available to subscribers for a benefit of type `github_repository`." + "title": "BenefitLicenseKeysSubscriberProperties" }, - "BenefitGitHubRepositoryUpdate": { + "BenefitLicenseKeysUpdate": { "properties": { "description": { "anyOf": [ { "type": "string", - "maxLength": 42, - "minLength": 3 + "maxLength": 42, + "minLength": 3 + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "The description of the benefit. Will be displayed on products having this benefit." + }, + "type": { + "type": "string", + "enum": [ + "license_keys" + ], + "const": "license_keys", + "title": "Type" + }, + "properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitLicenseKeysCreateProperties" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "type" + ], + "title": "BenefitLicenseKeysUpdate" + }, + "BenefitType": { + "type": "string", + "enum": [ + "custom", + "articles", + "ads", + "discord", + "github_repository", + "downloadables", + "license_keys" + ], + "title": "BenefitType" + }, + "BylineProfile": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "avatar_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Avatar Url" + } + }, + "type": "object", + "required": [ + "name", + "avatar_url" + ], + "title": "BylineProfile" + }, + "CheckoutConfirmStripe": { + "properties": { + "custom_field_data": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." + }, + "product_price_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid4" + }, + { + "type": "null" + } + ], + "title": "Product Price Id", + "description": "ID of the product price to checkout. Must correspond to a price linked to the same product." + }, + "amount": { + "anyOf": [ + { + "type": "integer", + "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." + }, + { + "type": "null" + } + ], + "title": "Amount" + }, + "customer_name": { + "anyOf": [ + { + "type": "string", + "description": "Name of the customer." + }, + { + "type": "null" + } + ], + "title": "Customer Name" + }, + "customer_email": { + "anyOf": [ + { + "type": "string", + "format": "email", + "description": "Email address of the customer." }, { "type": "null" } ], - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "title": "Customer Email" }, - "type": { - "type": "string", - "enum": [ - "github_repository" + "customer_billing_address": { + "anyOf": [ + { + "$ref": "#/components/schemas/Address", + "description": "Billing address of the customer." + }, + { + "type": "null" + } + ] + }, + "customer_tax_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "const": "github_repository", - "title": "Type" + "title": "Customer Tax Id" }, - "properties": { + "confirmation_token_id": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitGitHubRepositoryCreateProperties" + "type": "string" }, { "type": "null" } - ] + ], + "title": "Confirmation Token Id", + "description": "ID of the Stripe confirmation token. Required for fixed prices and custom prices." } }, "type": "object", - "required": [ - "type" - ], - "title": "BenefitGitHubRepositoryUpdate" + "title": "CheckoutConfirmStripe", + "description": "Confirm a checkout session using a Stripe confirmation token." }, - "BenefitGrant": { + "CheckoutLink": { "properties": { "created_at": { "type": "string", @@ -17524,125 +19597,168 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the grant." + "description": "The ID of the object." }, - "granted_at": { + "metadata": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Metadata" + }, + "payment_processor": { + "$ref": "#/components/schemas/polar__enums__PaymentProcessor", + "description": "Payment processor used." + }, + "client_secret": { + "type": "string", + "title": "Client Secret", + "description": "Client secret used to access the checkout link." + }, + "success_url": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "string" }, { "type": "null" } ], - "title": "Granted At", - "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." + "title": "Success Url", + "description": "URL where the customer will be redirected after a successful payment." }, - "is_granted": { - "type": "boolean", - "title": "Is Granted", - "description": "Whether the benefit is granted." + "product_price_id": { + "type": "string", + "format": "uuid4", + "title": "Product Price Id", + "description": "ID of the product price to checkout." }, - "revoked_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } + "product_price": { + "$ref": "#/components/schemas/ProductPrice" + }, + "url": { + "type": "string", + "title": "Url", + "readOnly": true + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "metadata", + "payment_processor", + "client_secret", + "success_url", + "product_price_id", + "product_price", + "url" + ], + "title": "CheckoutLink", + "description": "Checkout link data." + }, + "CheckoutLinkCreate": { + "properties": { + "metadata": { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50, + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." + }, + "payment_processor": { + "type": "string", + "enum": [ + "stripe" ], - "title": "Revoked At", - "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." + "const": "stripe", + "title": "Payment Processor", + "description": "Payment processor to use. Currently only Stripe is supported." }, - "is_revoked": { - "type": "boolean", - "title": "Is Revoked", - "description": "Whether the benefit is revoked." + "product_price_id": { + "type": "string", + "format": "uuid4", + "title": "Product Price Id", + "description": "ID of the product price to checkout." }, - "subscription_id": { + "success_url": { "anyOf": [ { "type": "string", - "format": "uuid4" + "maxLength": 2083, + "minLength": 1, + "format": "uri" }, { "type": "null" } ], - "title": "Subscription Id", - "description": "The ID of the subscription that granted this benefit." - }, - "order_id": { + "title": "Success Url", + "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." + } + }, + "type": "object", + "required": [ + "payment_processor", + "product_price_id" + ], + "title": "CheckoutLinkCreate", + "description": "Schema to create a new checkout link." + }, + "CheckoutLinkSortProperty": { + "type": "string", + "enum": [ + "created_at", + "-created_at" + ], + "title": "CheckoutLinkSortProperty" + }, + "CheckoutLinkUpdate": { + "properties": { + "metadata": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50 }, { "type": "null" } ], - "title": "Order Id", - "description": "The ID of the order that granted this benefit." - }, - "user_id": { - "type": "string", - "format": "uuid4", - "title": "User Id", - "description": "The ID of the user concerned by this grant." - }, - "benefit_id": { - "type": "string", - "format": "uuid4", - "title": "Benefit Id", - "description": "The ID of the benefit concerned by this grant." + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "properties": { + "success_url": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitGrantDiscordProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantGitHubRepositoryProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantDownloadablesProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantAdsProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantCustomProperties" + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" }, { - "$ref": "#/components/schemas/BenefitGrantArticlesProperties" + "type": "null" } - ], - "title": "Properties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "is_granted", - "is_revoked", - "subscription_id", - "order_id", - "user_id", - "benefit_id", - "properties" - ], - "title": "BenefitGrant" + ], + "title": "Success Url", + "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." + } + }, + "type": "object", + "title": "CheckoutLinkUpdate", + "description": "Schema to update an existing checkout link." }, - "BenefitGrantAds": { + "CheckoutProduct": { "properties": { "created_at": { "type": "string", @@ -17667,84 +19783,71 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the grant." - }, - "granted_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "title": "Granted At", - "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." + "description": "The ID of the product." }, - "is_granted": { - "type": "boolean", - "title": "Is Granted", - "description": "Whether the benefit is granted." + "name": { + "type": "string", + "title": "Name", + "description": "The name of the product." }, - "revoked_at": { + "description": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "string" }, { "type": "null" } ], - "title": "Revoked At", - "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." + "title": "Description", + "description": "The description of the product." }, - "is_revoked": { + "is_recurring": { "type": "boolean", - "title": "Is Revoked", - "description": "Whether the benefit is revoked." - }, - "subscription_id": { - "anyOf": [ - { - "type": "string", - "format": "uuid4" - }, - { - "type": "null" - } - ], - "title": "Subscription Id", - "description": "The ID of the subscription that granted this benefit." + "title": "Is Recurring", + "description": "Whether the product is a subscription tier." }, - "order_id": { - "anyOf": [ - { - "type": "string", - "format": "uuid4" - }, - { - "type": "null" - } - ], - "title": "Order Id", - "description": "The ID of the order that granted this benefit." + "is_archived": { + "type": "boolean", + "title": "Is Archived", + "description": "Whether the product is archived and no longer available." }, - "user_id": { + "organization_id": { "type": "string", "format": "uuid4", - "title": "User Id", - "description": "The ID of the user concerned by this grant." + "title": "Organization Id", + "description": "The ID of the organization owning the product." }, - "benefit_id": { - "type": "string", - "format": "uuid4", - "title": "Benefit Id", - "description": "The ID of the benefit concerned by this grant." + "prices": { + "items": { + "$ref": "#/components/schemas/ProductPrice" + }, + "type": "array", + "title": "Prices", + "description": "List of prices for this product." }, - "properties": { - "$ref": "#/components/schemas/BenefitGrantAdsSubscriberProperties" + "benefits": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitBase" + }, + { + "$ref": "#/components/schemas/BenefitArticles" + } + ] + }, + "type": "array", + "title": "BenefitPublic", + "description": "List of benefits granted by the product." + }, + "medias": { + "items": { + "$ref": "#/components/schemas/ProductMediaFileRead" + }, + "type": "array", + "title": "Medias", + "description": "List of medias associated to the product." } }, "type": "object", @@ -17752,359 +19855,247 @@ "created_at", "modified_at", "id", - "is_granted", - "is_revoked", - "subscription_id", - "order_id", - "user_id", - "benefit_id", - "properties" + "name", + "description", + "is_recurring", + "is_archived", + "organization_id", + "prices", + "benefits", + "medias" ], - "title": "BenefitGrantAds" + "title": "CheckoutProduct", + "description": "Product data for a checkout session." }, - "BenefitGrantAdsProperties": { + "CheckoutPublic": { "properties": { - "advertisement_campaign_id": { + "created_at": { "type": "string", - "title": "Advertisement Campaign Id" - } - }, - "type": "object", - "required": [ - "advertisement_campaign_id" - ], - "title": "BenefitGrantAdsProperties" - }, - "BenefitGrantAdsSubscriberProperties": { - "properties": { - "advertisement_campaign_id": { + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { "anyOf": [ { "type": "string", - "format": "uuid4" + "format": "date-time" }, { "type": "null" } ], - "title": "Advertisement Campaign Id", - "description": "The ID of the enabled advertisement campaign for this benefit grant." - } - }, - "type": "object", - "title": "BenefitGrantAdsSubscriberProperties" - }, - "BenefitGrantArticlesProperties": { - "properties": {}, - "type": "object", - "title": "BenefitGrantArticlesProperties" - }, - "BenefitGrantCustomProperties": { - "properties": {}, - "type": "object", - "title": "BenefitGrantCustomProperties" - }, - "BenefitGrantDiscordProperties": { - "properties": { - "guild_id": { - "type": "string", - "title": "Guild Id" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "role_id": { + "id": { "type": "string", - "title": "Role Id" + "format": "uuid4", + "title": "Id", + "description": "The ID of the object." }, - "account_id": { - "type": "string", - "title": "Account Id" - } - }, - "type": "object", - "title": "BenefitGrantDiscordProperties" - }, - "BenefitGrantDownloadablesProperties": { - "properties": { - "files": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Files" - } - }, - "type": "object", - "title": "BenefitGrantDownloadablesProperties" - }, - "BenefitGrantGitHubRepositoryProperties": { - "properties": { - "repository_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Repository Id" + "custom_field_data": { + "type": "object", + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." }, - "repository_owner": { + "payment_processor": { + "$ref": "#/components/schemas/polar__enums__PaymentProcessor", + "description": "Payment processor used." + }, + "status": { + "$ref": "#/components/schemas/CheckoutStatus", + "description": "Status of the checkout session." + }, + "client_secret": { "type": "string", - "title": "Repository Owner" + "title": "Client Secret", + "description": "Client secret used to update and complete the checkout session from the client." }, - "repository_name": { + "url": { "type": "string", - "title": "Repository Name" + "title": "Url", + "description": "URL where the customer can access the checkout session." }, - "permission": { + "expires_at": { "type": "string", - "enum": [ - "pull", - "triage", - "push", - "maintain", - "admin" - ], - "title": "Permission" - } - }, - "type": "object", - "title": "BenefitGrantGitHubRepositoryProperties" - }, - "BenefitGrantLicenseKeys": { - "properties": { - "created_at": { + "format": "date-time", + "title": "Expires At", + "description": "Expiration date and time of the checkout session." + }, + "success_url": { "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." + "title": "Success Url", + "description": "URL where the customer will be redirected after a successful payment." }, - "modified_at": { + "embed_origin": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "string" }, { "type": "null" } ], - "title": "Modified At", - "description": "Last modification timestamp of the object." - }, - "id": { - "type": "string", - "format": "uuid4", - "title": "Id", - "description": "The ID of the grant." + "title": "Embed Origin", + "description": "When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page." }, - "granted_at": { + "amount": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "integer", + "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." }, { "type": "null" } ], - "title": "Granted At", - "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." - }, - "is_granted": { - "type": "boolean", - "title": "Is Granted", - "description": "Whether the benefit is granted." + "title": "Amount" }, - "revoked_at": { + "tax_amount": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "integer" }, { "type": "null" } ], - "title": "Revoked At", - "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." - }, - "is_revoked": { - "type": "boolean", - "title": "Is Revoked", - "description": "Whether the benefit is revoked." + "title": "Tax Amount", + "description": "Computed tax amount to pay in cents." }, - "subscription_id": { + "currency": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "type": "string" }, { "type": "null" } ], - "title": "Subscription Id", - "description": "The ID of the subscription that granted this benefit." + "title": "Currency", + "description": "Currency code of the checkout session." }, - "order_id": { + "total_amount": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "type": "integer" }, { "type": "null" } ], - "title": "Order Id", - "description": "The ID of the order that granted this benefit." + "title": "Total Amount", + "description": "Total amount to pay in cents." }, - "user_id": { + "product_id": { "type": "string", "format": "uuid4", - "title": "User Id", - "description": "The ID of the user concerned by this grant." + "title": "Product Id", + "description": "ID of the product to checkout." }, - "benefit_id": { + "product_price_id": { "type": "string", "format": "uuid4", - "title": "Benefit Id", - "description": "The ID of the benefit concerned by this grant." - }, - "properties": { - "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "is_granted", - "is_revoked", - "subscription_id", - "order_id", - "user_id", - "benefit_id", - "properties" - ], - "title": "BenefitGrantLicenseKeys" - }, - "BenefitGrantLicenseKeysProperties": { - "properties": { - "license_key_id": { - "type": "string", - "title": "License Key Id" + "title": "Product Price Id", + "description": "ID of the product price to checkout." }, - "display_key": { - "type": "string", - "title": "Display Key" - } - }, - "type": "object", - "title": "BenefitGrantLicenseKeysProperties" - }, - "BenefitGrantSubscriber": { - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." + "is_payment_required": { + "type": "boolean", + "title": "Is Payment Required", + "description": "Whether the checkout requires payment. Useful to detect free products." }, - "modified_at": { + "customer_id": { "anyOf": [ { "type": "string", - "format": "date-time" + "format": "uuid4" }, { "type": "null" } ], - "title": "Modified At", - "description": "Last modification timestamp of the object." - }, - "id": { - "type": "string", - "format": "uuid4", - "title": "Id", - "description": "The ID of the grant." + "title": "Customer Id" }, - "granted_at": { + "customer_name": { "anyOf": [ { "type": "string", - "format": "date-time" + "description": "Name of the customer." }, { "type": "null" } ], - "title": "Granted At", - "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." - }, - "is_granted": { - "type": "boolean", - "title": "Is Granted", - "description": "Whether the benefit is granted." + "title": "Customer Name" }, - "revoked_at": { + "customer_email": { "anyOf": [ { "type": "string", - "format": "date-time" + "format": "email", + "description": "Email address of the customer." }, { "type": "null" } ], - "title": "Revoked At", - "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." - }, - "is_revoked": { - "type": "boolean", - "title": "Is Revoked", - "description": "Whether the benefit is revoked." + "title": "Customer Email" }, - "subscription_id": { + "customer_ip_address": { "anyOf": [ { "type": "string", - "format": "uuid4" + "format": "ipvanyaddress", + "description": "IP address of the customer. Used to detect tax location." }, { "type": "null" } ], - "title": "Subscription Id", - "description": "The ID of the subscription that granted this benefit." + "title": "Customer Ip Address" }, - "order_id": { + "customer_billing_address": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "$ref": "#/components/schemas/Address", + "description": "Billing address of the customer." + }, + { + "type": "null" + } + ] + }, + "customer_tax_id": { + "anyOf": [ + { + "type": "string" }, { "type": "null" } ], - "title": "Order Id", - "description": "The ID of the order that granted this benefit." + "title": "Customer Tax Id" }, - "user_id": { - "type": "string", - "format": "uuid4", - "title": "User Id", - "description": "The ID of the user concerned by this grant." + "payment_processor_metadata": { + "type": "object", + "title": "Payment Processor Metadata" }, - "benefit_id": { - "type": "string", - "format": "uuid4", - "title": "Benefit Id", - "description": "The ID of the benefit concerned by this grant." + "product": { + "$ref": "#/components/schemas/CheckoutProduct" + }, + "product_price": { + "$ref": "#/components/schemas/ProductPrice" + }, + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "attached_custom_fields": { + "items": { + "$ref": "#/components/schemas/AttachedCustomField" + }, + "type": "array", + "title": "Attached Custom Fields" } }, "type": "object", @@ -18112,462 +20103,398 @@ "created_at", "modified_at", "id", - "is_granted", - "is_revoked", - "subscription_id", - "order_id", - "user_id", - "benefit_id" + "payment_processor", + "status", + "client_secret", + "url", + "expires_at", + "success_url", + "embed_origin", + "amount", + "tax_amount", + "currency", + "total_amount", + "product_id", + "product_price_id", + "is_payment_required", + "customer_id", + "customer_name", + "customer_email", + "customer_ip_address", + "customer_billing_address", + "customer_tax_id", + "payment_processor_metadata", + "product", + "product_price", + "organization", + "attached_custom_fields" + ], + "title": "CheckoutPublic", + "description": "Checkout session data retrieved using the client secret." + }, + "CheckoutSortProperty": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "expires_at", + "-expires_at" + ], + "title": "CheckoutSortProperty" + }, + "CheckoutStatus": { + "type": "string", + "enum": [ + "open", + "expired", + "confirmed", + "succeeded", + "failed" ], - "title": "BenefitGrantSubscriber" + "title": "CheckoutStatus" }, - "BenefitGrantWebhook": { + "CheckoutUpdate": { "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." - }, - "modified_at": { + "custom_field_data": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "object" }, { "type": "null" } ], - "title": "Modified At", - "description": "Last modification timestamp of the object." - }, - "id": { - "type": "string", - "format": "uuid4", - "title": "Id", - "description": "The ID of the grant." + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." }, - "granted_at": { + "product_price_id": { "anyOf": [ { "type": "string", - "format": "date-time" + "format": "uuid4" }, { "type": "null" } ], - "title": "Granted At", - "description": "The timestamp when the benefit was granted. If `None`, the benefit is not granted." - }, - "is_granted": { - "type": "boolean", - "title": "Is Granted", - "description": "Whether the benefit is granted." + "title": "Product Price Id", + "description": "ID of the product price to checkout. Must correspond to a price linked to the same product." }, - "revoked_at": { + "amount": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "integer", + "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." }, { "type": "null" } ], - "title": "Revoked At", - "description": "The timestamp when the benefit was revoked. If `None`, the benefit is not revoked." - }, - "is_revoked": { - "type": "boolean", - "title": "Is Revoked", - "description": "Whether the benefit is revoked." + "title": "Amount" }, - "subscription_id": { + "customer_name": { "anyOf": [ { "type": "string", - "format": "uuid4" + "description": "Name of the customer." }, { "type": "null" } ], - "title": "Subscription Id", - "description": "The ID of the subscription that granted this benefit." + "title": "Customer Name" }, - "order_id": { + "customer_email": { "anyOf": [ { "type": "string", - "format": "uuid4" + "format": "email", + "description": "Email address of the customer." }, { "type": "null" } ], - "title": "Order Id", - "description": "The ID of the order that granted this benefit." - }, - "user_id": { - "type": "string", - "format": "uuid4", - "title": "User Id", - "description": "The ID of the user concerned by this grant." - }, - "benefit_id": { - "type": "string", - "format": "uuid4", - "title": "Benefit Id", - "description": "The ID of the benefit concerned by this grant." - }, - "properties": { - "anyOf": [ - { - "$ref": "#/components/schemas/BenefitGrantDiscordProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantGitHubRepositoryProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantDownloadablesProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantAdsProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantCustomProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantArticlesProperties" - } - ], - "title": "Properties" - }, - "benefit": { - "$ref": "#/components/schemas/Benefit", - "title": "Benefit" + "title": "Customer Email" }, - "previous_properties": { + "customer_billing_address": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitGrantDiscordProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantGitHubRepositoryProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantDownloadablesProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantLicenseKeysProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantAdsProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantCustomProperties" - }, - { - "$ref": "#/components/schemas/BenefitGrantArticlesProperties" + "$ref": "#/components/schemas/Address", + "description": "Billing address of the customer." }, { "type": "null" } - ], - "title": "Previous Properties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "is_granted", - "is_revoked", - "subscription_id", - "order_id", - "user_id", - "benefit_id", - "properties", - "benefit" - ], - "title": "BenefitGrantWebhook" - }, - "BenefitLicenseKeyActivationProperties": { - "properties": { - "limit": { - "type": "integer", - "maximum": 50, - "exclusiveMinimum": 0, - "title": "Limit" - }, - "enable_user_admin": { - "type": "boolean", - "title": "Enable User Admin" - } - }, - "type": "object", - "required": [ - "limit", - "enable_user_admin" - ], - "title": "BenefitLicenseKeyActivationProperties" - }, - "BenefitLicenseKeyExpirationProperties": { - "properties": { - "ttl": { - "type": "integer", - "exclusiveMinimum": 0, - "title": "Ttl" - }, - "timeframe": { - "type": "string", - "enum": [ - "year", - "month", - "day" - ], - "title": "Timeframe" - } - }, - "type": "object", - "required": [ - "ttl", - "timeframe" - ], - "title": "BenefitLicenseKeyExpirationProperties" - }, - "BenefitLicenseKeys": { - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "title": "Created At", - "description": "Creation timestamp of the object." + ] }, - "modified_at": { + "customer_tax_id": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "string" }, - { - "type": "null" - } - ], - "title": "Modified At", - "description": "Last modification timestamp of the object." - }, - "id": { - "type": "string", - "format": "uuid4", - "title": "Id", - "description": "The ID of the benefit." - }, - "type": { - "type": "string", - "enum": [ - "license_keys" - ], - "const": "license_keys", - "title": "Type" - }, - "description": { - "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." - }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." - }, - "organization_id": { - "type": "string", - "format": "uuid4", - "title": "Organization Id", - "description": "The ID of the organization owning the benefit." + { + "type": "null" + } + ], + "title": "Customer Tax Id" }, - "properties": { - "$ref": "#/components/schemas/BenefitLicenseKeysProperties" - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "type", - "description", - "selectable", - "deletable", - "organization_id", - "properties" - ], - "title": "BenefitLicenseKeys" - }, - "BenefitLicenseKeysCreate": { - "properties": { - "type": { - "type": "string", - "enum": [ - "license_keys" + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50 + }, + { + "type": "null" + } ], - "const": "license_keys", - "title": "Type" + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "description": { - "type": "string", - "maxLength": 42, - "minLength": 3, - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "customer_ip_address": { + "anyOf": [ + { + "type": "string", + "format": "ipvanyaddress", + "description": "IP address of the customer. Used to detect tax location." + }, + { + "type": "null" + } + ], + "title": "Customer Ip Address" }, - "organization_id": { + "success_url": { "anyOf": [ { "type": "string", - "format": "uuid4", - "description": "The organization ID.", - "x-polar-selector-widget": { - "displayProperty": "name", - "resourceName": "Organization", - "resourceRoot": "/v1/organizations" - } + "maxLength": 2083, + "minLength": 1, + "format": "uri" }, { "type": "null" } ], - "title": "Organization Id", - "description": "The ID of the organization owning the benefit. **Required unless you use an organization token.**" + "title": "Success Url", + "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." }, - "properties": { - "$ref": "#/components/schemas/BenefitLicenseKeysCreateProperties" + "embed_origin": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Embed Origin", + "description": "If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Polar iframe to communicate with the parent page." } }, "type": "object", - "required": [ - "type", - "description", - "properties" - ], - "title": "BenefitLicenseKeysCreate" + "title": "CheckoutUpdate", + "description": "Update an existing checkout session using an access token." }, - "BenefitLicenseKeysCreateProperties": { + "CheckoutUpdatePublic": { "properties": { - "prefix": { + "custom_field_data": { "anyOf": [ { - "type": "string" + "type": "object" }, { "type": "null" } ], - "title": "Prefix" + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." }, - "expires": { + "product_price_id": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitLicenseKeyExpirationProperties" + "type": "string", + "format": "uuid4" }, { "type": "null" } - ] + ], + "title": "Product Price Id", + "description": "ID of the product price to checkout. Must correspond to a price linked to the same product." }, - "activations": { + "amount": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitLicenseKeyActivationProperties" + "type": "integer", + "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." }, { "type": "null" } - ] + ], + "title": "Amount" }, - "limit_usage": { + "customer_name": { "anyOf": [ { - "type": "integer", - "exclusiveMinimum": 0 + "type": "string", + "description": "Name of the customer." }, { "type": "null" } ], - "title": "Limit Usage" - } - }, - "type": "object", - "title": "BenefitLicenseKeysCreateProperties" - }, - "BenefitLicenseKeysProperties": { - "properties": { - "prefix": { + "title": "Customer Name" + }, + "customer_email": { "anyOf": [ { - "type": "string" + "type": "string", + "format": "email", + "description": "Email address of the customer." }, { "type": "null" } ], - "title": "Prefix" + "title": "Customer Email" }, - "expires": { + "customer_billing_address": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitLicenseKeyExpirationProperties" + "$ref": "#/components/schemas/Address", + "description": "Billing address of the customer." }, { "type": "null" } ] }, - "activations": { + "customer_tax_id": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitLicenseKeyActivationProperties" + "type": "string" }, { "type": "null" } - ] + ], + "title": "Customer Tax Id" + } + }, + "type": "object", + "title": "CheckoutUpdatePublic", + "description": "Update an existing checkout session using the client secret." + }, + "ConfirmIssue": { + "properties": { + "splits": { + "items": { + "$ref": "#/components/schemas/ConfirmIssueSplit" + }, + "type": "array", + "title": "Splits" + } + }, + "type": "object", + "required": [ + "splits" + ], + "title": "ConfirmIssue" + }, + "ConfirmIssueSplit": { + "properties": { + "organization_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "title": "Organization Id" }, - "limit_usage": { + "github_username": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Limit Usage" + "title": "Github Username" + }, + "share_thousands": { + "type": "integer", + "title": "Share Thousands" } }, "type": "object", "required": [ - "prefix", - "expires", - "activations", - "limit_usage" + "share_thousands" ], - "title": "BenefitLicenseKeysProperties" + "title": "ConfirmIssueSplit" }, - "BenefitLicenseKeysSubscriber": { + "CurrencyAmount": { + "properties": { + "currency": { + "type": "string", + "title": "Currency", + "description": "Three letter currency code (eg: USD)" + }, + "amount": { + "type": "integer", + "title": "Amount", + "description": "Amount in the currencies smallest unit (cents if currency is USD)" + } + }, + "type": "object", + "required": [ + "currency", + "amount" + ], + "title": "CurrencyAmount" + }, + "CustomField": { + "oneOf": [ + { + "$ref": "#/components/schemas/CustomFieldText" + }, + { + "$ref": "#/components/schemas/CustomFieldNumber" + }, + { + "$ref": "#/components/schemas/CustomFieldDate" + }, + { + "$ref": "#/components/schemas/CustomFieldCheckbox" + }, + { + "$ref": "#/components/schemas/CustomFieldSelect" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "checkbox": "#/components/schemas/CustomFieldCheckbox", + "date": "#/components/schemas/CustomFieldDate", + "number": "#/components/schemas/CustomFieldNumber", + "select": "#/components/schemas/CustomFieldSelect", + "text": "#/components/schemas/CustomFieldText" + } + } + }, + "CustomFieldCheckbox": { "properties": { "created_at": { "type": "string", @@ -18592,46 +20519,46 @@ "type": "string", "format": "uuid4", "title": "Id", - "description": "The ID of the benefit." + "description": "The ID of the object." + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Metadata" }, "type": { "type": "string", "enum": [ - "license_keys" + "checkbox" ], - "const": "license_keys", + "const": "checkbox", "title": "Type" }, - "description": { + "slug": { "type": "string", - "title": "Description", - "description": "The description of the benefit." - }, - "selectable": { - "type": "boolean", - "title": "Selectable", - "description": "Whether the benefit is selectable when creating a product." + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, - "deletable": { - "type": "boolean", - "title": "Deletable", - "description": "Whether the benefit is deletable." + "name": { + "type": "string", + "title": "Name", + "description": "Name of the custom field." }, "organization_id": { "type": "string", "format": "uuid4", "title": "Organization Id", - "description": "The ID of the organization owning the benefit." + "description": "The ID of the organization owning the custom field.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, "properties": { - "$ref": "#/components/schemas/BenefitLicenseKeysSubscriberProperties" - }, - "grants": { - "items": { - "$ref": "#/components/schemas/BenefitGrantLicenseKeys" - }, - "type": "array", - "title": "Grants" + "$ref": "#/components/schemas/CustomFieldCheckboxProperties" } }, "type": "object", @@ -18639,241 +20566,397 @@ "created_at", "modified_at", "id", + "metadata", "type", - "description", - "selectable", - "deletable", + "slug", + "name", "organization_id", - "properties", - "grants" + "properties" ], - "title": "BenefitLicenseKeysSubscriber" + "title": "CustomFieldCheckbox", + "description": "Schema for a custom field of type checkbox." }, - "BenefitLicenseKeysSubscriberProperties": { + "CustomFieldCheckboxProperties": { "properties": { - "prefix": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "form_label": { + "type": "string", + "minLength": 1, + "title": "Form Label" + }, + "form_help_text": { + "type": "string", + "minLength": 1, + "title": "Form Help Text" + }, + "form_placeholder": { + "type": "string", + "minLength": 1, + "title": "Form Placeholder" + } + }, + "type": "object", + "title": "CustomFieldCheckboxProperties" + }, + "CustomFieldCreate": { + "oneOf": [ + { + "$ref": "#/components/schemas/CustomFieldCreateText" + }, + { + "$ref": "#/components/schemas/CustomFieldCreateNumber" + }, + { + "$ref": "#/components/schemas/CustomFieldCreateDate" + }, + { + "$ref": "#/components/schemas/CustomFieldCreateCheckbox" + }, + { + "$ref": "#/components/schemas/CustomFieldCreateSelect" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "checkbox": "#/components/schemas/CustomFieldCreateCheckbox", + "date": "#/components/schemas/CustomFieldCreateDate", + "number": "#/components/schemas/CustomFieldCreateNumber", + "select": "#/components/schemas/CustomFieldCreateSelect", + "text": "#/components/schemas/CustomFieldCreateText" + } + } + }, + "CustomFieldCreateCheckbox": { + "properties": { + "metadata": { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50, + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." + }, + "type": { + "type": "string", + "enum": [ + "checkbox" ], - "title": "Prefix" + "const": "checkbox", + "title": "Type" }, - "expires": { - "anyOf": [ - { - "$ref": "#/components/schemas/BenefitLicenseKeyExpirationProperties" - }, - { - "type": "null" - } - ] + "slug": { + "type": "string", + "minLength": 1, + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, - "activations": { - "anyOf": [ - { - "$ref": "#/components/schemas/BenefitLicenseKeyActivationProperties" - }, - { - "type": "null" - } - ] + "name": { + "type": "string", + "minLength": 1, + "title": "Name", + "description": "Name of the custom field." }, - "limit_usage": { + "organization_id": { "anyOf": [ { - "type": "integer" + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } ], - "title": "Limit Usage" + "title": "Organization Id", + "description": "The ID of the organization owning the custom field. **Required unless you use an organization token.**" + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldCheckboxProperties" } }, "type": "object", "required": [ - "prefix", - "expires", - "activations", - "limit_usage" + "type", + "slug", + "name", + "properties" ], - "title": "BenefitLicenseKeysSubscriberProperties" + "title": "CustomFieldCreateCheckbox", + "description": "Schema to create a custom field of type checkbox." }, - "BenefitLicenseKeysUpdate": { + "CustomFieldCreateDate": { "properties": { - "description": { - "anyOf": [ - { - "type": "string", - "maxLength": 42, - "minLength": 3 - }, - { - "type": "null" - } - ], - "title": "Description", - "description": "The description of the benefit. Will be displayed on products having this benefit." + "metadata": { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50, + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, "type": { "type": "string", "enum": [ - "license_keys" + "date" ], - "const": "license_keys", + "const": "date", "title": "Type" }, - "properties": { + "slug": { + "type": "string", + "minLength": 1, + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." + }, + "name": { + "type": "string", + "minLength": 1, + "title": "Name", + "description": "Name of the custom field." + }, + "organization_id": { "anyOf": [ { - "$ref": "#/components/schemas/BenefitLicenseKeysCreateProperties" + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } - ] + ], + "title": "Organization Id", + "description": "The ID of the organization owning the custom field. **Required unless you use an organization token.**" + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldDateProperties" } }, "type": "object", "required": [ - "type" - ], - "title": "BenefitLicenseKeysUpdate" - }, - "BenefitType": { - "type": "string", - "enum": [ - "custom", - "articles", - "ads", - "discord", - "github_repository", - "downloadables", - "license_keys" + "type", + "slug", + "name", + "properties" ], - "title": "BenefitType" + "title": "CustomFieldCreateDate", + "description": "Schema to create a custom field of type date." }, - "BylineProfile": { + "CustomFieldCreateNumber": { "properties": { + "metadata": { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50, + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." + }, + "type": { + "type": "string", + "enum": [ + "number" + ], + "const": "number", + "title": "Type" + }, + "slug": { + "type": "string", + "minLength": 1, + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." + }, "name": { "type": "string", - "title": "Name" + "minLength": 1, + "title": "Name", + "description": "Name of the custom field." }, - "avatar_url": { + "organization_id": { "anyOf": [ { - "type": "string" + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } ], - "title": "Avatar Url" + "title": "Organization Id", + "description": "The ID of the organization owning the custom field. **Required unless you use an organization token.**" + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldNumberProperties" } }, "type": "object", "required": [ + "type", + "slug", "name", - "avatar_url" + "properties" ], - "title": "BylineProfile" + "title": "CustomFieldCreateNumber", + "description": "Schema to create a custom field of type number." }, - "CheckoutConfirmStripe": { + "CustomFieldCreateSelect": { "properties": { - "product_price_id": { - "anyOf": [ - { - "type": "string", - "format": "uuid4" - }, - { - "type": "null" - } - ], - "title": "Product Price Id", - "description": "ID of the product price to checkout. Must correspond to a price linked to the same product." + "metadata": { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50, + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "amount": { - "anyOf": [ - { - "type": "integer", - "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "select" ], - "title": "Amount" + "const": "select", + "title": "Type" }, - "customer_name": { - "anyOf": [ - { - "type": "string", - "description": "Name of the customer." - }, - { - "type": "null" - } - ], - "title": "Customer Name" + "slug": { + "type": "string", + "minLength": 1, + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, - "customer_email": { + "name": { + "type": "string", + "minLength": 1, + "title": "Name", + "description": "Name of the custom field." + }, + "organization_id": { "anyOf": [ { "type": "string", - "format": "email", - "description": "Email address of the customer." + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } ], - "title": "Customer Email" + "title": "Organization Id", + "description": "The ID of the organization owning the custom field. **Required unless you use an organization token.**" }, - "customer_billing_address": { - "anyOf": [ - { - "$ref": "#/components/schemas/Address", - "description": "Billing address of the customer." - }, - { - "type": "null" - } - ] + "properties": { + "$ref": "#/components/schemas/CustomFieldSelectProperties" + } + }, + "type": "object", + "required": [ + "type", + "slug", + "name", + "properties" + ], + "title": "CustomFieldCreateSelect", + "description": "Schema to create a custom field of type select." + }, + "CustomFieldCreateText": { + "properties": { + "metadata": { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50, + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "customer_tax_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "text" ], - "title": "Customer Tax Id" + "const": "text", + "title": "Type" }, - "confirmation_token_id": { + "slug": { + "type": "string", + "minLength": 1, + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." + }, + "name": { + "type": "string", + "minLength": 1, + "title": "Name", + "description": "Name of the custom field." + }, + "organization_id": { "anyOf": [ { - "type": "string" + "type": "string", + "format": "uuid4", + "description": "The organization ID.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, { "type": "null" } ], - "title": "Confirmation Token Id", - "description": "ID of the Stripe confirmation token. Required for fixed prices and custom prices." + "title": "Organization Id", + "description": "The ID of the organization owning the custom field. **Required unless you use an organization token.**" + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldTextProperties" } }, "type": "object", - "title": "CheckoutConfirmStripe", - "description": "Confirm a checkout session using a Stripe confirmation token." + "required": [ + "type", + "slug", + "name", + "properties" + ], + "title": "CustomFieldCreateText", + "description": "Schema to create a custom field of type text." }, - "CheckoutLink": { + "CustomFieldDate": { "properties": { "created_at": { "type": "string", @@ -18907,159 +20990,84 @@ "type": "object", "title": "Metadata" }, - "payment_processor": { - "$ref": "#/components/schemas/polar__enums__PaymentProcessor", - "description": "Payment processor used." - }, - "client_secret": { + "type": { "type": "string", - "title": "Client Secret", - "description": "Client secret used to access the checkout link." - }, - "success_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "enum": [ + "date" ], - "title": "Success Url", - "description": "URL where the customer will be redirected after a successful payment." - }, - "product_price_id": { - "type": "string", - "format": "uuid4", - "title": "Product Price Id", - "description": "ID of the product price to checkout." - }, - "product_price": { - "$ref": "#/components/schemas/ProductPrice" + "const": "date", + "title": "Type" }, - "url": { + "slug": { "type": "string", - "title": "Url", - "readOnly": true - } - }, - "type": "object", - "required": [ - "created_at", - "modified_at", - "id", - "metadata", - "payment_processor", - "client_secret", - "success_url", - "product_price_id", - "product_price", - "url" - ], - "title": "CheckoutLink", - "description": "Checkout link data." - }, - "CheckoutLinkCreate": { - "properties": { - "metadata": { - "additionalProperties": { - "type": "string", - "maxLength": 500, - "minLength": 1 - }, - "type": "object", - "maxProperties": 50, - "title": "Metadata", - "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, - "payment_processor": { + "name": { "type": "string", - "enum": [ - "stripe" - ], - "const": "stripe", - "title": "Payment Processor", - "description": "Payment processor to use. Currently only Stripe is supported." + "title": "Name", + "description": "Name of the custom field." }, - "product_price_id": { + "organization_id": { "type": "string", - "format": "uuid4", - "title": "Product Price Id", - "description": "ID of the product price to checkout." - }, - "success_url": { - "anyOf": [ - { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri" - }, - { - "type": "null" - } - ], - "title": "Success Url", - "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the custom field.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldDateProperties" } }, "type": "object", "required": [ - "payment_processor", - "product_price_id" - ], - "title": "CheckoutLinkCreate", - "description": "Schema to create a new checkout link." - }, - "CheckoutLinkSortProperty": { - "type": "string", - "enum": [ "created_at", - "-created_at" + "modified_at", + "id", + "metadata", + "type", + "slug", + "name", + "organization_id", + "properties" ], - "title": "CheckoutLinkSortProperty" + "title": "CustomFieldDate", + "description": "Schema for a custom field of type date." }, - "CheckoutLinkUpdate": { + "CustomFieldDateProperties": { "properties": { - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string", - "maxLength": 500, - "minLength": 1 - }, - "type": "object", - "maxProperties": 50 - }, - { - "type": "null" - } - ], - "title": "Metadata", - "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." + "form_label": { + "type": "string", + "minLength": 1, + "title": "Form Label" }, - "success_url": { - "anyOf": [ - { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri" - }, - { - "type": "null" - } - ], - "title": "Success Url", - "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." + "form_help_text": { + "type": "string", + "minLength": 1, + "title": "Form Help Text" + }, + "form_placeholder": { + "type": "string", + "minLength": 1, + "title": "Form Placeholder" + }, + "ge": { + "type": "integer", + "title": "Ge" + }, + "le": { + "type": "integer", + "title": "Le" } }, "type": "object", - "title": "CheckoutLinkUpdate", - "description": "Schema to update an existing checkout link." + "title": "CustomFieldDateProperties" }, - "CheckoutPublic": { + "CustomFieldNumber": { "properties": { "created_at": { "type": "string", @@ -19086,193 +21094,302 @@ "title": "Id", "description": "The ID of the object." }, - "payment_processor": { - "$ref": "#/components/schemas/polar__enums__PaymentProcessor", - "description": "Payment processor used." + "metadata": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Metadata" }, - "status": { - "$ref": "#/components/schemas/CheckoutStatus", - "description": "Status of the checkout session." + "type": { + "type": "string", + "enum": [ + "number" + ], + "const": "number", + "title": "Type" }, - "client_secret": { + "slug": { "type": "string", - "title": "Client Secret", - "description": "Client secret used to update and complete the checkout session from the client." + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, - "url": { + "name": { "type": "string", - "title": "Url", - "description": "URL where the customer can access the checkout session." + "title": "Name", + "description": "Name of the custom field." }, - "expires_at": { + "organization_id": { "type": "string", - "format": "date-time", - "title": "Expires At", - "description": "Expiration date and time of the checkout session." + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the custom field.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } }, - "success_url": { + "properties": { + "$ref": "#/components/schemas/CustomFieldNumberProperties" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "metadata", + "type", + "slug", + "name", + "organization_id", + "properties" + ], + "title": "CustomFieldNumber", + "description": "Schema for a custom field of type number." + }, + "CustomFieldNumberProperties": { + "properties": { + "form_label": { "type": "string", - "title": "Success Url", - "description": "URL where the customer will be redirected after a successful payment." + "minLength": 1, + "title": "Form Label" }, - "embed_origin": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Embed Origin", - "description": "When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page." + "form_help_text": { + "type": "string", + "minLength": 1, + "title": "Form Help Text" }, - "amount": { - "anyOf": [ - { - "type": "integer", - "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." - }, - { - "type": "null" - } - ], - "title": "Amount" + "form_placeholder": { + "type": "string", + "minLength": 1, + "title": "Form Placeholder" }, - "tax_amount": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Tax Amount", - "description": "Computed tax amount to pay in cents." + "ge": { + "type": "integer", + "title": "Ge" }, - "currency": { + "le": { + "type": "integer", + "title": "Le" + } + }, + "type": "object", + "title": "CustomFieldNumberProperties" + }, + "CustomFieldSelect": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { "anyOf": [ { - "type": "string" + "type": "string", + "format": "date-time" }, { "type": "null" } ], - "title": "Currency", - "description": "Currency code of the checkout session." + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "total_amount": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the object." + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Metadata" + }, + "type": { + "type": "string", + "enum": [ + "select" ], - "title": "Total Amount", - "description": "Total amount to pay in cents." + "const": "select", + "title": "Type" }, - "product_id": { + "slug": { + "type": "string", + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." + }, + "name": { + "type": "string", + "title": "Name", + "description": "Name of the custom field." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the custom field.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldSelectProperties" + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "metadata", + "type", + "slug", + "name", + "organization_id", + "properties" + ], + "title": "CustomFieldSelect", + "description": "Schema for a custom field of type select." + }, + "CustomFieldSelectOption": { + "properties": { + "value": { "type": "string", - "format": "uuid4", - "title": "Product Id", - "description": "ID of the product to checkout." + "minLength": 1, + "title": "Value" }, - "product_price_id": { + "label": { "type": "string", - "format": "uuid4", - "title": "Product Price Id", - "description": "ID of the product price to checkout." + "minLength": 1, + "title": "Label" + } + }, + "type": "object", + "required": [ + "value", + "label" + ], + "title": "CustomFieldSelectOption" + }, + "CustomFieldSelectProperties": { + "properties": { + "form_label": { + "type": "string", + "minLength": 1, + "title": "Form Label" }, - "is_payment_required": { - "type": "boolean", - "title": "Is Payment Required", - "description": "Whether the checkout requires payment. Useful to detect free products." + "form_help_text": { + "type": "string", + "minLength": 1, + "title": "Form Help Text" }, - "customer_id": { - "anyOf": [ - { - "type": "string", - "format": "uuid4" - }, - { - "type": "null" - } - ], - "title": "Customer Id" + "form_placeholder": { + "type": "string", + "minLength": 1, + "title": "Form Placeholder" }, - "customer_name": { - "anyOf": [ - { - "type": "string", - "description": "Name of the customer." - }, - { - "type": "null" - } - ], - "title": "Customer Name" + "options": { + "items": { + "$ref": "#/components/schemas/CustomFieldSelectOption" + }, + "type": "array", + "title": "Options" + } + }, + "type": "object", + "required": [ + "options" + ], + "title": "CustomFieldSelectProperties" + }, + "CustomFieldSortProperty": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "slug", + "-slug", + "name", + "-name", + "type", + "-type" + ], + "title": "CustomFieldSortProperty" + }, + "CustomFieldText": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." }, - "customer_email": { + "modified_at": { "anyOf": [ { "type": "string", - "format": "email", - "description": "Email address of the customer." + "format": "date-time" }, { "type": "null" } ], - "title": "Customer Email" + "title": "Modified At", + "description": "Last modification timestamp of the object." }, - "customer_ip_address": { - "anyOf": [ - { - "type": "string", - "format": "ipvanyaddress", - "description": "IP address of the customer. Used to detect tax location." - }, - { - "type": "null" - } - ], - "title": "Customer Ip Address" + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the object." }, - "customer_billing_address": { - "anyOf": [ - { - "$ref": "#/components/schemas/Address", - "description": "Billing address of the customer." - }, - { - "type": "null" - } - ] + "metadata": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Metadata" }, - "customer_tax_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "type": { + "type": "string", + "enum": [ + "text" ], - "title": "Customer Tax Id" + "const": "text", + "title": "Type" }, - "payment_processor_metadata": { - "type": "object", - "title": "Payment Processor Metadata" + "slug": { + "type": "string", + "title": "Slug", + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, - "product": { - "$ref": "#/components/schemas/Product" + "name": { + "type": "string", + "title": "Name", + "description": "Name of the custom field." }, - "product_price": { - "$ref": "#/components/schemas/ProductPrice" + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the custom field.", + "x-polar-selector-widget": { + "displayProperty": "name", + "resourceName": "Organization", + "resourceRoot": "/v1/organizations" + } + }, + "properties": { + "$ref": "#/components/schemas/CustomFieldTextProperties" } }, "type": "object", @@ -19280,128 +21397,237 @@ "created_at", "modified_at", "id", - "payment_processor", - "status", - "client_secret", - "url", - "expires_at", - "success_url", - "embed_origin", - "amount", - "tax_amount", - "currency", - "total_amount", - "product_id", - "product_price_id", - "is_payment_required", - "customer_id", - "customer_name", - "customer_email", - "customer_ip_address", - "customer_billing_address", - "customer_tax_id", - "payment_processor_metadata", - "product", - "product_price" + "metadata", + "type", + "slug", + "name", + "organization_id", + "properties" ], - "title": "CheckoutPublic", - "description": "Checkout session data retrieved using the client secret." + "title": "CustomFieldText", + "description": "Schema for a custom field of type text." }, - "CheckoutSortProperty": { + "CustomFieldTextProperties": { + "properties": { + "form_label": { + "type": "string", + "minLength": 1, + "title": "Form Label" + }, + "form_help_text": { + "type": "string", + "minLength": 1, + "title": "Form Help Text" + }, + "form_placeholder": { + "type": "string", + "minLength": 1, + "title": "Form Placeholder" + }, + "textarea": { + "type": "boolean", + "title": "Textarea" + }, + "min_length": { + "type": "integer", + "minimum": 0, + "title": "Min Length" + }, + "max_length": { + "type": "integer", + "minimum": 0, + "title": "Max Length" + } + }, + "type": "object", + "title": "CustomFieldTextProperties" + }, + "CustomFieldType": { "type": "string", "enum": [ - "created_at", - "-created_at", - "expires_at", - "-expires_at" + "text", + "number", + "date", + "checkbox", + "select" ], - "title": "CheckoutSortProperty" + "title": "CustomFieldType" }, - "CheckoutStatus": { - "type": "string", - "enum": [ - "open", - "expired", - "confirmed", - "succeeded", - "failed" + "CustomFieldUpdate": { + "oneOf": [ + { + "$ref": "#/components/schemas/CustomFieldUpdateText" + }, + { + "$ref": "#/components/schemas/CustomFieldUpdateNumber" + }, + { + "$ref": "#/components/schemas/CustomFieldUpdateDate" + }, + { + "$ref": "#/components/schemas/CustomFieldUpdateCheckbox" + }, + { + "$ref": "#/components/schemas/CustomFieldUpdateSelect" + } ], - "title": "CheckoutStatus" + "discriminator": { + "propertyName": "type", + "mapping": { + "checkbox": "#/components/schemas/CustomFieldUpdateCheckbox", + "date": "#/components/schemas/CustomFieldUpdateDate", + "number": "#/components/schemas/CustomFieldUpdateNumber", + "select": "#/components/schemas/CustomFieldUpdateSelect", + "text": "#/components/schemas/CustomFieldUpdateText" + } + } }, - "CheckoutUpdate": { + "CustomFieldUpdateCheckbox": { "properties": { - "product_price_id": { + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50 + }, + { + "type": "null" + } + ], + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." + }, + "name": { "anyOf": [ { "type": "string", - "format": "uuid4" + "minLength": 1, + "description": "Name of the custom field." }, { "type": "null" } ], - "title": "Product Price Id", - "description": "ID of the product price to checkout. Must correspond to a price linked to the same product." + "title": "Name" }, - "amount": { + "slug": { "anyOf": [ { - "type": "integer", - "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." + "type": "string", + "minLength": 1, + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, { "type": "null" } ], - "title": "Amount" + "title": "Slug" }, - "customer_name": { + "type": { + "type": "string", + "enum": [ + "checkbox" + ], + "const": "checkbox", + "title": "Type" + }, + "properties": { "anyOf": [ { - "type": "string", - "description": "Name of the customer." + "$ref": "#/components/schemas/CustomFieldCheckboxProperties" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "type" + ], + "title": "CustomFieldUpdateCheckbox", + "description": "Schema to update a custom field of type checkbox." + }, + "CustomFieldUpdateDate": { + "properties": { + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50 }, { "type": "null" } ], - "title": "Customer Name" + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "customer_email": { + "name": { "anyOf": [ { "type": "string", - "format": "email", - "description": "Email address of the customer." + "minLength": 1, + "description": "Name of the custom field." }, { "type": "null" } ], - "title": "Customer Email" + "title": "Name" }, - "customer_billing_address": { + "slug": { "anyOf": [ { - "$ref": "#/components/schemas/Address", - "description": "Billing address of the customer." + "type": "string", + "minLength": 1, + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, { "type": "null" } - ] + ], + "title": "Slug" }, - "customer_tax_id": { + "type": { + "type": "string", + "enum": [ + "date" + ], + "const": "date", + "title": "Type" + }, + "properties": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/CustomFieldDateProperties" }, { "type": "null" } - ], - "title": "Customer Tax Id" - }, + ] + } + }, + "type": "object", + "required": [ + "type" + ], + "title": "CustomFieldUpdateDate", + "description": "Schema to update a custom field of type date." + }, + "CustomFieldUpdateNumber": { + "properties": { "metadata": { "anyOf": [ { @@ -19420,149 +21646,220 @@ "title": "Metadata", "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "customer_ip_address": { + "name": { "anyOf": [ { "type": "string", - "format": "ipvanyaddress", - "description": "IP address of the customer. Used to detect tax location." + "minLength": 1, + "description": "Name of the custom field." }, { "type": "null" } ], - "title": "Customer Ip Address" + "title": "Name" }, - "success_url": { + "slug": { "anyOf": [ { "type": "string", - "maxLength": 2083, "minLength": 1, - "format": "uri" + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, { "type": "null" } ], - "title": "Success Url", - "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." + "title": "Slug" + }, + "type": { + "type": "string", + "enum": [ + "number" + ], + "const": "number", + "title": "Type" + }, + "properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/CustomFieldNumberProperties" + }, + { + "type": "null" + } + ] } }, "type": "object", - "title": "CheckoutUpdate", - "description": "Update an existing checkout session using an access token." + "required": [ + "type" + ], + "title": "CustomFieldUpdateNumber", + "description": "Schema to update a custom field of type number." }, - "CheckoutUpdatePublic": { + "CustomFieldUpdateSelect": { "properties": { - "product_price_id": { + "metadata": { "anyOf": [ { - "type": "string", - "format": "uuid4" + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50 }, { "type": "null" } ], - "title": "Product Price Id", - "description": "ID of the product price to checkout. Must correspond to a price linked to the same product." + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "amount": { + "name": { "anyOf": [ { - "type": "integer", - "description": "Amount to pay in cents. Only useful for custom prices, it'll be ignored for fixed and free prices." + "type": "string", + "minLength": 1, + "description": "Name of the custom field." }, { "type": "null" } ], - "title": "Amount" + "title": "Name" }, - "customer_name": { + "slug": { "anyOf": [ { "type": "string", - "description": "Name of the customer." + "minLength": 1, + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, { "type": "null" } ], - "title": "Customer Name" + "title": "Slug" }, - "customer_email": { + "type": { + "type": "string", + "enum": [ + "select" + ], + "const": "select", + "title": "Type" + }, + "properties": { "anyOf": [ { - "type": "string", - "format": "email", - "description": "Email address of the customer." + "$ref": "#/components/schemas/CustomFieldSelectProperties" + }, + { + "type": "null" + } + ] + } + }, + "type": "object", + "required": [ + "type" + ], + "title": "CustomFieldUpdateSelect", + "description": "Schema to update a custom field of type select." + }, + "CustomFieldUpdateText": { + "properties": { + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string", + "maxLength": 500, + "minLength": 1 + }, + "type": "object", + "maxProperties": 50 }, { "type": "null" } ], - "title": "Customer Email" + "title": "Metadata", + "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, - "customer_billing_address": { + "name": { "anyOf": [ { - "$ref": "#/components/schemas/Address", - "description": "Billing address of the customer." + "type": "string", + "minLength": 1, + "description": "Name of the custom field." }, { "type": "null" } - ] + ], + "title": "Name" }, - "customer_tax_id": { + "slug": { "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1, + "description": "Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization." }, { "type": "null" } ], - "title": "Customer Tax Id" - } - }, - "type": "object", - "title": "CheckoutUpdatePublic", - "description": "Update an existing checkout session using the client secret." - }, - "ConfirmIssue": { - "properties": { - "splits": { - "items": { - "$ref": "#/components/schemas/ConfirmIssueSplit" - }, - "type": "array", - "title": "Splits" + "title": "Slug" + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "const": "text", + "title": "Type" + }, + "properties": { + "anyOf": [ + { + "$ref": "#/components/schemas/CustomFieldTextProperties" + }, + { + "type": "null" + } + ] } }, "type": "object", "required": [ - "splits" + "type" ], - "title": "ConfirmIssue" + "title": "CustomFieldUpdateText", + "description": "Schema to update a custom field of type text." }, - "ConfirmIssueSplit": { + "Customer": { "properties": { - "organization_id": { + "public_name": { + "type": "string", + "title": "Public Name" + }, + "github_username": { "anyOf": [ { - "type": "string", - "format": "uuid" + "type": "string" }, { "type": "null" } ], - "title": "Organization Id" + "title": "Github Username" }, - "github_username": { + "avatar_url": { "anyOf": [ { "type": "string" @@ -19571,38 +21868,37 @@ "type": "null" } ], - "title": "Github Username" - }, - "share_thousands": { - "type": "integer", - "title": "Share Thousands" + "title": "Avatar Url" } }, "type": "object", "required": [ - "share_thousands" + "public_name", + "github_username", + "avatar_url" ], - "title": "ConfirmIssueSplit" + "title": "Customer" }, - "CurrencyAmount": { + "Customers": { "properties": { - "currency": { - "type": "string", - "title": "Currency", - "description": "Three letter currency code (eg: USD)" - }, - "amount": { + "total": { "type": "integer", - "title": "Amount", - "description": "Amount in the currencies smallest unit (cents if currency is USD)" + "title": "Total" + }, + "customers": { + "items": { + "$ref": "#/components/schemas/Customer" + }, + "type": "array", + "title": "Customers" } }, "type": "object", "required": [ - "currency", - "amount" + "total", + "customers" ], - "title": "CurrencyAmount" + "title": "Customers" }, "Donation": { "properties": { @@ -22364,6 +24660,26 @@ ], "title": "ListResource[WebhookEndpoint]" }, + "ListResource__": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/CustomField" + }, + "type": "array", + "title": "Items" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "type": "object", + "required": [ + "items", + "pagination" + ], + "title": "ListResource[]" + }, "Metric": { "properties": { "slug": { @@ -22689,7 +25005,7 @@ "scope": { "type": "string", "title": "Scope", - "default": "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write" + "default": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write" }, "client_name": { "type": "string", @@ -22851,7 +25167,7 @@ "scope": { "type": "string", "title": "Scope", - "default": "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write" + "default": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write" }, "client_name": { "type": "string", @@ -22972,7 +25288,7 @@ "scope": { "type": "string", "title": "Scope", - "default": "openid profile email user:read organizations:read organizations:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write" + "default": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write orders:read metrics:read articles:read articles:write webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write user:benefits:read user:orders:read user:subscriptions:read user:subscriptions:write user:downloadables:read user:license_keys:read user:advertisement_campaigns:read user:advertisement_campaigns:write" }, "client_name": { "type": "string", @@ -23172,6 +25488,11 @@ "type": "object", "title": "Metadata" }, + "custom_field_data": { + "type": "object", + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." + }, "amount": { "type": "integer", "title": "Amount" @@ -24758,22 +27079,16 @@ }, "type": "array", "title": "Prices", - "description": "List of available prices for this product." + "description": "List of prices for this product." }, "benefits": { "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/BenefitBase" - }, - { - "$ref": "#/components/schemas/BenefitArticles" - } - ] + "$ref": "#/components/schemas/Benefit", + "title": "Benefit" }, "type": "array", - "title": "BenefitPublic", - "description": "The benefits granted by the product." + "title": "Benefits", + "description": "List of benefits granted by the product." }, "medias": { "items": { @@ -24781,7 +27096,15 @@ }, "type": "array", "title": "Medias", - "description": "The medias associated to the product." + "description": "List of medias associated to the product." + }, + "attached_custom_fields": { + "items": { + "$ref": "#/components/schemas/AttachedCustomField" + }, + "type": "array", + "title": "Attached Custom Fields", + "description": "List of custom fields attached to the product." } }, "type": "object", @@ -24796,7 +27119,8 @@ "organization_id", "prices", "benefits", - "medias" + "medias", + "attached_custom_fields" ], "title": "Product", "description": "A product." @@ -25110,6 +27434,14 @@ "title": "Medias", "description": "List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded." }, + "attached_custom_fields": { + "items": { + "$ref": "#/components/schemas/AttachedCustomFieldCreate" + }, + "type": "array", + "title": "Attached Custom Fields", + "description": "List of custom fields to attach." + }, "organization_id": { "anyOf": [ { @@ -26037,6 +28369,14 @@ "title": "Medias", "description": "List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded." }, + "attached_custom_fields": { + "items": { + "$ref": "#/components/schemas/AttachedCustomFieldCreate" + }, + "type": "array", + "title": "Attached Custom Fields", + "description": "List of custom fields to attach." + }, "organization_id": { "anyOf": [ { @@ -26081,6 +28421,115 @@ ], "title": "ProductSortProperty" }, + "ProductStorefront": { + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At", + "description": "Creation timestamp of the object." + }, + "modified_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Modified At", + "description": "Last modification timestamp of the object." + }, + "id": { + "type": "string", + "format": "uuid4", + "title": "Id", + "description": "The ID of the product." + }, + "name": { + "type": "string", + "title": "Name", + "description": "The name of the product." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "The description of the product." + }, + "is_recurring": { + "type": "boolean", + "title": "Is Recurring", + "description": "Whether the product is a subscription tier." + }, + "is_archived": { + "type": "boolean", + "title": "Is Archived", + "description": "Whether the product is archived and no longer available." + }, + "organization_id": { + "type": "string", + "format": "uuid4", + "title": "Organization Id", + "description": "The ID of the organization owning the product." + }, + "prices": { + "items": { + "$ref": "#/components/schemas/ProductPrice" + }, + "type": "array", + "title": "Prices", + "description": "List of available prices for this product." + }, + "benefits": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/BenefitBase" + }, + { + "$ref": "#/components/schemas/BenefitArticles" + } + ] + }, + "type": "array", + "title": "BenefitPublic", + "description": "The benefits granted by the product." + }, + "medias": { + "items": { + "$ref": "#/components/schemas/ProductMediaFileRead" + }, + "type": "array", + "title": "Medias", + "description": "The medias associated to the product." + } + }, + "type": "object", + "required": [ + "created_at", + "modified_at", + "id", + "name", + "description", + "is_recurring", + "is_archived", + "organization_id", + "prices", + "benefits", + "medias" + ], + "title": "ProductStorefront", + "description": "Schema of a public product." + }, "ProductUpdate": { "properties": { "name": { @@ -26169,6 +28618,21 @@ ], "title": "Medias", "description": "List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded." + }, + "attached_custom_fields": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AttachedCustomFieldCreate" + }, + "type": "array", + "description": "List of custom fields to attach." + }, + { + "type": "null" + } + ], + "title": "Attached Custom Fields" } }, "type": "object", @@ -26360,6 +28824,16 @@ }, "organization": { "$ref": "#/components/schemas/ExternalOrganization" + }, + "internal_organization": { + "anyOf": [ + { + "$ref": "#/components/schemas/Organization" + }, + { + "type": "null" + } + ] } }, "type": "object", @@ -26373,7 +28847,8 @@ "license", "homepage", "profile_settings", - "organization" + "organization", + "internal_organization" ], "title": "Repository" }, @@ -26914,6 +29389,8 @@ "web_default", "organizations:read", "organizations:write", + "custom_fields:read", + "custom_fields:write", "checkout_links:read", "checkout_links:write", "checkouts:read", @@ -27001,6 +29478,31 @@ ], "title": "Status" }, + "Storefront": { + "properties": { + "organization": { + "$ref": "#/components/schemas/Organization" + }, + "products": { + "items": { + "$ref": "#/components/schemas/ProductStorefront" + }, + "type": "array", + "title": "Products" + }, + "customers": { + "$ref": "#/components/schemas/Customers" + } + }, + "type": "object", + "required": [ + "organization", + "products", + "customers" + ], + "title": "Storefront", + "description": "Schema of a public storefront." + }, "SubType": { "type": "string", "enum": [ @@ -27143,6 +29645,11 @@ "type": "object", "title": "Metadata" }, + "custom_field_data": { + "type": "object", + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." + }, "user": { "$ref": "#/components/schemas/SubscriptionUser" }, @@ -29126,7 +31633,7 @@ }, "type": "array", "title": "Prices", - "description": "List of available prices for this product." + "description": "List of prices for this product." }, "benefits": { "items": { @@ -29141,7 +31648,7 @@ }, "type": "array", "title": "BenefitPublic", - "description": "The benefits granted by the product." + "description": "List of benefits granted by the product." }, "medias": { "items": { @@ -29149,7 +31656,10 @@ }, "type": "array", "title": "Medias", - "description": "The medias associated to the product." + "description": "List of medias associated to the product." + }, + "organization": { + "$ref": "#/components/schemas/Organization" } }, "type": "object", @@ -29164,7 +31674,8 @@ "organization_id", "prices", "benefits", - "medias" + "medias", + "organization" ], "title": "UserOrderProduct" }, @@ -29556,7 +32067,7 @@ }, "type": "array", "title": "Prices", - "description": "List of available prices for this product." + "description": "List of prices for this product." }, "benefits": { "items": { @@ -29571,7 +32082,7 @@ }, "type": "array", "title": "BenefitPublic", - "description": "The benefits granted by the product." + "description": "List of benefits granted by the product." }, "medias": { "items": { @@ -29579,7 +32090,10 @@ }, "type": "array", "title": "Medias", - "description": "The medias associated to the product." + "description": "List of medias associated to the product." + }, + "organization": { + "$ref": "#/components/schemas/Organization" } }, "type": "object", @@ -29594,7 +32108,8 @@ "organization_id", "prices", "benefits", - "medias" + "medias", + "organization" ], "title": "UserSubscriptionProduct" }, @@ -30625,7 +33140,7 @@ "title": "Customer Name" }, "product": { - "$ref": "#/components/schemas/Product" + "$ref": "#/components/schemas/CheckoutProduct" }, "product_price": { "$ref": "#/components/schemas/ProductPrice" @@ -30718,6 +33233,11 @@ "title": "Id", "description": "The ID of the object." }, + "custom_field_data": { + "type": "object", + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." + }, "payment_processor": { "$ref": "#/components/schemas/polar__enums__PaymentProcessor", "description": "Payment processor used." @@ -30908,7 +33428,7 @@ "title": "Metadata" }, "product": { - "$ref": "#/components/schemas/Product" + "$ref": "#/components/schemas/CheckoutProduct" }, "product_price": { "$ref": "#/components/schemas/ProductPrice" @@ -30924,6 +33444,13 @@ } ], "title": "Subscription Id" + }, + "attached_custom_fields": { + "items": { + "$ref": "#/components/schemas/AttachedCustomField" + }, + "type": "array", + "title": "Attached Custom Fields" } }, "type": "object", @@ -30955,7 +33482,8 @@ "metadata", "product", "product_price", - "subscription_id" + "subscription_id", + "attached_custom_fields" ], "title": "Checkout", "description": "Checkout session data retrieved using an access token." @@ -30973,6 +33501,11 @@ "title": "Metadata", "description": "Key-value object allowing you to store additional information.\n\nThe key must be a string with a maximum length of **40 characters**.\nThe value must be a string with a maximum length of **500 characters**.\nYou can store up to **50 key-value pairs**." }, + "custom_field_data": { + "type": "object", + "title": "Custom Field Data", + "description": "Key-value object storing custom field values." + }, "payment_processor": { "type": "string", "enum": [ @@ -31087,6 +33620,18 @@ ], "title": "Success Url", "description": "URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id." + }, + "embed_origin": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Embed Origin", + "description": "If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Polar iframe to communicate with the parent page." } }, "type": "object",