openapi: 3.1.0
info:
  title: Polar API
  summary: Polar HTTP and Webhooks API
  description: Read the docs at https://polar.sh/docs/api-reference
  version: 0.1.0
servers:
  - url: https://api.polar.sh
    description: Production environment
    x-speakeasy-server-id: production
  - url: https://sandbox-api.polar.sh
    description: Sandbox environment
    x-speakeasy-server-id: sandbox
paths:
  /v1/organizations/:
    get:
      tags:
        - organizations
        - public
      summary: List Organizations
      description: |-
        List organizations.

        **Scopes**: `organizations:read` `organizations:write`
      operationId: organizations:list
      parameters:
        - name: slug
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by slug.
            title: Slug
          description: Filter by slug.
        - 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/OrganizationSortProperty'
              - 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:
              - created_at
            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:
                $ref: '#/components/schemas/ListResource_Organization_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: organizations
      x-speakeasy-name-override: list_organizations
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Organizations.List(ctx, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10), nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceOrganization != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organizations.list_organizations(page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizations.listOrganizations({});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $responses = $sdk->organizations->list(
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - organizations
        - public
      summary: Create Organization
      description: |-
        Create an organization.

        **Scopes**: `organizations:write`
      operationId: organizations:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
      responses:
        '201':
          description: Organization created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: organizations
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Organizations.Create(ctx, components.OrganizationCreate{\n        Name: \"<value>\",\n        Slug: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Organization != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organizations.create(request={
                    "name": "<value>",
                    "slug": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizations.create({
                name: "<value>",
                slug: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\OrganizationCreate(
                name: '<value>',
                slug: '<value>',
            );

            $response = $sdk->organizations->create(
                request: $request
            );

            if ($response->organization !== null) {
                // handle response
            }
  /v1/organizations/{id}:
    get:
      tags:
        - organizations
        - public
      summary: Get Organization
      description: |-
        Get an organization by ID.

        **Scopes**: `organizations:read` `organizations:write`
      operationId: organizations:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            examples:
              - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
            description: The organization ID.
            x-polar-selector-widget:
              resourceRoot: /v1/organizations
              resourceName: Organization
              displayProperty: name
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '404':
          description: Organization 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-mcp:
        disabled: true
      x-speakeasy-group: organizations
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Organizations.Get(ctx, \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Organization != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organizations.get(id="1dbfc517-0bbf-4301-9ba8-555ca42b9737")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizations.get({
                id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->organizations->get(
                id: '1dbfc517-0bbf-4301-9ba8-555ca42b9737'
            );

            if ($response->organization !== null) {
                // handle response
            }
    patch:
      tags:
        - organizations
        - public
      summary: Update Organization
      description: |-
        Update an organization.

        **Scopes**: `organizations:write`
      operationId: organizations:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            examples:
              - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
            description: The organization ID.
            x-polar-selector-widget:
              resourceRoot: /v1/organizations
              resourceName: Organization
              displayProperty: name
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationUpdate'
      responses:
        '200':
          description: Organization updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '403':
          description: You don't have the permission to update this organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: Organization 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-mcp:
        disabled: true
      x-speakeasy-group: organizations
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Organizations.Update(ctx, \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\", components.OrganizationUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Organization != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organizations.update(id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", organization_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizations.update({
                id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                organizationUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $organizationUpdate = new Components\OrganizationUpdate();

            $response = $sdk->organizations->update(
                id: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                organizationUpdate: $organizationUpdate

            );

            if ($response->organization !== null) {
                // handle response
            }
  /v1/subscriptions/:
    get:
      tags:
        - subscriptions
        - public
        - mcp
      summary: List Subscriptions
      description: |-
        List subscriptions.

        **Scopes**: `subscriptions:read` `subscriptions:write`
      operationId: subscriptions:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                description: The customer external ID.
              - type: array
                items:
                  type: string
                  description: The customer external ID.
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by customer external ID.
          description: Filter by customer external ID.
        - name: discount_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: DiscountID Filter
            description: Filter by discount ID.
          description: Filter by discount ID.
        - name: active
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter by active or inactive subscription.
            deprecated: true
            title: Active
          description: Filter by active or inactive subscription.
          deprecated: true
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/SubscriptionStatus'
              - type: array
                items:
                  $ref: '#/components/schemas/SubscriptionStatus'
              - type: 'null'
            title: Status Filter
            description: Filter by subscription status.
          description: Filter by subscription status.
        - name: cancel_at_period_end
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter by subscriptions that are set to cancel at period end.
            title: Cancel At Period End
          description: Filter by subscriptions that are set to cancel at period end.
        - name: customer_cancellation_reason
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/CustomerCancellationReason'
              - type: array
                items:
                  $ref: '#/components/schemas/CustomerCancellationReason'
              - type: 'null'
            title: CustomerCancellationReason Filter
            description: Filter by customer cancellation reason.
          description: Filter by customer cancellation reason.
        - name: canceled_at_after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter by cancellation date (after or equal to).
            title: Canceled At After
          description: Filter by cancellation date (after or equal to).
        - name: canceled_at_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter by cancellation date (before or equal to).
            title: Canceled At Before
          description: Filter by cancellation date (before or equal to).
        - 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/SubscriptionSortProperty'
              - 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:
              - '-started_at'
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_Subscription_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - subscriptions
      x-speakeasy-group: subscriptions
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Subscriptions.List(ctx, operations.SubscriptionsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceSubscription != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.subscriptions.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.subscriptions.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\SubscriptionsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->subscriptions->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - subscriptions
        - public
        - mcp
      summary: Create Subscription
      description: |-
        Create a subscription programmatically.

        This endpoint only allows to create subscription on free products.
        For paid products, use the checkout flow.

        No initial order will be created and no confirmation email will be sent.

        **Scopes**: `subscriptions:write`
      operationId: subscriptions:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/SubscriptionCreateCustomer'
                - $ref: '#/components/schemas/SubscriptionCreateExternalCustomer'
              title: Subscription Create
      responses:
        '201':
          description: Subscription created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - subscriptions
      x-speakeasy-group: subscriptions
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Subscriptions.Create(ctx, operations.CreateSubscriptionsCreateSubscriptionCreateSubscriptionCreateCustomer(\n        components.SubscriptionCreateCustomer{\n            ProductID: \"d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23\",\n            CustomerID: \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Subscription != nil {\n        switch res.Subscription.Discount.Type {\n            case components.SubscriptionDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.Subscription.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.Subscription.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.subscriptions.create(request={
                    "product_id": "d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23",
                    "customer_id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.subscriptions.create({
                productId: "d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23",
                customerId: "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\SubscriptionCreateCustomer(
                productId: 'd8dd2de1-21b7-4a41-8bc3-ce909c0cfe23',
                customerId: '992fae2a-2a17-4b7a-8d9e-e287cf90131b',
            );

            $response = $sdk->subscriptions->create(
                request: $request
            );

            if ($response->subscription !== null) {
                // handle response
            }
  /v1/subscriptions/export:
    get:
      tags:
        - subscriptions
        - public
        - mcp
      summary: Export Subscriptions
      description: |-
        Export subscriptions as a CSV file.

        **Scopes**: `subscriptions:read` `subscriptions:write`
      operationId: subscriptions:export
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  description: The organization ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/organizations
                    resourceName: Organization
                    displayProperty: name
              - type: 'null'
            description: Filter by organization ID.
            title: Organization Id
          description: Filter by organization ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/csv:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - subscriptions
      x-speakeasy-group: subscriptions
      x-speakeasy-name-override: export
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Subscriptions.Export(ctx, polargo.Pointer(operations.CreateOrganizationIDStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.subscriptions.export(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.subscriptions.export({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->subscriptions->export(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737'
            );

            if ($response->any !== null) {
                // handle response
            }
  /v1/subscriptions/{id}:
    get:
      tags:
        - subscriptions
        - public
        - mcp
      summary: Get Subscription
      description: |-
        Get a subscription by ID.

        **Scopes**: `subscriptions:read` `subscriptions:write`
      operationId: subscriptions:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The subscription ID.
            title: Id
          description: The subscription ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '404':
          description: Subscription 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-mcp:
        disabled: false
        scopes:
          - read
          - subscriptions
      x-speakeasy-group: subscriptions
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Subscriptions.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Subscription != nil {\n        switch res.Subscription.Discount.Type {\n            case components.SubscriptionDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.Subscription.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.Subscription.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.subscriptions.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.subscriptions.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->subscriptions->get(
                id: '<value>'
            );

            if ($response->subscription !== null) {
                // handle response
            }
    patch:
      tags:
        - subscriptions
        - public
        - mcp
      summary: Update Subscription
      description: |-
        Update a subscription.

        **Scopes**: `subscriptions:write`
      operationId: subscriptions:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The subscription ID.
            title: Id
          description: The subscription ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionUpdate'
      responses:
        '200':
          description: Subscription updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '402':
          description: Payment required to apply the subscription update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentFailed'
        '403':
          description: >-
            Subscription is already canceled or will be at the end of the
            period.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlreadyCanceledSubscription'
        '404':
          description: Subscription not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '409':
          description: Subscription is pending an update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionLocked'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - subscriptions
      x-speakeasy-group: subscriptions
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Subscriptions.Update(ctx, \"<value>\", components.CreateSubscriptionUpdateSubscriptionUpdateProduct(\n        components.SubscriptionUpdateProduct{\n            ProductID: \"<value>\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Subscription != nil {\n        switch res.Subscription.Discount.Type {\n            case components.SubscriptionDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.Subscription.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.Subscription.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.subscriptions.update(id="<value>", subscription_update={
                    "seats": 308042,
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.subscriptions.update({
                id: "<value>",
                subscriptionUpdate: {
                  productId: "<value>",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->subscriptions->update(
                id: '<value>',
                subscriptionUpdate: new Components\SubscriptionUpdateProduct(
                    productId: '<value>',
                )

            );

            if ($response->subscription !== null) {
                // handle response
            }
    delete:
      tags:
        - subscriptions
        - public
        - mcp
      summary: Revoke Subscription
      description: |-
        Revoke a subscription, i.e cancel immediately.

        **Scopes**: `subscriptions:write`
      operationId: subscriptions:revoke
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The subscription ID.
            title: Id
          description: The subscription ID.
      responses:
        '200':
          description: Subscription revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '403':
          description: This subscription is already revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlreadyCanceledSubscription'
        '404':
          description: Subscription not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '409':
          description: Subscription is pending an update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionLocked'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - subscriptions
      x-speakeasy-group: subscriptions
      x-speakeasy-name-override: revoke
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Subscriptions.Revoke(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Subscription != nil {\n        switch res.Subscription.Discount.Type {\n            case components.SubscriptionDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.Subscription.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.Subscription.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.SubscriptionDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.Subscription.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.subscriptions.revoke(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.subscriptions.revoke({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->subscriptions->revoke(
                id: '<value>'
            );

            if ($response->subscription !== null) {
                // handle response
            }
  /v1/oauth2/register:
    post:
      tags:
        - oauth2
        - clients
        - public
      summary: Create Client
      description: Create an OAuth2 client.
      operationId: oauth2:clients:oauth2:create_client
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuth2ClientConfiguration'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Anonymous
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2.clients
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Oauth2.Clients.Create(ctx, components.OAuth2ClientConfiguration{\n        RedirectUris: []string{\n            \"https://impolite-hippodrome.com/\",\n            \"https://acidic-tomography.net/\",\n        },\n        ClientName: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.oauth2.clients.create(request={
                    "redirect_uris": [
                        "https://impolite-hippodrome.com/",
                        "https://acidic-tomography.net/",
                    ],
                    "client_name": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.oauth2.clients.create({
                redirectUris: [
                  "https://impolite-hippodrome.com/",
                  "https://acidic-tomography.net/",
                ],
                clientName: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\OAuth2ClientConfiguration(
                redirectUris: [
                    'https://impolite-hippodrome.com/',
                    'https://acidic-tomography.net/',
                ],
                clientName: '<value>',
            );

            $response = $sdk->oauth2->clients->create(
                request: $request
            );

            if ($response->any !== null) {
                // handle response
            }
  /v1/oauth2/register/{client_id}:
    get:
      tags:
        - oauth2
        - clients
        - public
      summary: Get Client
      description: Get an OAuth2 client by Client ID.
      operationId: oauth2:clients:oauth2:get_client
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
            title: Client Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Anonymous
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2.clients
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Oauth2.Clients.Get(ctx, \"<id>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.oauth2.clients.get(client_id="<id>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.oauth2.clients.get({
                clientId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->oauth2->clients->get(
                clientId: '<id>'
            );

            if ($response->any !== null) {
                // handle response
            }
    put:
      tags:
        - oauth2
        - clients
        - public
      summary: Update Client
      description: Update an OAuth2 client.
      operationId: oauth2:clients:oauth2:update_client
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
            title: Client Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuth2ClientConfigurationUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Anonymous
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2.clients
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Oauth2.Clients.Update(ctx, \"<id>\", components.OAuth2ClientConfigurationUpdate{\n        RedirectUris: []string{\n            \"https://classic-cantaloupe.org\",\n            \"https://corrupt-status.biz/\",\n        },\n        ClientName: \"<value>\",\n        ClientID: \"<id>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.oauth2.clients.update(client_id="<id>", o_auth2_client_configuration_update={
                    "redirect_uris": [
                        "https://classic-cantaloupe.org",
                        "https://corrupt-status.biz/",
                    ],
                    "client_name": "<value>",
                    "client_id": "<id>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.oauth2.clients.update({
                clientId: "<id>",
                oAuth2ClientConfigurationUpdate: {
                  redirectUris: [
                    "https://classic-cantaloupe.org",
                    "https://corrupt-status.biz/",
                  ],
                  clientName: "<value>",
                  clientId: "<id>",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;


            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $oAuth2ClientConfigurationUpdate = new
            Components\OAuth2ClientConfigurationUpdate(
                redirectUris: [
                    'https://classic-cantaloupe.org',
                    'https://corrupt-status.biz/',
                ],
                clientName: '<value>',
                clientId: '<id>',
            );


            $response = $sdk->oauth2->clients->update(
                clientId: '<id>',
                oAuth2ClientConfigurationUpdate: $oAuth2ClientConfigurationUpdate

            );


            if ($response->any !== null) {
                // handle response
            }
    delete:
      tags:
        - oauth2
        - clients
        - public
      summary: Delete Client
      description: Delete an OAuth2 client.
      operationId: oauth2:clients:oauth2:delete_client
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
            title: Client Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Anonymous
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2.clients
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Oauth2.Clients.Delete(ctx, \"<id>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.oauth2.clients.delete(client_id="<id>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.oauth2.clients.delete({
                clientId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->oauth2->clients->delete(
                clientId: '<id>'
            );

            if ($response->any !== null) {
                // handle response
            }
  /v1/oauth2/authorize:
    get:
      tags:
        - oauth2
        - public
      summary: Authorize
      operationId: oauth2:authorize
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AuthorizeResponseUser'
                  - $ref: '#/components/schemas/AuthorizeResponseOrganization'
                title: Response Oauth2:Authorize
                discriminator:
                  propertyName: sub_type
                  mapping:
                    user: '#/components/schemas/AuthorizeResponseUser'
                    organization: '#/components/schemas/AuthorizeResponseOrganization'
      x-polar-allowed-subjects:
        - Anonymous
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2
      x-speakeasy-name-override: authorize
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Oauth2.Authorize(ctx)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ResponseOauth2Authorize != nil {\n        switch res.ResponseOauth2Authorize.Type {\n            case operations.Oauth2AuthorizeResponseOauth2AuthorizeTypeUser:\n                // res.ResponseOauth2Authorize.AuthorizeResponseUser is populated\n            case operations.Oauth2AuthorizeResponseOauth2AuthorizeTypeOrganization:\n                // res.ResponseOauth2Authorize.AuthorizeResponseOrganization is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.oauth2.authorize()

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.oauth2.authorize();

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->oauth2->authorize(

            );

            if ($response->responseOauth2Authorize !== null) {
                // handle response
            }
  /v1/oauth2/token:
    post:
      tags:
        - oauth2
        - public
      summary: Request Token
      description: Request an access token using a valid grant.
      operationId: oauth2:request_token
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              oneOf:
                - $ref: '#/components/schemas/AuthorizationCodeTokenRequest'
                - $ref: '#/components/schemas/RefreshTokenRequest'
                - $ref: '#/components/schemas/WebTokenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2
      x-speakeasy-name-override: token
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.Oauth2.Token(ctx, operations.CreateOauth2RequestTokenRequestBodyAuthorizationCodeTokenRequest(\n        components.AuthorizationCodeTokenRequest{\n            ClientID: \"<id>\",\n            ClientSecret: \"<value>\",\n            Code: \"<value>\",\n            RedirectURI: \"https://memorable-season.name\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.TokenResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.oauth2.token(request={
                    "grant_type": "authorization_code",
                    "client_id": "<id>",
                    "client_secret": "<value>",
                    "code": "<value>",
                    "redirect_uri": "https://memorable-season.name",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.oauth2.token({
                grantType: "authorization_code",
                clientId: "<id>",
                clientSecret: "<value>",
                code: "<value>",
                redirectUri: "https://memorable-season.name",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\AuthorizationCodeTokenRequest(
                clientId: '<id>',
                clientSecret: '<value>',
                code: '<value>',
                redirectUri: 'https://memorable-season.name',
            );

            $response = $sdk->oauth2->token(
                request: $request
            );

            if ($response->tokenResponse !== null) {
                // handle response
            }
  /v1/oauth2/revoke:
    post:
      tags:
        - oauth2
        - public
      summary: Revoke Token
      description: Revoke an access token or a refresh token.
      operationId: oauth2:revoke_token
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RevokeTokenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeTokenResponse'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2
      x-speakeasy-name-override: revoke
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.Oauth2.Revoke(ctx, components.RevokeTokenRequest{\n        Token: \"<value>\",\n        ClientID: \"<id>\",\n        ClientSecret: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.RevokeTokenResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.oauth2.revoke(request={
                    "token": "<value>",
                    "client_id": "<id>",
                    "client_secret": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.oauth2.revoke({
                token: "<value>",
                clientId: "<id>",
                clientSecret: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\RevokeTokenRequest(
                token: '<value>',
                clientId: '<id>',
                clientSecret: '<value>',
            );

            $response = $sdk->oauth2->revoke(
                request: $request
            );

            if ($response->revokeTokenResponse !== null) {
                // handle response
            }
  /v1/oauth2/introspect:
    post:
      tags:
        - oauth2
        - public
      summary: Introspect Token
      description: Get information about an access token.
      operationId: oauth2:introspect_token
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/IntrospectTokenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntrospectTokenResponse'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2
      x-speakeasy-name-override: introspect
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.Oauth2.Introspect(ctx, components.IntrospectTokenRequest{\n        Token: \"<value>\",\n        ClientID: \"<id>\",\n        ClientSecret: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.IntrospectTokenResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.oauth2.introspect(request={
                    "token": "<value>",
                    "client_id": "<id>",
                    "client_secret": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.oauth2.introspect({
                token: "<value>",
                clientId: "<id>",
                clientSecret: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\IntrospectTokenRequest(
                token: '<value>',
                clientId: '<id>',
                clientSecret: '<value>',
            );

            $response = $sdk->oauth2->introspect(
                request: $request
            );

            if ($response->introspectTokenResponse !== null) {
                // handle response
            }
  /v1/oauth2/userinfo:
    get:
      tags:
        - oauth2
        - public
      summary: Get User Info
      description: Get information about the authenticated user.
      operationId: oauth2:userinfo
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/UserInfoUser'
                  - $ref: '#/components/schemas/UserInfoOrganization'
                title: Response Oauth2:Userinfo
      x-speakeasy-name-override: userinfo
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: oauth2
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Oauth2.Userinfo(ctx)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ResponseOauth2Userinfo != nil {\n        switch res.ResponseOauth2Userinfo.Type {\n            case operations.Oauth2UserinfoResponseOauth2UserinfoTypeUserInfoUser:\n                // res.ResponseOauth2Userinfo.UserInfoUser is populated\n            case operations.Oauth2UserinfoResponseOauth2UserinfoTypeUserInfoOrganization:\n                // res.ResponseOauth2Userinfo.UserInfoOrganization is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.oauth2.userinfo()

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.oauth2.userinfo();

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->oauth2->userinfo(

            );

            if ($response->responseOauth2Userinfo !== null) {
                // handle response
            }
  /v1/benefits/:
    get:
      tags:
        - benefits
        - public
      summary: List Benefits
      description: |-
        List benefits.

        **Scopes**: `benefits:read` `benefits:write`
      operationId: benefits:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BenefitType'
              - type: array
                items:
                  $ref: '#/components/schemas/BenefitType'
              - type: 'null'
            title: BenefitType Filter
            description: Filter by benefit type.
          description: Filter by benefit type.
          x-speakeasy-name-override: type_filter
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The benefit ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/benefits
                  resourceName: Benefit
                  displayProperty: description
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The benefit ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/benefits
                    resourceName: Benefit
                    displayProperty: description
              - type: 'null'
            title: Filter IDs
            description: Filter by benefit IDs.
          description: Filter by benefit IDs.
        - name: exclude_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The benefit ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/benefits
                  resourceName: Benefit
                  displayProperty: description
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The benefit ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/benefits
                    resourceName: Benefit
                    displayProperty: description
              - type: 'null'
            title: Exclude IDs
            description: Exclude benefits with these IDs.
          description: Exclude benefits with these IDs.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Query
            description: Filter by description.
          description: Filter by description.
        - 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/BenefitSortProperty'
              - 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:
              - '-created_at'
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_Benefit_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: benefits
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.List(ctx, operations.BenefitsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceBenefit != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.benefits.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.benefits.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\BenefitsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->benefits->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - benefits
        - public
      summary: Create Benefit
      description: |-
        Create a benefit.

        **Scopes**: `benefits:write`
      operationId: benefits:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BenefitCreate'
      responses:
        '201':
          description: Benefit created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Benefit'
                title: Benefit
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: benefits
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.Create(ctx, components.CreateBenefitCreateLicenseKeys(\n        components.BenefitLicenseKeysCreate{\n            Description: \"mature emergent at outside arrogantly gadzooks zealous equatorial notwithstanding\",\n            OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n            Properties: components.BenefitLicenseKeysCreateProperties{},\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Benefit != nil {\n        switch res.Benefit.Type {\n            case components.BenefitUnionTypeCustom:\n                // res.Benefit.BenefitCustom is populated\n            case components.BenefitUnionTypeDiscord:\n                // res.Benefit.BenefitDiscord is populated\n            case components.BenefitUnionTypeDownloadables:\n                // res.Benefit.BenefitDownloadables is populated\n            case components.BenefitUnionTypeFeatureFlag:\n                // res.Benefit.BenefitFeatureFlag is populated\n            case components.BenefitUnionTypeGithubRepository:\n                // res.Benefit.BenefitGitHubRepository is populated\n            case components.BenefitUnionTypeLicenseKeys:\n                // res.Benefit.BenefitLicenseKeys is populated\n            case components.BenefitUnionTypeMeterCredit:\n                // res.Benefit.BenefitMeterCredit is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.benefits.create(request={
                    "type": "license_keys",
                    "description": "mature emergent at outside arrogantly gadzooks zealous equatorial notwithstanding",
                    "properties": {},
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.benefits.create({
                type: "license_keys",
                description: "mature emergent at outside arrogantly gadzooks zealous equatorial notwithstanding",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                properties: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\BenefitLicenseKeysCreate(
                description: 'mature emergent at outside arrogantly gadzooks zealous equatorial notwithstanding',
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                properties: new Components\BenefitLicenseKeysCreateProperties(),
            );

            $response = $sdk->benefits->create(
                request: $request
            );

            if ($response->benefit !== null) {
                // handle response
            }
  /v1/benefits/{id}:
    get:
      tags:
        - benefits
        - public
      summary: Get Benefit
      description: |-
        Get a benefit by ID.

        **Scopes**: `benefits:read` `benefits:write`
      operationId: benefits:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit ID.
            x-polar-selector-widget:
              resourceRoot: /v1/benefits
              resourceName: Benefit
              displayProperty: description
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Benefit'
                title: Benefit
        '404':
          description: Benefit 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-mcp:
        disabled: true
      x-speakeasy-group: benefits
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Benefit != nil {\n        switch res.Benefit.Type {\n            case components.BenefitUnionTypeCustom:\n                // res.Benefit.BenefitCustom is populated\n            case components.BenefitUnionTypeDiscord:\n                // res.Benefit.BenefitDiscord is populated\n            case components.BenefitUnionTypeDownloadables:\n                // res.Benefit.BenefitDownloadables is populated\n            case components.BenefitUnionTypeFeatureFlag:\n                // res.Benefit.BenefitFeatureFlag is populated\n            case components.BenefitUnionTypeGithubRepository:\n                // res.Benefit.BenefitGitHubRepository is populated\n            case components.BenefitUnionTypeLicenseKeys:\n                // res.Benefit.BenefitLicenseKeys is populated\n            case components.BenefitUnionTypeMeterCredit:\n                // res.Benefit.BenefitMeterCredit is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.benefits.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.benefits.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->benefits->get(
                id: '<value>'
            );

            if ($response->benefit !== null) {
                // handle response
            }
    patch:
      tags:
        - benefits
        - public
      summary: Update Benefit
      description: |-
        Update a benefit.

        **Scopes**: `benefits:write`
      operationId: benefits:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit ID.
            x-polar-selector-widget:
              resourceRoot: /v1/benefits
              resourceName: Benefit
              displayProperty: description
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/BenefitCustomUpdate'
                - $ref: '#/components/schemas/BenefitDiscordUpdate'
                - $ref: '#/components/schemas/BenefitGitHubRepositoryUpdate'
                - $ref: '#/components/schemas/BenefitDownloadablesUpdate'
                - $ref: '#/components/schemas/BenefitLicenseKeysUpdate'
                - $ref: '#/components/schemas/BenefitMeterCreditUpdate'
                - $ref: '#/components/schemas/BenefitFeatureFlagUpdate'
                - $ref: '#/components/schemas/BenefitSlackSharedChannelUpdate'
              title: Benefit Update
      responses:
        '200':
          description: Benefit updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Benefit'
                title: Benefit
        '404':
          description: Benefit 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-mcp:
        disabled: true
      x-speakeasy-group: benefits
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.Update(ctx, \"<value>\", operations.CreateBenefitsUpdateBenefitUpdateBenefitCustomUpdate(\n        components.BenefitCustomUpdate{},\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Benefit != nil {\n        switch res.Benefit.Type {\n            case components.BenefitUnionTypeCustom:\n                // res.Benefit.BenefitCustom is populated\n            case components.BenefitUnionTypeDiscord:\n                // res.Benefit.BenefitDiscord is populated\n            case components.BenefitUnionTypeDownloadables:\n                // res.Benefit.BenefitDownloadables is populated\n            case components.BenefitUnionTypeFeatureFlag:\n                // res.Benefit.BenefitFeatureFlag is populated\n            case components.BenefitUnionTypeGithubRepository:\n                // res.Benefit.BenefitGitHubRepository is populated\n            case components.BenefitUnionTypeLicenseKeys:\n                // res.Benefit.BenefitLicenseKeys is populated\n            case components.BenefitUnionTypeMeterCredit:\n                // res.Benefit.BenefitMeterCredit is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.benefits.update(id="<value>", request_body={
                    "type": "feature_flag",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.benefits.update({
                id: "<value>",
                requestBody: {
                  type: "custom",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->benefits->update(
                id: '<value>',
                requestBody: new Components\BenefitCustomUpdate()

            );

            if ($response->benefit !== null) {
                // handle response
            }
    delete:
      tags:
        - benefits
        - public
      summary: Delete Benefit
      description: |-
        Delete a benefit.

        > [!WARNING]
        > Every grants associated with the benefit will be revoked.
        > Users will lose access to the benefit.

        **Scopes**: `benefits:write`
      operationId: benefits:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit ID.
            x-polar-selector-widget:
              resourceRoot: /v1/benefits
              resourceName: Benefit
              displayProperty: description
            title: Id
      responses:
        '204':
          description: Benefit deleted.
        '403':
          description: This benefit is not deletable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: Benefit 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-mcp:
        disabled: true
      x-speakeasy-group: benefits
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.benefits.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.benefits.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->benefits->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/benefits/{id}/grants:
    get:
      tags:
        - benefits
        - public
      summary: List Benefit Grants
      description: |-
        List the individual grants for a benefit.

        It's especially useful to check if a user has been granted a benefit.

        **Scopes**: `benefits:read` `benefits:write`
      operationId: benefits:grants
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit ID.
            x-polar-selector-widget:
              resourceRoot: /v1/benefits
              resourceName: Benefit
              displayProperty: description
            title: Id
        - name: is_granted
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter by granted status. If `true`, only granted benefits will be
              returned. If `false`, only revoked benefits will be returned. 
            title: Is Granted
          description: >-
            Filter by granted status. If `true`, only granted benefits will be
            returned. If `false`, only revoked benefits will be returned. 
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer.
          description: Filter by customer.
        - name: member_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: MemberID Filter
            description: Filter by member.
          description: Filter by member.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_BenefitGrant_'
        '404':
          description: Benefit 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-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-mcp:
        disabled: true
      x-speakeasy-group: benefits
      x-speakeasy-name-override: grants
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Benefits.Grants(ctx, operations.BenefitsGrantsRequest{\n        ID: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceBenefitGrant != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.benefits.grants(id="<value>", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.benefits.grants({
                id: "<value>",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\BenefitsGrantsRequest(
                id: '<value>',
            );

            $responses = $sdk->benefits->grants(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/benefit-grants/:
    get:
      tags:
        - benefit-grants
        - public
      summary: List Benefit Grants
      description: >-
        List benefit grants across all benefits accessible to the authenticated
        subject.


        **Scopes**: `benefits:read` `benefits:write`
      operationId: benefit-grants:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                description: The customer external ID.
              - type: array
                items:
                  type: string
                  description: The customer external ID.
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by customer external ID.
          description: Filter by customer external ID.
        - name: is_granted
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter by granted status. If `true`, only granted benefits will be
              returned. If `false`, only revoked benefits will be returned. 
            title: Is Granted
          description: >-
            Filter by granted status. If `true`, only granted benefits will be
            returned. If `false`, only revoked benefits will be returned. 
        - 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/BenefitGrantSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_BenefitGrant_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: benefit-grants
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.BenefitGrants.List(ctx, operations.BenefitGrantsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateBenefitGrantsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceBenefitGrant != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.benefit_grants.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.benefitGrants.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\BenefitGrantsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->benefitGrants->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/webhooks/endpoints:
    get:
      tags:
        - webhooks
        - public
      summary: List Webhook Endpoints
      description: |-
        List webhook endpoints.

        **Scopes**: `webhooks:read` `webhooks:write`
      operationId: webhooks:list_webhook_endpoints
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  description: The organization ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/organizations
                    resourceName: Organization
                    displayProperty: name
              - type: 'null'
            description: Filter by organization ID.
            title: Organization Id
          description: Filter by organization ID.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_WebhookEndpoint_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: list_webhook_endpoints
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.ListWebhookEndpoints(ctx, polargo.Pointer(operations.CreateQueryParamOrganizationIDStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )), polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceWebhookEndpoint != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.list_webhook_endpoints(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.listWebhookEndpoints({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $responses = $sdk->webhooks->listWebhookEndpoints(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - webhooks
        - public
      summary: Create Webhook Endpoint
      description: |-
        Create a webhook endpoint.

        **Scopes**: `webhooks:write`
      operationId: webhooks:create_webhook_endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEndpointCreate'
      responses:
        '201':
          description: Webhook endpoint created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: create_webhook_endpoint
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.CreateWebhookEndpoint(ctx, components.WebhookEndpointCreate{\n        URL: \"https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0\",\n        Format: components.WebhookFormatSlack,\n        Events: []components.WebhookEventType{\n            components.WebhookEventTypeSubscriptionUncanceled,\n        },\n        OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WebhookEndpoint != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.create_webhook_endpoint(request={
                    "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
                    "format_": polar_sdk.WebhookFormat.SLACK,
                    "events": [
                        polar_sdk.WebhookEventType.SUBSCRIPTION_ACTIVE,
                    ],
                    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.createWebhookEndpoint({
                url: "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
                format: "slack",
                events: [
                  "subscription.uncanceled",
                ],
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\WebhookEndpointCreate(
                url: 'https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0',
                format: Components\WebhookFormat::Slack,
                events: [
                    Components\WebhookEventType::SubscriptionUncanceled,
                ],
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $response = $sdk->webhooks->createWebhookEndpoint(
                request: $request
            );

            if ($response->webhookEndpoint !== null) {
                // handle response
            }
  /v1/webhooks/endpoints/{id}:
    get:
      tags:
        - webhooks
        - public
      summary: Get Webhook Endpoint
      description: |-
        Get a webhook endpoint by ID.

        **Scopes**: `webhooks:read` `webhooks:write`
      operationId: webhooks:get_webhook_endpoint
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The webhook endpoint ID.
            title: Id
          description: The webhook endpoint ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '404':
          description: Webhook endpoint 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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: get_webhook_endpoint
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.GetWebhookEndpoint(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WebhookEndpoint != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.get_webhook_endpoint(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.getWebhookEndpoint({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->webhooks->getWebhookEndpoint(
                id: '<value>'
            );

            if ($response->webhookEndpoint !== null) {
                // handle response
            }
    patch:
      tags:
        - webhooks
        - public
      summary: Update Webhook Endpoint
      description: |-
        Update a webhook endpoint.

        **Scopes**: `webhooks:write`
      operationId: webhooks:update_webhook_endpoint
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The webhook endpoint ID.
            title: Id
          description: The webhook endpoint ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEndpointUpdate'
      responses:
        '200':
          description: Webhook endpoint updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '404':
          description: Webhook endpoint 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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: update_webhook_endpoint
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.UpdateWebhookEndpoint(ctx, \"<value>\", components.WebhookEndpointUpdate{\n        URL: polargo.Pointer(\"https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WebhookEndpoint != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.update_webhook_endpoint(id="<value>", webhook_endpoint_update={
                    "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.updateWebhookEndpoint({
                id: "<value>",
                webhookEndpointUpdate: {
                  url: "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $webhookEndpointUpdate = new Components\WebhookEndpointUpdate(
                url: 'https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0',
            );

            $response = $sdk->webhooks->updateWebhookEndpoint(
                id: '<value>',
                webhookEndpointUpdate: $webhookEndpointUpdate

            );

            if ($response->webhookEndpoint !== null) {
                // handle response
            }
    delete:
      tags:
        - webhooks
        - public
      summary: Delete Webhook Endpoint
      description: |-
        Delete a webhook endpoint.

        **Scopes**: `webhooks:write`
      operationId: webhooks:delete_webhook_endpoint
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The webhook endpoint ID.
            title: Id
          description: The webhook endpoint ID.
      responses:
        '204':
          description: Webhook endpoint deleted.
        '404':
          description: Webhook endpoint 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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: delete_webhook_endpoint
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.DeleteWebhookEndpoint(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.webhooks.delete_webhook_endpoint(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.webhooks.deleteWebhookEndpoint({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->webhooks->deleteWebhookEndpoint(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/webhooks/endpoints/{id}/secret:
    patch:
      tags:
        - webhooks
        - public
      summary: Reset Webhook Endpoint Secret
      description: |-
        Regenerate a webhook endpoint secret.

        **Scopes**: `webhooks:write`
      operationId: webhooks:reset_webhook_endpoint_secret
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The webhook endpoint ID.
            title: Id
          description: The webhook endpoint ID.
      responses:
        '200':
          description: Webhook endpoint secret reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '404':
          description: Webhook endpoint 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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: reset_webhook_endpoint_secret
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.ResetWebhookEndpointSecret(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WebhookEndpoint != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.reset_webhook_endpoint_secret(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.resetWebhookEndpointSecret({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->webhooks->resetWebhookEndpointSecret(
                id: '<value>'
            );

            if ($response->webhookEndpoint !== null) {
                // handle response
            }
  /v1/webhooks/deliveries:
    get:
      tags:
        - webhooks
        - public
      summary: List Webhook Deliveries
      description: >-
        List webhook deliveries.


        Deliveries are all the attempts to deliver a webhook event to an
        endpoint.


        **Scopes**: `webhooks:read` `webhooks:write`
      operationId: webhooks:list_webhook_deliveries
      parameters:
        - name: endpoint_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            description: Filter by webhook endpoint ID.
            title: Endpoint Id
          description: Filter by webhook endpoint ID.
        - name: start_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter deliveries after this timestamp.
            title: Start Timestamp
          description: Filter deliveries after this timestamp.
        - name: end_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter deliveries before this timestamp.
            title: End Timestamp
          description: Filter deliveries before this timestamp.
        - name: succeeded
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter by delivery success status.
            title: Succeeded
          description: Filter by delivery success status.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Query to filter webhook deliveries.
            title: Query
          description: Query to filter webhook deliveries.
        - name: http_code_class
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - 2xx
                  - 3xx
                  - 4xx
                  - 5xx
                type: string
              - type: 'null'
            description: Filter by HTTP response code class (2xx, 3xx, 4xx, 5xx).
            title: Http Code Class
          description: Filter by HTTP response code class (2xx, 3xx, 4xx, 5xx).
        - name: event_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/WebhookEventType'
              - type: array
                items:
                  $ref: '#/components/schemas/WebhookEventType'
              - type: 'null'
            description: Filter by webhook event type.
            title: Event Type
          description: Filter by webhook event 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_WebhookDelivery_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: list_webhook_deliveries
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.ListWebhookDeliveries(ctx, operations.WebhooksListWebhookDeliveriesRequest{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceWebhookDelivery != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.list_webhook_deliveries(page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.listWebhookDeliveries({});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\WebhooksListWebhookDeliveriesRequest();

            $responses = $sdk->webhooks->listWebhookDeliveries(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/webhooks/events/{id}/redeliver:
    post:
      tags:
        - webhooks
        - public
      summary: Redeliver Webhook Event
      description: |-
        Schedule the re-delivery of a webhook event.

        **Scopes**: `webhooks:write`
      operationId: webhooks:redeliver_webhook_event
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The webhook event ID.
            title: Id
          description: The webhook event ID.
      responses:
        '202':
          description: Webhook event re-delivery scheduled.
          content:
            application/json:
              schema: {}
        '404':
          description: Webhook event 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-mcp:
        disabled: true
      x-speakeasy-group: webhooks
      x-speakeasy-name-override: redeliver_webhook_event
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Webhooks.RedeliverWebhookEvent(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.webhooks.redeliver_webhook_event(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.webhooks.redeliverWebhookEvent({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->webhooks->redeliverWebhookEvent(
                id: '<value>'
            );

            if ($response->any !== null) {
                // handle response
            }
  /v1/products/:
    get:
      tags:
        - products
        - public
        - mcp
      summary: List Products
      description: |-
        List products.

        **Scopes**: `products:read` `products:write`
      operationId: products:list
      parameters:
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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 product name.
            title: Query
          description: Filter by product name.
        - name: is_archived
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter on archived products.
            title: Is Archived
          description: Filter on archived products.
        - name: is_recurring
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter on recurring products. If `true`, only subscriptions tiers
              are returned. If `false`, only one-time purchase products are
              returned. 
            title: Is Recurring
          description: >-
            Filter on recurring products. If `true`, only subscriptions tiers
            are returned. If `false`, only one-time purchase products are
            returned. 
        - name: benefit_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The benefit ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/benefits
                  resourceName: Benefit
                  displayProperty: description
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The benefit ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/benefits
                    resourceName: Benefit
                    displayProperty: description
              - type: 'null'
            title: BenefitID Filter
            description: Filter products granting specific benefit.
          description: Filter products granting specific benefit.
        - name: visibility
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/ProductVisibility'
              - type: 'null'
            description: Filter by visibility.
            title: Visibility
          description: Filter by visibility.
        - 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/ProductSortProperty'
              - 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:
              - '-created_at'
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_Product_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - products
      x-speakeasy-group: products
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Products.List(ctx, operations.ProductsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateProductsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceProduct != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.products.list(organization_id=None, page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.products.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\ProductsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->products->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - products
        - public
        - mcp
      summary: Create Product
      description: |-
        Create a product.

        **Scopes**: `products:write`
      operationId: products:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreate'
      responses:
        '201':
          description: Product created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - products
      x-speakeasy-group: products
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Products.Create(ctx, components.CreateProductCreateProductCreateOneTime(\n        components.ProductCreateOneTime{\n            Name: \"<value>\",\n            Prices: []components.ProductCreateOneTimePrices{\n                components.CreateProductCreateOneTimePricesFixed(\n                    components.ProductPriceFixedCreate{\n                        PriceCurrency: components.PresentmentCurrencyUsd.ToPointer(),\n                        PriceAmount: 677078,\n                    },\n                ),\n                components.CreateProductCreateOneTimePricesCustom(\n                    components.ProductPriceCustomCreate{\n                        PriceCurrency: components.PresentmentCurrencyUsd.ToPointer(),\n                    },\n                ),\n            },\n            OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n            RecurringInterval: \"year\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Product != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.products.create(request={
                    "name": "<value>",
                    "prices": [
                        {
                            "amount_type": "custom",
                            "minimum_amount": 50,
                        },
                    ],
                    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.products.create({
                name: "<value>",
                prices: [
                  {
                    amountType: "fixed",
                    priceCurrency: "usd",
                    priceAmount: 677078,
                  },
                  {
                    amountType: "free",
                  },
                ],
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                recurringInterval: "year",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\ProductCreateOneTime(
                name: '<value>',
                prices: [
                    new Components\ProductPriceFixedCreate(
                        priceCurrency: Components\PresentmentCurrency::Usd,
                        priceAmount: 677078,
                    ),
                    new Components\ProductPriceCustomCreate(
                        priceCurrency: Components\PresentmentCurrency::Usd,
                    ),
                ],
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                recurringInterval: 'year',
            );

            $response = $sdk->products->create(
                request: $request
            );

            if ($response->product !== null) {
                // handle response
            }
  /v1/products/{id}:
    get:
      tags:
        - products
        - public
        - mcp
      summary: Get Product
      description: |-
        Get a product by ID.

        **Scopes**: `products:read` `products:write`
      operationId: products:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The product ID.
            x-polar-selector-widget:
              resourceRoot: /v1/products
              resourceName: Product
              displayProperty: name
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '404':
          description: Product 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-mcp:
        disabled: false
        scopes:
          - read
          - products
      x-speakeasy-group: products
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Products.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Product != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.products.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.products.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->products->get(
                id: '<value>'
            );

            if ($response->product !== null) {
                // handle response
            }
    patch:
      tags:
        - products
        - public
        - mcp
      summary: Update Product
      description: |-
        Update a product.

        **Scopes**: `products:write`
      operationId: products:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The product ID.
            x-polar-selector-widget:
              resourceRoot: /v1/products
              resourceName: Product
              displayProperty: name
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductUpdate'
      responses:
        '200':
          description: Product updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '403':
          description: You don't have the permission to update this product.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: Product 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-mcp:
        disabled: false
        scopes:
          - write
          - products
      x-speakeasy-group: products
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Products.Update(ctx, \"<value>\", components.ProductUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Product != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.products.update(id="<value>", product_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.products.update({
                id: "<value>",
                productUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $productUpdate = new Components\ProductUpdate();

            $response = $sdk->products->update(
                id: '<value>',
                productUpdate: $productUpdate

            );

            if ($response->product !== null) {
                // handle response
            }
  /v1/products/{id}/benefits:
    post:
      tags:
        - products
        - public
        - mcp
      summary: Update Product Benefits
      description: |-
        Update benefits granted by a product.

        **Scopes**: `products:write`
      operationId: products:update_benefits
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The product ID.
            x-polar-selector-widget:
              resourceRoot: /v1/products
              resourceName: Product
              displayProperty: name
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductBenefitsUpdate'
      responses:
        '200':
          description: Product benefits updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '403':
          description: You don't have the permission to update this product.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: Product 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-mcp:
        disabled: false
        scopes:
          - write
          - products
      x-speakeasy-group: products
      x-speakeasy-name-override: update_benefits
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Products.UpdateBenefits(ctx, \"<value>\", components.ProductBenefitsUpdate{\n        Benefits: []string{\n            \"<value 1>\",\n            \"<value 2>\",\n            \"<value 3>\",\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Product != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.products.update_benefits(id="<value>", product_benefits_update={
                    "benefits": [
                        "<value 1>",
                        "<value 2>",
                        "<value 3>",
                    ],
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.products.updateBenefits({
                id: "<value>",
                productBenefitsUpdate: {
                  benefits: [
                    "<value 1>",
                    "<value 2>",
                    "<value 3>",
                  ],
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $productBenefitsUpdate = new Components\ProductBenefitsUpdate(
                benefits: [
                    '<value 1>',
                    '<value 2>',
                    '<value 3>',
                ],
            );

            $response = $sdk->products->updateBenefits(
                id: '<value>',
                productBenefitsUpdate: $productBenefitsUpdate

            );

            if ($response->product !== null) {
                // handle response
            }
  /v1/orders/:
    get:
      tags:
        - orders
        - public
        - mcp
      summary: List Orders
      description: |-
        List orders.

        **Scopes**: `orders:read`
      operationId: orders:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: product_billing_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ProductBillingType'
              - type: array
                items:
                  $ref: '#/components/schemas/ProductBillingType'
              - type: 'null'
            title: ProductBillingType Filter
            description: >-
              Filter by product billing type. `recurring` will filter data
              corresponding to subscriptions creations or renewals. `one_time`
              will filter data corresponding to one-time purchases.
          description: >-
            Filter by product billing type. `recurring` will filter data
            corresponding to subscriptions creations or renewals. `one_time`
            will filter data corresponding to one-time purchases.
        - name: discount_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: DiscountID Filter
            description: Filter by discount ID.
          description: Filter by discount ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                description: The customer external ID.
              - type: array
                items:
                  type: string
                  description: The customer external ID.
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by customer external ID.
          description: Filter by customer external ID.
        - name: checkout_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: CheckoutID Filter
            description: Filter by checkout ID.
          description: Filter by checkout ID.
        - name: subscription_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The subscription ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The subscription ID.
              - type: 'null'
            title: SubscriptionID Filter
            description: Filter by subscription ID.
          description: Filter by subscription ID.
        - 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/OrderSortProperty'
              - 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:
              - '-created_at'
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_Order_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Orders.List(ctx, operations.OrdersListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateOrdersListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceOrder != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\OrdersListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->orders->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - orders
        - public
        - mcp
      summary: Create Order
      description: >-
        Create a draft order for an off-session charge against a saved payment

        method. The order is created with `status=draft` and no invoice number;

        call `POST /v1/orders/{id}/finalize` to attempt the charge.


        The organization must have the `off_session_charges_enabled` feature
        flag.


        **Scopes**: `orders:write`
      operationId: orders:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.create(request={
                    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                    "customer_id": "<value>",
                    "product_id": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.create({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                customerId: "<value>",
                productId: "<value>",
              });

              console.log(result);
            }

            run();
  /v1/orders/export:
    get:
      tags:
        - orders
        - public
        - mcp
      summary: Export Orders
      description: |-
        Export orders as a CSV file.

        **Scopes**: `orders:read`
      operationId: orders:export
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/csv:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: export
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Orders.Export(ctx, nil, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.export(organization_id=None)

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.export({
                organizationId: null,
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->orders->export(
                organizationId: null
            );

            if ($response->any !== null) {
                // handle response
            }
  /v1/orders/{id}:
    get:
      tags:
        - orders
        - public
        - mcp
      summary: Get Order
      description: |-
        Get an order by ID.

        **Scopes**: `orders:read`
      operationId: orders:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          description: Order 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-mcp:
        disabled: false
        scopes:
          - read
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Orders.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Order != nil {\n        switch res.Order.Discount.Type {\n            case components.OrderDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.Order.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.OrderDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.Order.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.OrderDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.Order.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.OrderDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.Order.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->orders->get(
                id: '<value>'
            );

            if ($response->order !== null) {
                // handle response
            }
    patch:
      tags:
        - orders
        - public
        - mcp
      summary: Update Order
      description: |-
        Update an order.

        **Scopes**: `orders:write`
      operationId: orders:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          description: Order 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-mcp:
        disabled: false
        scopes:
          - write
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Orders.Update(ctx, \"<value>\", components.OrderUpdate{\n        BillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Order != nil {\n        switch res.Order.Discount.Type {\n            case components.OrderDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.Order.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.OrderDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.Order.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.OrderDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.Order.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.OrderDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.Order.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.update(id="<value>", order_update={
                    "billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.update({
                id: "<value>",
                orderUpdate: {
                  billingAddress: {
                    country: "US",
                  },
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $orderUpdate = new Components\OrderUpdate(
                billingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
            );

            $response = $sdk->orders->update(
                id: '<value>',
                orderUpdate: $orderUpdate

            );

            if ($response->order !== null) {
                // handle response
            }
  /v1/orders/{id}/finalize:
    post:
      tags:
        - orders
        - public
        - mcp
      summary: Finalize Order
      description: >-
        Finalize a draft order and synchronously attempt an off-session charge.


        On success, the order transitions to `paid` and benefit grants fire

        before the response returns. On failure (decline, missing payment
        method,

        SCA challenge), the order stays in `draft` and a 4xx error is returned.


        The request fails with 412 if the order is not in `draft` status.


        **Scopes**: `orders:write`
      operationId: orders:finalize
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderFinalize'
              default: {}
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '402':
          description: >-
            The charge failed, or requires customer authentication (e.g. a 3DS
            challenge) that can't be completed off-session.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PaymentFailed'
                  - $ref: '#/components/schemas/PaymentActionRequired'
                title: Response 402 Orders:Finalize
        '403':
          description: >-
            Off-session charges are not enabled for this organization, or its
            account can't currently accept payments.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/OffSessionChargesNotEnabled'
                  - $ref: '#/components/schemas/OrganizationNotReadyForPayments'
                title: Response 403 Orders:Finalize
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '412':
          description: The order is not in `draft` status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderNotDraft'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: finalize
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.finalize(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.finalize({
                id: "<value>",
              });

              console.log(result);
            }

            run();
  /v1/orders/{id}/invoice:
    post:
      tags:
        - orders
        - public
        - mcp
      summary: Generate Order Invoice
      description: |-
        Trigger generation of an order's invoice.

        **Scopes**: `orders:read`
      operationId: orders:generate_invoice
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Order is not paid or is missing billing name or address.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/MissingInvoiceBillingDetails'
                  - $ref: '#/components/schemas/NotPaidOrder'
                title: Response 422 Orders:Generate Invoice
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: generate_invoice
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Orders.GenerateInvoice(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.generate_invoice(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.generateInvoice({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->orders->generateInvoice(
                id: '<value>'
            );

            if ($response->any !== null) {
                // handle response
            }
    get:
      tags:
        - orders
        - public
        - mcp
      summary: Get Order Invoice
      description: |-
        Get an order's invoice data.

        **Scopes**: `orders:read`
      operationId: orders:invoice
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderInvoice'
        '404':
          description: Order 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-mcp:
        disabled: false
        scopes:
          - read
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: invoice
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Orders.Invoice(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.OrderInvoice != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.invoice(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.invoice({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->orders->invoice(
                id: '<value>'
            );

            if ($response->orderInvoice !== null) {
                // handle response
            }
  /v1/orders/{id}/receipt:
    get:
      tags:
        - orders
        - public
        - mcp
      summary: Get Order Receipt
      description: |-
        Get a presigned URL to download an order's receipt PDF.

        **Scopes**: `orders:read`
      operationId: orders:receipt
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderReceipt'
        '202':
          description: Receipt generation in progress.
        '404':
          description: Order 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-mcp:
        disabled: false
        scopes:
          - read
          - orders
      x-speakeasy-group: orders
      x-speakeasy-name-override: receipt
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.orders.receipt(id="<value>")

                assert res is not None

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.orders.receipt({
                id: "<value>",
              });

              console.log(result);
            }

            run();
  /v1/refunds/:
    get:
      tags:
        - refunds
        - public
      summary: List Refunds
      description: |-
        List refunds.

        **Scopes**: `refunds:read` `refunds:write`
      operationId: refunds:list
      parameters:
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The refund ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The refund ID.
              - type: 'null'
            title: RefundID Filter
            description: Filter by refund ID.
          description: Filter by refund ID.
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: order_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The order ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The order ID.
              - type: 'null'
            title: OrderID Filter
            description: Filter by order ID.
          description: Filter by order ID.
        - name: subscription_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The subscription ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The subscription ID.
              - type: 'null'
            title: SubscriptionID Filter
            description: Filter by subscription ID.
          description: Filter by subscription ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                description: The customer external ID.
              - type: array
                items:
                  type: string
                  description: The customer external ID.
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by customer external ID.
          description: Filter by customer external ID.
        - name: succeeded
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: RefundStatus Filter
            description: Filter by `succeeded`.
          description: Filter by `succeeded`.
        - 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/RefundSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_Refund_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: refunds
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Refunds.List(ctx, operations.RefundsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateRefundsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceRefund != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.refunds.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.refunds.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\RefundsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->refunds->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - refunds
        - public
      summary: Create Refund
      description: |-
        Create a refund.

        **Scopes**: `refunds:write`
      operationId: refunds:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundCreate'
      responses:
        '201':
          description: Refund created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
        '403':
          description: Order is already fully refunded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundedAlready'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: refunds
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Refunds.Create(ctx, components.RefundCreate{\n        OrderID: \"<value>\",\n        Reason: components.RefundReasonCustomerRequest,\n        Amount: 90,\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Refund != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.refunds.create(request={
                    "order_id": "<value>",
                    "reason": polar_sdk.RefundReason.SERVICE_DISRUPTION,
                    "amount": 90,
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.refunds.create({
                orderId: "<value>",
                reason: "customer_request",
                amount: 90,
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\RefundCreate(
                orderId: '<value>',
                reason: Components\RefundReason::CustomerRequest,
                amount: 90,
            );

            $response = $sdk->refunds->create(
                request: $request
            );

            if ($response->refund !== null) {
                // handle response
            }
  /v1/disputes/:
    get:
      tags:
        - disputes
        - public
      summary: List Disputes
      description: |-
        List disputes.

        **Scopes**: `disputes:read`
      operationId: disputes:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: order_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The order ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The order ID.
              - type: 'null'
            title: OrderID Filter
            description: Filter by order ID.
          description: Filter by order ID.
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/DisputeStatus'
              - type: array
                items:
                  $ref: '#/components/schemas/DisputeStatus'
              - type: 'null'
            title: Status Filter
            description: Filter by dispute status.
          description: Filter by dispute status.
        - 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/DisputeSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_Dispute_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: disputes
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Disputes.List(ctx, operations.DisputesListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateDisputesListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceDispute != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.disputes.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.disputes.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\DisputesListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->disputes->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/disputes/{id}:
    get:
      tags:
        - disputes
        - public
      summary: Get Dispute
      description: |-
        Get a dispute by ID.

        **Scopes**: `disputes:read`
      operationId: disputes:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The dispute ID.
            title: Id
          description: The dispute ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dispute'
        '404':
          description: Dispute 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-mcp:
        disabled: true
      x-speakeasy-group: disputes
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Disputes.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Dispute != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.disputes.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.disputes.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->disputes->get(
                id: '<value>'
            );

            if ($response->dispute !== null) {
                // handle response
            }
  /v1/checkouts/:
    get:
      tags:
        - checkouts
        - public
      summary: List Checkout Sessions
      description: |-
        List checkout sessions.

        **Scopes**: `checkouts:read` `checkouts:write`
      operationId: checkouts:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                description: The customer external ID.
              - type: array
                items:
                  type: string
                  description: The customer external ID.
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by customer external ID.
          description: Filter by customer external ID.
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/CheckoutStatus'
              - type: array
                items:
                  $ref: '#/components/schemas/CheckoutStatus'
              - type: 'null'
            title: Status Filter
            description: Filter by checkout session status.
          description: Filter by checkout session status.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by customer email.
            title: Query
          description: Filter by customer email.
        - 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/CheckoutSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_Checkout_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Checkouts.List(ctx, operations.CheckoutsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateCheckoutsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCheckout != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkouts.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkouts.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\CheckoutsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->checkouts->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - checkouts
        - public
      summary: Create Checkout Session
      description: |-
        Create a checkout session.

        **Scopes**: `checkouts:write`
      operationId: checkouts:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutCreate'
      responses:
        '201':
          description: Checkout session created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Checkout'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Checkouts.Create(ctx, components.CheckoutCreate{\n        CustomerName: polargo.Pointer(\"John Doe\"),\n        CustomerBillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n        Locale: polargo.Pointer(\"en\"),\n        Products: []string{\n            \"<value 1>\",\n            \"<value 2>\",\n            \"<value 3>\",\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Checkout != nil {\n        switch res.Checkout.ProductPrice.Type {\n            case components.CheckoutProductPriceTypeLegacyRecurringProductPrice:\n                // res.Checkout.ProductPrice.LegacyRecurringProductPrice is populated\n            case components.CheckoutProductPriceTypeProductPrice:\n                // res.Checkout.ProductPrice.ProductPrice is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkouts.create(request={
                    "customer_name": "John Doe",
                    "customer_billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                    "locale": "en",
                    "products": [
                        "<value 1>",
                        "<value 2>",
                        "<value 3>",
                    ],
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkouts.create({
                customerName: "John Doe",
                customerBillingAddress: {
                  country: "US",
                },
                locale: "en",
                products: [
                  "<value 1>",
                  "<value 2>",
                  "<value 3>",
                ],
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\CheckoutCreate(
                customerName: 'John Doe',
                customerBillingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
                locale: 'en',
                products: [
                    '<value 1>',
                    '<value 2>',
                    '<value 3>',
                ],
            );

            $response = $sdk->checkouts->create(
                request: $request
            );

            if ($response->checkout !== null) {
                // handle response
            }
  /v1/checkouts/{id}:
    get:
      tags:
        - checkouts
        - public
      summary: Get Checkout Session
      description: |-
        Get a checkout session by ID.

        **Scopes**: `checkouts:read` `checkouts:write`
      operationId: checkouts:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The checkout session ID.
            title: Id
          description: The checkout session ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Checkout'
        '404':
          description: Checkout session 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-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Checkouts.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Checkout != nil {\n        switch res.Checkout.ProductPrice.Type {\n            case components.CheckoutProductPriceTypeLegacyRecurringProductPrice:\n                // res.Checkout.ProductPrice.LegacyRecurringProductPrice is populated\n            case components.CheckoutProductPriceTypeProductPrice:\n                // res.Checkout.ProductPrice.ProductPrice is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkouts.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkouts.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->checkouts->get(
                id: '<value>'
            );

            if ($response->checkout !== null) {
                // handle response
            }
    patch:
      tags:
        - checkouts
        - public
      summary: Update Checkout Session
      description: |-
        Update a checkout session.

        **Scopes**: `checkouts:write`
      operationId: checkouts:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The checkout session ID.
            title: Id
          description: The checkout session ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutUpdate'
      responses:
        '200':
          description: Checkout session updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Checkout'
        '403':
          description: >-
            The checkout is expired, the customer already has an active
            subscription, or the organization is not ready to accept payments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutForbiddenError'
        '404':
          description: Checkout session 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-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Checkouts.Update(ctx, \"<value>\", components.CheckoutUpdate{\n        CustomerName: polargo.Pointer(\"John Doe\"),\n        CustomerBillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n        Locale: polargo.Pointer(\"en\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Checkout != nil {\n        switch res.Checkout.ProductPrice.Type {\n            case components.CheckoutProductPriceTypeLegacyRecurringProductPrice:\n                // res.Checkout.ProductPrice.LegacyRecurringProductPrice is populated\n            case components.CheckoutProductPriceTypeProductPrice:\n                // res.Checkout.ProductPrice.ProductPrice is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkouts.update(id="<value>", checkout_update={
                    "customer_name": "John Doe",
                    "customer_billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                    "locale": "en",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkouts.update({
                id: "<value>",
                checkoutUpdate: {
                  customerName: "John Doe",
                  customerBillingAddress: {
                    country: "US",
                  },
                  locale: "en",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $checkoutUpdate = new Components\CheckoutUpdate(
                customerName: 'John Doe',
                customerBillingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
                locale: 'en',
            );

            $response = $sdk->checkouts->update(
                id: '<value>',
                checkoutUpdate: $checkoutUpdate

            );

            if ($response->checkout !== null) {
                // handle response
            }
  /v1/checkouts/client/{client_secret}:
    get:
      tags:
        - checkouts
        - public
      summary: Get Checkout Session from Client
      description: Get a checkout session by client secret.
      operationId: checkouts:client_get
      parameters:
        - name: client_secret
          in: path
          required: true
          schema:
            type: string
            description: The checkout session client secret.
            title: Client Secret
          description: The checkout session client secret.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutPublic'
        '404':
          description: Checkout session not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '410':
          description: The checkout session is expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpiredCheckoutError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: client_get
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.Checkouts.ClientGet(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CheckoutPublic != nil {\n        switch res.CheckoutPublic.ProductPrice.Type {\n            case components.CheckoutPublicProductPriceTypeLegacyRecurringProductPrice:\n                // res.CheckoutPublic.ProductPrice.LegacyRecurringProductPrice is populated\n            case components.CheckoutPublicProductPriceTypeProductPrice:\n                // res.CheckoutPublic.ProductPrice.ProductPrice is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.checkouts.client_get(client_secret="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.checkouts.clientGet({
                clientSecret: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()->build();



            $response = $sdk->checkouts->clientGet(
                clientSecret: '<value>'
            );

            if ($response->checkoutPublic !== null) {
                // handle response
            }
    patch:
      tags:
        - checkouts
        - public
      summary: Update Checkout Session from Client
      description: Update a checkout session by client secret.
      operationId: checkouts:client_update
      parameters:
        - name: client_secret
          in: path
          required: true
          schema:
            type: string
            description: The checkout session client secret.
            title: Client Secret
          description: The checkout session client secret.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutUpdatePublic'
      responses:
        '200':
          description: Checkout session updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutPublic'
        '403':
          description: >-
            The checkout is expired, the customer already has an active
            subscription, or the organization is not ready to accept payments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutForbiddenError'
        '404':
          description: Checkout session not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '410':
          description: The checkout session is expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpiredCheckoutError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: client_update
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.Checkouts.ClientUpdate(ctx, \"<value>\", components.CheckoutUpdatePublic{\n        CustomerName: polargo.Pointer(\"John Doe\"),\n        CustomerBillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n        Locale: polargo.Pointer(\"en\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CheckoutPublic != nil {\n        switch res.CheckoutPublic.ProductPrice.Type {\n            case components.CheckoutPublicProductPriceTypeLegacyRecurringProductPrice:\n                // res.CheckoutPublic.ProductPrice.LegacyRecurringProductPrice is populated\n            case components.CheckoutPublicProductPriceTypeProductPrice:\n                // res.CheckoutPublic.ProductPrice.ProductPrice is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.checkouts.client_update(client_secret="<value>", checkout_update_public={
                    "customer_name": "John Doe",
                    "customer_billing_address": None,
                    "locale": "en",
                    "allow_trial": False,
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.checkouts.clientUpdate({
                clientSecret: "<value>",
                checkoutUpdatePublic: {
                  customerName: "John Doe",
                  customerBillingAddress: {
                    country: "US",
                  },
                  locale: "en",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $checkoutUpdatePublic = new Components\CheckoutUpdatePublic(
                customerName: 'John Doe',
                customerBillingAddress: null,
                locale: 'en',
            );

            $response = $sdk->checkouts->clientUpdate(
                clientSecret: '<value>',
                checkoutUpdatePublic: $checkoutUpdatePublic

            );

            if ($response->checkoutPublic !== null) {
                // handle response
            }
  /v1/checkouts/client/{client_secret}/confirm:
    post:
      tags:
        - checkouts
        - public
      summary: Confirm Checkout Session from Client
      description: |-
        Confirm a checkout session by client secret.

        Orders and subscriptions will be processed.
      operationId: checkouts:client_confirm
      parameters:
        - name: client_secret
          in: path
          required: true
          schema:
            type: string
            description: The checkout session client secret.
            title: Client Secret
          description: The checkout session client secret.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutConfirmStripe'
      responses:
        '200':
          description: Checkout session confirmed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutPublicConfirmed'
        '400':
          description: The payment failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentError'
        '403':
          description: >-
            The checkout is expired, the customer already has an active
            subscription, or the organization is not ready to accept payments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutForbiddenError'
        '404':
          description: Checkout session not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '410':
          description: The checkout session is expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpiredCheckoutError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Anonymous
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: checkouts
      x-speakeasy-name-override: client_confirm
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Checkouts.ClientConfirm(ctx, \"<value>\", components.CheckoutConfirmStripe{\n        CustomerName: polargo.Pointer(\"John Doe\"),\n        CustomerBillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n        Locale: polargo.Pointer(\"en\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CheckoutPublicConfirmed != nil {\n        switch res.CheckoutPublicConfirmed.ProductPrice.Type {\n            case components.CheckoutPublicConfirmedProductPriceTypeLegacyRecurringProductPrice:\n                // res.CheckoutPublicConfirmed.ProductPrice.LegacyRecurringProductPrice is populated\n            case components.CheckoutPublicConfirmedProductPriceTypeProductPrice:\n                // res.CheckoutPublicConfirmed.ProductPrice.ProductPrice is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkouts.client_confirm(client_secret="<value>", checkout_confirm_stripe={
                    "customer_name": "John Doe",
                    "customer_billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                    "locale": "en",
                    "allow_trial": False,
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkouts.clientConfirm({
                clientSecret: "<value>",
                checkoutConfirmStripe: {
                  customerName: "John Doe",
                  customerBillingAddress: {
                    country: "US",
                  },
                  locale: "en",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $checkoutConfirmStripe = new Components\CheckoutConfirmStripe(
                customerName: 'John Doe',
                customerBillingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
                locale: 'en',
            );

            $response = $sdk->checkouts->clientConfirm(
                clientSecret: '<value>',
                checkoutConfirmStripe: $checkoutConfirmStripe

            );

            if ($response->checkoutPublicConfirmed !== null) {
                // handle response
            }
  /v1/files/:
    get:
      tags:
        - files
        - public
      summary: List Files
      description: |-
        List files.

        **Scopes**: `files:read` `files:write`
      operationId: files:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: ids
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: FileID Filter
            description: Filter by file ID.
          description: Filter by file ID.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_FileRead_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: files
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Files.List(ctx, polargo.Pointer(operations.CreateFilesListQueryParamOrganizationIDFilterStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )), nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceFileRead != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.files.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.files.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $responses = $sdk->files->list(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - files
        - public
      summary: Create File
      description: |-
        Create a file.

        **Scopes**: `files:write`
      operationId: files:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileCreate'
      responses:
        '201':
          description: File created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUpload'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: files
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Files.Create(ctx, components.CreateFileCreateDownloadable(\n        components.DownloadableFileCreate{\n            OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n            Name: \"<value>\",\n            MimeType: \"<value>\",\n            Size: 612128,\n            Upload: components.S3FileCreateMultipart{\n                Parts: []components.S3FileCreatePart{},\n            },\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.FileUpload != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.files.create(request={
                    "name": "<value>",
                    "mime_type": "<value>",
                    "size": 612128,
                    "upload": {
                        "parts": [],
                    },
                    "service": "downloadable",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.files.create({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                name: "<value>",
                mimeType: "<value>",
                size: 612128,
                upload: {
                  parts: [],
                },
                service: "downloadable",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\DownloadableFileCreate(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                name: '<value>',
                mimeType: '<value>',
                size: 612128,
                upload: new Components\S3FileCreateMultipart(
                    parts: [],
                ),
            );

            $response = $sdk->files->create(
                request: $request
            );

            if ($response->fileUpload !== null) {
                // handle response
            }
  /v1/files/{id}/uploaded:
    post:
      tags:
        - files
        - public
      summary: Complete File Upload
      description: |-
        Complete a file upload.

        **Scopes**: `files:write`
      operationId: files:uploaded
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The file ID.
            title: Id
          description: The file ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileUploadCompleted'
      responses:
        '200':
          description: File upload completed.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/DownloadableFileRead'
                  - $ref: '#/components/schemas/ProductMediaFileRead'
                  - $ref: '#/components/schemas/OrganizationAvatarFileRead'
                discriminator:
                  propertyName: service
                  mapping:
                    downloadable: '#/components/schemas/DownloadableFileRead'
                    product_media: '#/components/schemas/ProductMediaFileRead'
                    organization_avatar: '#/components/schemas/OrganizationAvatarFileRead'
                title: Response Files:Uploaded
        '403':
          description: You don't have the permission to update this file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: File 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-mcp:
        disabled: true
      x-speakeasy-group: files
      x-speakeasy-name-override: uploaded
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Files.Uploaded(ctx, \"<value>\", components.FileUploadCompleted{\n        ID: \"<id>\",\n        Path: \"/boot\",\n        Parts: []components.S3FileUploadCompletedPart{\n            components.S3FileUploadCompletedPart{\n                Number: 979613,\n                ChecksumEtag: \"<value>\",\n                ChecksumSha256Base64: polargo.Pointer(\"<value>\"),\n            },\n            components.S3FileUploadCompletedPart{\n                Number: 979613,\n                ChecksumEtag: \"<value>\",\n                ChecksumSha256Base64: polargo.Pointer(\"<value>\"),\n            },\n            components.S3FileUploadCompletedPart{\n                Number: 979613,\n                ChecksumEtag: \"<value>\",\n                ChecksumSha256Base64: polargo.Pointer(\"<value>\"),\n            },\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ResponseFilesUploaded != nil {\n        switch res.ResponseFilesUploaded.Type {\n            case operations.FilesUploadedResponseFilesUploadedTypeDownloadable:\n                // res.ResponseFilesUploaded.DownloadableFileRead is populated\n            case operations.FilesUploadedResponseFilesUploadedTypeProductMedia:\n                // res.ResponseFilesUploaded.ProductMediaFileRead is populated\n            case operations.FilesUploadedResponseFilesUploadedTypeOrganizationAvatar:\n                // res.ResponseFilesUploaded.OrganizationAvatarFileRead is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.files.uploaded(id="<value>", file_upload_completed={
                    "id": "<id>",
                    "path": "/boot",
                    "parts": [
                        {
                            "number": 979613,
                            "checksum_etag": "<value>",
                            "checksum_sha256_base64": "<value>",
                        },
                    ],
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.files.uploaded({
                id: "<value>",
                fileUploadCompleted: {
                  id: "<id>",
                  path: "/boot",
                  parts: [
                    {
                      number: 979613,
                      checksumEtag: "<value>",
                      checksumSha256Base64: "<value>",
                    },
                    {
                      number: 979613,
                      checksumEtag: "<value>",
                      checksumSha256Base64: "<value>",
                    },
                    {
                      number: 979613,
                      checksumEtag: "<value>",
                      checksumSha256Base64: "<value>",
                    },
                  ],
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $fileUploadCompleted = new Components\FileUploadCompleted(
                id: '<id>',
                path: '/boot',
                parts: [
                    new Components\S3FileUploadCompletedPart(
                        number: 979613,
                        checksumEtag: '<value>',
                        checksumSha256Base64: '<value>',
                    ),
                    new Components\S3FileUploadCompletedPart(
                        number: 979613,
                        checksumEtag: '<value>',
                        checksumSha256Base64: '<value>',
                    ),
                    new Components\S3FileUploadCompletedPart(
                        number: 979613,
                        checksumEtag: '<value>',
                        checksumSha256Base64: '<value>',
                    ),
                ],
            );

            $response = $sdk->files->uploaded(
                id: '<value>',
                fileUploadCompleted: $fileUploadCompleted

            );

            if ($response->responseFilesUploaded !== null) {
                // handle response
            }
  /v1/files/{id}:
    patch:
      tags:
        - files
        - public
      summary: Update File
      description: |-
        Update a file.

        **Scopes**: `files:write`
      operationId: files:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The file ID.
            title: Id
          description: The file ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilePatch'
      responses:
        '200':
          description: File updated.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/DownloadableFileRead'
                  - $ref: '#/components/schemas/ProductMediaFileRead'
                  - $ref: '#/components/schemas/OrganizationAvatarFileRead'
                discriminator:
                  propertyName: service
                  mapping:
                    downloadable: '#/components/schemas/DownloadableFileRead'
                    product_media: '#/components/schemas/ProductMediaFileRead'
                    organization_avatar: '#/components/schemas/OrganizationAvatarFileRead'
                title: Response Files:Update
        '403':
          description: You don't have the permission to update this file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: File 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-mcp:
        disabled: true
      x-speakeasy-group: files
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Files.Update(ctx, \"<value>\", components.FilePatch{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ResponseFilesUpdate != nil {\n        switch res.ResponseFilesUpdate.Type {\n            case operations.FilesUpdateResponseFilesUpdateTypeDownloadable:\n                // res.ResponseFilesUpdate.DownloadableFileRead is populated\n            case operations.FilesUpdateResponseFilesUpdateTypeProductMedia:\n                // res.ResponseFilesUpdate.ProductMediaFileRead is populated\n            case operations.FilesUpdateResponseFilesUpdateTypeOrganizationAvatar:\n                // res.ResponseFilesUpdate.OrganizationAvatarFileRead is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.files.update(id="<value>", file_patch={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.files.update({
                id: "<value>",
                filePatch: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $filePatch = new Components\FilePatch();

            $response = $sdk->files->update(
                id: '<value>',
                filePatch: $filePatch

            );

            if ($response->responseFilesUpdate !== null) {
                // handle response
            }
    delete:
      tags:
        - files
        - public
      summary: Delete File
      description: |-
        Delete a file.

        **Scopes**: `files:write`
      operationId: files:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      responses:
        '204':
          description: File deleted.
        '403':
          description: You don't have the permission to delete this file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: File 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-mcp:
        disabled: true
      x-speakeasy-group: files
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Files.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.files.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.files.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->files->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/metrics/:
    get:
      tags:
        - metrics
        - public
        - mcp
      summary: Get Metrics
      description: |-
        Get metrics about your orders and subscriptions.

        Currency values are output in cents.

        **Scopes**: `metrics:read`
      operationId: metrics:get
      parameters:
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: Start date.
            title: Start Date
          description: Start date.
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: End date.
            title: End Date
          description: End date.
        - name: timezone
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            description: Timezone to use for the timestamps. Default is UTC.
            default: UTC
            title: Timezone
          description: Timezone to use for the timestamps. Default is UTC.
        - name: interval
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/TimeInterval'
            description: Interval between two timestamps.
          description: Interval between two timestamps.
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: billing_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ProductBillingType'
              - type: array
                items:
                  $ref: '#/components/schemas/ProductBillingType'
              - type: 'null'
            title: ProductBillingType Filter
            description: >-
              Filter by billing type. `recurring` will filter data corresponding
              to subscriptions creations or renewals. `one_time` will filter
              data corresponding to one-time purchases.
          description: >-
            Filter by billing type. `recurring` will filter data corresponding
            to subscriptions creations or renewals. `one_time` will filter data
            corresponding to one-time purchases.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: metrics
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Metrics
            description: >-
              List of metric slugs to focus on. When provided, only the queries
              needed for these metrics will be executed, improving performance.
              If not provided, all metrics are returned.
          description: >-
            List of metric slugs to focus on. When provided, only the queries
            needed for these metrics will be executed, improving performance. If
            not provided, all metrics are returned.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/types\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.Get(ctx, operations.MetricsGetRequest{\n        StartDate: types.MustDateFromString(\"2025-03-14\"),\n        EndDate: types.MustDateFromString(\"2025-03-18\"),\n        Interval: components.TimeIntervalHour,\n        OrganizationID: polargo.Pointer(operations.CreateMetricsGetQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.MetricsResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from datetime import date
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.get(start_date=date.fromisoformat("2026-03-14"), end_date=date.fromisoformat("2026-03-18"), interval=polar_sdk.TimeInterval.HOUR, timezone="UTC", organization_id=None)

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";
            import { RFCDate } from "@polar-sh/sdk/types/rfcdate.js";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.get({
                startDate: new RFCDate("2025-03-14"),
                endDate: new RFCDate("2025-03-18"),
                interval: "hour",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Brick\DateTime\LocalDate;
            use Polar;
            use Polar\Models\Components;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\MetricsGetRequest(
                startDate: LocalDate::parse('2025-03-14'),
                endDate: LocalDate::parse('2025-03-18'),
                interval: Components\TimeInterval::Hour,
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $response = $sdk->metrics->get(
                request: $request
            );

            if ($response->metricsResponse !== null) {
                // handle response
            }
  /v1/metrics/export:
    get:
      tags:
        - metrics
        - public
        - mcp
      summary: Export Metrics
      description: |-
        Export metrics as a CSV file.

        **Scopes**: `metrics:read`
      operationId: metrics:export
      parameters:
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: Start date.
            title: Start Date
          description: Start date.
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: End date.
            title: End Date
          description: End date.
        - name: timezone
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            description: Timezone to use for the timestamps. Default is UTC.
            default: UTC
            title: Timezone
          description: Timezone to use for the timestamps. Default is UTC.
        - name: interval
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/TimeInterval'
            description: Interval between two timestamps.
          description: Interval between two timestamps.
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: billing_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ProductBillingType'
              - type: array
                items:
                  $ref: '#/components/schemas/ProductBillingType'
              - type: 'null'
            title: ProductBillingType Filter
            description: >-
              Filter by billing type. `recurring` will filter data corresponding
              to subscriptions creations or renewals. `one_time` will filter
              data corresponding to one-time purchases.
          description: >-
            Filter by billing type. `recurring` will filter data corresponding
            to subscriptions creations or renewals. `one_time` will filter data
            corresponding to one-time purchases.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: metrics
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Metrics
            description: >-
              List of metric slugs to include in the export. If not provided,
              all metrics are exported.
          description: >-
            List of metric slugs to include in the export. If not provided, all
            metrics are exported.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/csv:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: export
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from datetime import date
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.export(start_date=date.fromisoformat("2026-07-17"), end_date=date.fromisoformat("2024-05-06"), interval=polar_sdk.TimeInterval.YEAR, timezone="UTC", organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";
            import { RFCDate } from "@polar-sh/sdk/types/rfcdate.js";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.export({
                startDate: new RFCDate("2026-07-17"),
                endDate: new RFCDate("2024-05-06"),
                interval: "year",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
  /v1/metrics/limits:
    get:
      tags:
        - metrics
        - public
        - mcp
      summary: Get Metrics Limits
      description: |-
        Get the interval limits for the metrics endpoint.

        **Scopes**: `metrics:read`
      operationId: metrics:limits
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsLimits'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: limits
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.Limits(ctx)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.MetricsLimits != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.limits()

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.limits();

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->metrics->limits(

            );

            if ($response->metricsLimits !== null) {
                // handle response
            }
  /v1/metrics/dashboards:
    get:
      tags:
        - metrics
        - public
        - mcp
      summary: List Metric Dashboards
      description: |-
        List user-defined metric dashboards.

        **Scopes**: `metrics:read`
      operationId: metrics:list_dashboards
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricDashboardSchema'
                title: Response Metrics:List Dashboards
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: list_dashboards
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.ListDashboards(ctx, polargo.Pointer(operations.CreateMetricsListDashboardsQueryParamOrganizationIDFilterStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ResponseMetricsListDashboards != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.list_dashboards(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.listDashboards({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->metrics->listDashboards(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737'
            );

            if ($response->responseMetricsListDashboards !== null) {
                // handle response
            }
    post:
      tags:
        - metrics
        - public
        - mcp
      summary: Create Metric Dashboard
      description: |-
        Create a user-defined metric dashboard.

        **Scopes**: `metrics:write`
      operationId: metrics:create_dashboard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricDashboardCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDashboardSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: create_dashboard
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.CreateDashboard(ctx, components.MetricDashboardCreate{\n        Name: \"<value>\",\n        OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.MetricDashboardSchema != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.create_dashboard(request={
                    "name": "<value>",
                    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.createDashboard({
                name: "<value>",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\MetricDashboardCreate(
                name: '<value>',
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $response = $sdk->metrics->createDashboard(
                request: $request
            );

            if ($response->metricDashboardSchema !== null) {
                // handle response
            }
  /v1/metrics/dashboards/{id}:
    get:
      tags:
        - metrics
        - public
        - mcp
      summary: Get Metric Dashboard
      description: |-
        Get a user-defined metric dashboard by ID.

        **Scopes**: `metrics:read`
      operationId: metrics:get_dashboard
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The metric dashboard ID.
            title: Id
          description: The metric dashboard ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDashboardSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: get_dashboard
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.GetDashboard(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.MetricDashboardSchema != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.get_dashboard(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.getDashboard({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->metrics->getDashboard(
                id: '<value>'
            );

            if ($response->metricDashboardSchema !== null) {
                // handle response
            }
    patch:
      tags:
        - metrics
        - public
        - mcp
      summary: Update Metric Dashboard
      description: |-
        Update a user-defined metric dashboard.

        **Scopes**: `metrics:write`
      operationId: metrics:update_dashboard
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The metric dashboard ID.
            title: Id
          description: The metric dashboard ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricDashboardUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDashboardSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: update_dashboard
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.UpdateDashboard(ctx, \"<value>\", components.MetricDashboardUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.MetricDashboardSchema != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.metrics.update_dashboard(id="<value>", metric_dashboard_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.metrics.updateDashboard({
                id: "<value>",
                metricDashboardUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $metricDashboardUpdate = new Components\MetricDashboardUpdate();

            $response = $sdk->metrics->updateDashboard(
                id: '<value>',
                metricDashboardUpdate: $metricDashboardUpdate

            );

            if ($response->metricDashboardSchema !== null) {
                // handle response
            }
    delete:
      tags:
        - metrics
        - public
        - mcp
      summary: Delete Metric Dashboard
      description: |-
        Delete a user-defined metric dashboard.

        **Scopes**: `metrics:write`
      operationId: metrics:delete_dashboard
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The metric dashboard ID.
            title: Id
          description: The metric dashboard ID.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - metrics
      x-speakeasy-group: metrics
      x-speakeasy-name-override: delete_dashboard
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Metrics.DeleteDashboard(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.metrics.delete_dashboard(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.metrics.deleteDashboard({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->metrics->deleteDashboard(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/license-keys/:
    get:
      tags:
        - license_keys
        - public
      summary: List License Keys
      description: |-
        Get license keys connected to the given organization & filters.

        **Scopes**: `license_keys:read` `license_keys:write`
      operationId: license_keys:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: benefit_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The benefit ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/benefits
                  resourceName: Benefit
                  displayProperty: description
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The benefit ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/benefits
                    resourceName: Benefit
                    displayProperty: description
              - type: 'null'
            title: BenefitID Filter
            description: Filter by benefit ID.
          description: Filter by benefit ID.
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/LicenseKeyStatus'
              - type: array
                items:
                  $ref: '#/components/schemas/LicenseKeyStatus'
              - type: 'null'
            title: LicenseKeyStatus Filter
            description: Filter by license key status.
          description: Filter by license key status.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_LicenseKeyRead_'
        '401':
          description: Not authorized to manage license key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: License key 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-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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.List(ctx, polargo.Pointer(operations.CreateLicenseKeysListQueryParamOrganizationIDFilterStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )), nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceLicenseKeyRead != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.license_keys.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.licenseKeys.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $responses = $sdk->licenseKeys->list(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/license-keys/{id}:
    get:
      tags:
        - license_keys
        - public
      summary: Get License Key
      description: |-
        Get a license key.

        **Scopes**: `license_keys:read` `license_keys:write`
      operationId: license_keys:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyWithActivations'
        '401':
          description: Not authorized to manage license key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: License key 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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.LicenseKeyWithActivations != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.license_keys.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.licenseKeys.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->licenseKeys->get(
                id: '<value>'
            );

            if ($response->licenseKeyWithActivations !== null) {
                // handle response
            }
    patch:
      tags:
        - license_keys
        - public
      summary: Update License Key
      description: |-
        Update a license key.

        **Scopes**: `license_keys:write`
      operationId: license_keys:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyRead'
        '401':
          description: Not authorized to manage license key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: License key 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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.Update(ctx, \"<value>\", components.LicenseKeyUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.LicenseKeyRead != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.license_keys.update(id="<value>", license_key_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.licenseKeys.update({
                id: "<value>",
                licenseKeyUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $licenseKeyUpdate = new Components\LicenseKeyUpdate();

            $response = $sdk->licenseKeys->update(
                id: '<value>',
                licenseKeyUpdate: $licenseKeyUpdate

            );

            if ($response->licenseKeyRead !== null) {
                // handle response
            }
  /v1/license-keys/{id}/activations/{activation_id}:
    get:
      tags:
        - license_keys
        - public
      summary: Get Activation
      description: |-
        Get a license key activation.

        **Scopes**: `license_keys:read` `license_keys:write`
      operationId: license_keys:get_activation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
        - name: activation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Activation Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyActivationRead'
        '401':
          description: Not authorized to manage license key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: License key 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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: get_activation
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.GetActivation(ctx, \"<value>\", \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.LicenseKeyActivationRead != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.license_keys.get_activation(id="<value>", activation_id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.licenseKeys.getActivation({
                id: "<value>",
                activationId: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->licenseKeys->getActivation(
                id: '<value>',
                activationId: '<value>'

            );

            if ($response->licenseKeyActivationRead !== null) {
                // handle response
            }
  /v1/license-keys/validate:
    post:
      tags:
        - license_keys
        - public
      summary: Validate License Key
      description: |-
        Validate a license key.

        **Scopes**: `license_keys:write`
      operationId: license_keys:validate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyValidate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidatedLicenseKey'
        '404':
          description: License key 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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: validate
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.Validate(ctx, components.LicenseKeyValidate{\n        Key: \"<key>\",\n        OrganizationID: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ValidatedLicenseKey != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.license_keys.validate(request={
                    "key": "<key>",
                    "organization_id": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.licenseKeys.validate({
                key: "<key>",
                organizationId: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\LicenseKeyValidate(
                key: '<key>',
                organizationId: '<value>',
            );

            $response = $sdk->licenseKeys->validate(
                request: $request
            );

            if ($response->validatedLicenseKey !== null) {
                // handle response
            }
  /v1/license-keys/activate:
    post:
      tags:
        - license_keys
        - public
      summary: Activate License Key
      description: |-
        Activate a license key instance.

        **Scopes**: `license_keys:write`
      operationId: license_keys:activate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyActivate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyActivationRead'
        '403':
          description: >-
            License key activation not supported or limit reached. Use /validate
            endpoint for licenses without activations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: License key 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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: activate
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.Activate(ctx, components.LicenseKeyActivate{\n        Key: \"<key>\",\n        OrganizationID: \"<value>\",\n        Label: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.LicenseKeyActivationRead != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.license_keys.activate(request={
                    "key": "<key>",
                    "organization_id": "<value>",
                    "label": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.licenseKeys.activate({
                key: "<key>",
                organizationId: "<value>",
                label: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\LicenseKeyActivate(
                key: '<key>',
                organizationId: '<value>',
                label: '<value>',
            );

            $response = $sdk->licenseKeys->activate(
                request: $request
            );

            if ($response->licenseKeyActivationRead !== null) {
                // handle response
            }
  /v1/license-keys/deactivate:
    post:
      tags:
        - license_keys
        - public
      summary: Deactivate License Key
      description: |-
        Deactivate a license key instance.

        **Scopes**: `license_keys:write`
      operationId: license_keys:deactivate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyDeactivate'
        required: true
      responses:
        '204':
          description: License key activation deactivated.
        '404':
          description: License key 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-mcp:
        disabled: true
      x-speakeasy-group: license_keys
      x-speakeasy-name-override: deactivate
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.LicenseKeys.Deactivate(ctx, components.LicenseKeyDeactivate{\n        Key: \"<key>\",\n        OrganizationID: \"<value>\",\n        ActivationID: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.license_keys.deactivate(request={
                    "key": "<key>",
                    "organization_id": "<value>",
                    "activation_id": "<value>",
                })

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.licenseKeys.deactivate({
                key: "<key>",
                organizationId: "<value>",
                activationId: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\LicenseKeyDeactivate(
                key: '<key>',
                organizationId: '<value>',
                activationId: '<value>',
            );

            $response = $sdk->licenseKeys->deactivate(
                request: $request
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/checkout-links/:
    get:
      tags:
        - checkout-links
        - public
      summary: List Checkout Links
      description: |-
        List checkout links.

        **Scopes**: `checkout_links:read` `checkout_links:write`
      operationId: checkout-links:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - 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/CheckoutLinkSortProperty'
              - 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:
              - created_at
            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:
                $ref: '#/components/schemas/ListResource_CheckoutLink_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: checkout-links
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CheckoutLinks.List(ctx, operations.CheckoutLinksListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateCheckoutLinksListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCheckoutLink != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkout_links.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkoutLinks.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\CheckoutLinksListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->checkoutLinks->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - checkout-links
        - public
      summary: Create Checkout Link
      description: |-
        Create a checkout link.

        **Scopes**: `checkout_links:write`
      operationId: checkout-links:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutLinkCreate'
      responses:
        '201':
          description: Checkout link created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutLink'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: checkout-links
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CheckoutLinks.Create(ctx, components.CreateCheckoutLinkCreateCheckoutLinkCreateProductPrice(\n        components.CheckoutLinkCreateProductPrice{\n            ProductPriceID: \"<value>\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CheckoutLink != nil {\n        switch res.CheckoutLink.Discount.Type {\n            case components.CheckoutLinkDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.CheckoutLink.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.CheckoutLink.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.CheckoutLink.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.CheckoutLink.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkout_links.create(request={
                    "payment_processor": "stripe",
                    "allow_discount_codes": True,
                    "require_billing_address": False,
                    "product_price_id": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkoutLinks.create({
                paymentProcessor: "stripe",
                allowDiscountCodes: true,
                requireBillingAddress: false,
                productPriceId: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\CheckoutLinkCreateProductPrice(
                productPriceId: '<value>',
            );

            $response = $sdk->checkoutLinks->create(
                request: $request
            );

            if ($response->checkoutLink !== null) {
                // handle response
            }
  /v1/checkout-links/{id}:
    get:
      tags:
        - checkout-links
        - public
      summary: Get Checkout Link
      description: |-
        Get a checkout link by ID.

        **Scopes**: `checkout_links:read` `checkout_links:write`
      operationId: checkout-links:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The checkout link ID.
            title: Id
          description: The checkout link ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutLink'
        '404':
          description: Checkout link 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-mcp:
        disabled: true
      x-speakeasy-group: checkout-links
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CheckoutLinks.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CheckoutLink != nil {\n        switch res.CheckoutLink.Discount.Type {\n            case components.CheckoutLinkDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.CheckoutLink.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.CheckoutLink.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.CheckoutLink.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.CheckoutLink.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkout_links.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkoutLinks.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->checkoutLinks->get(
                id: '<value>'
            );

            if ($response->checkoutLink !== null) {
                // handle response
            }
    patch:
      tags:
        - checkout-links
        - public
      summary: Update Checkout Link
      description: |-
        Update a checkout link.

        **Scopes**: `checkout_links:write`
      operationId: checkout-links:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The checkout link ID.
            title: Id
          description: The checkout link ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutLinkUpdate'
      responses:
        '200':
          description: Checkout link updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutLink'
        '404':
          description: Checkout link 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-mcp:
        disabled: true
      x-speakeasy-group: checkout-links
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CheckoutLinks.Update(ctx, \"<value>\", components.CheckoutLinkUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CheckoutLink != nil {\n        switch res.CheckoutLink.Discount.Type {\n            case components.CheckoutLinkDiscountTypeDiscountFixedOnceForeverDurationBase:\n                // res.CheckoutLink.Discount.DiscountFixedOnceForeverDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountFixedRepeatDurationBase:\n                // res.CheckoutLink.Discount.DiscountFixedRepeatDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountPercentageOnceForeverDurationBase:\n                // res.CheckoutLink.Discount.DiscountPercentageOnceForeverDurationBase is populated\n            case components.CheckoutLinkDiscountTypeDiscountPercentageRepeatDurationBase:\n                // res.CheckoutLink.Discount.DiscountPercentageRepeatDurationBase is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.checkout_links.update(id="<value>", checkout_link_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.checkoutLinks.update({
                id: "<value>",
                checkoutLinkUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $checkoutLinkUpdate = new Components\CheckoutLinkUpdate();

            $response = $sdk->checkoutLinks->update(
                id: '<value>',
                checkoutLinkUpdate: $checkoutLinkUpdate

            );

            if ($response->checkoutLink !== null) {
                // handle response
            }
    delete:
      tags:
        - checkout-links
        - public
      summary: Delete Checkout Link
      description: |-
        Delete a checkout link.

        **Scopes**: `checkout_links:write`
      operationId: checkout-links:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The checkout link ID.
            title: Id
          description: The checkout link ID.
      responses:
        '204':
          description: Checkout link deleted.
        '404':
          description: Checkout link 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-mcp:
        disabled: true
      x-speakeasy-group: checkout-links
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CheckoutLinks.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.checkout_links.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.checkoutLinks.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->checkoutLinks->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/custom-fields/:
    get:
      tags:
        - custom-fields
        - public
      summary: List Custom Fields
      description: |-
        List custom fields.

        **Scopes**: `custom_fields:read` `custom_fields:write`
      operationId: custom-fields:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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.
          x-speakeasy-name-override: type_filter
        - 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:
                $ref: '#/components/schemas/ListResource_CustomField_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: custom-fields
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomFields.List(ctx, operations.CustomFieldsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateCustomFieldsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomField != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.custom_fields.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customFields.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\CustomFieldsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->customFields->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - custom-fields
        - public
      summary: Create Custom Field
      description: |-
        Create a custom field.

        **Scopes**: `custom_fields:write`
      operationId: custom-fields:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldCreate'
      responses:
        '201':
          description: Custom field created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
                title: CustomField
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: custom-fields
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomFields.Create(ctx, components.CreateCustomFieldCreateSelect(\n        components.CustomFieldCreateSelect{\n            Slug: \"<value>\",\n            Name: \"<value>\",\n            OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n            Properties: components.CustomFieldSelectProperties{\n                Options: []components.CustomFieldSelectOption{},\n            },\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomField != nil {\n        switch res.CustomField.Type {\n            case components.CustomFieldUnionTypeCheckbox:\n                // res.CustomField.CustomFieldCheckbox is populated\n            case components.CustomFieldUnionTypeDate:\n                // res.CustomField.CustomFieldDate is populated\n            case components.CustomFieldUnionTypeNumber:\n                // res.CustomField.CustomFieldNumber is populated\n            case components.CustomFieldUnionTypeSelect:\n                // res.CustomField.CustomFieldSelect is populated\n            case components.CustomFieldUnionTypeText:\n                // res.CustomField.CustomFieldText is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.custom_fields.create(request={
                    "type": "select",
                    "slug": "<value>",
                    "name": "<value>",
                    "properties": {
                        "options": [],
                    },
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customFields.create({
                type: "select",
                slug: "<value>",
                name: "<value>",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                properties: {
                  options: [],
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\CustomFieldCreateSelect(
                slug: '<value>',
                name: '<value>',
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                properties: new Components\CustomFieldSelectProperties(
                    options: [],
                ),
            );

            $response = $sdk->customFields->create(
                request: $request
            );

            if ($response->customField !== null) {
                // handle response
            }
  /v1/custom-fields/{id}:
    get:
      tags:
        - custom-fields
        - public
      summary: Get Custom Field
      description: |-
        Get a custom field by ID.

        **Scopes**: `custom_fields:read` `custom_fields:write`
      operationId: custom-fields:get
      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:
                $ref: '#/components/schemas/CustomField'
                title: CustomField
        '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-mcp:
        disabled: true
      x-speakeasy-group: custom-fields
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomFields.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomField != nil {\n        switch res.CustomField.Type {\n            case components.CustomFieldUnionTypeCheckbox:\n                // res.CustomField.CustomFieldCheckbox is populated\n            case components.CustomFieldUnionTypeDate:\n                // res.CustomField.CustomFieldDate is populated\n            case components.CustomFieldUnionTypeNumber:\n                // res.CustomField.CustomFieldNumber is populated\n            case components.CustomFieldUnionTypeSelect:\n                // res.CustomField.CustomFieldSelect is populated\n            case components.CustomFieldUnionTypeText:\n                // res.CustomField.CustomFieldText is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.custom_fields.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customFields.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customFields->get(
                id: '<value>'
            );

            if ($response->customField !== null) {
                // handle response
            }
    patch:
      tags:
        - custom-fields
        - public
      summary: Update Custom Field
      description: |-
        Update a custom field.

        **Scopes**: `custom_fields:write`
      operationId: custom-fields:update
      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/CustomFieldUpdate'
      responses:
        '200':
          description: Custom field updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
                title: CustomField
        '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-mcp:
        disabled: true
      x-speakeasy-group: custom-fields
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomFields.Update(ctx, \"<value>\", components.CreateCustomFieldUpdateDate(\n        components.CustomFieldUpdateDate{},\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomField != nil {\n        switch res.CustomField.Type {\n            case components.CustomFieldUnionTypeCheckbox:\n                // res.CustomField.CustomFieldCheckbox is populated\n            case components.CustomFieldUnionTypeDate:\n                // res.CustomField.CustomFieldDate is populated\n            case components.CustomFieldUnionTypeNumber:\n                // res.CustomField.CustomFieldNumber is populated\n            case components.CustomFieldUnionTypeSelect:\n                // res.CustomField.CustomFieldSelect is populated\n            case components.CustomFieldUnionTypeText:\n                // res.CustomField.CustomFieldText is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.custom_fields.update(id="<value>", custom_field_update={
                    "type": "date",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customFields.update({
                id: "<value>",
                customFieldUpdate: {
                  type: "date",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customFields->update(
                id: '<value>',
                customFieldUpdate: new Components\CustomFieldUpdateDate()

            );

            if ($response->customField !== null) {
                // handle response
            }
    delete:
      tags:
        - custom-fields
        - public
      summary: Delete Custom Field
      description: |-
        Delete a custom field.

        **Scopes**: `custom_fields:write`
      operationId: custom-fields:delete
      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-mcp:
        disabled: true
      x-speakeasy-group: custom-fields
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomFields.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.custom_fields.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.customFields.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customFields->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/discounts/:
    get:
      tags:
        - discounts
        - public
      summary: List Discounts
      description: |-
        List discounts.

        **Scopes**: `discounts:read` `discounts:write`
      operationId: discounts:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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 name.
            title: Query
          description: Filter by name.
        - 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/DiscountSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_Discount_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: discounts
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Discounts.List(ctx, operations.DiscountsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateDiscountsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceDiscount != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.discounts.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.discounts.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\DiscountsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->discounts->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - discounts
        - public
      summary: Create Discount
      description: |-
        Create a discount.

        **Scopes**: `discounts:write`
      operationId: discounts:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscountCreate'
      responses:
        '201':
          description: Discount created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
                title: Discount
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: discounts
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Discounts.Create(ctx, components.CreateDiscountCreateDiscountPercentageOnceForeverDurationCreate(\n        components.DiscountPercentageOnceForeverDurationCreate{\n            Duration: components.DiscountDurationOnce,\n            Type: components.DiscountTypeFixed,\n            BasisPoints: 449604,\n            Name: \"<value>\",\n            OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Discount != nil {\n        switch res.Discount.Type {\n            case components.DiscountUnionTypeDiscountFixedOnceForeverDuration:\n                // res.Discount.DiscountFixedOnceForeverDuration is populated\n            case components.DiscountUnionTypeDiscountFixedRepeatDuration:\n                // res.Discount.DiscountFixedRepeatDuration is populated\n            case components.DiscountUnionTypeDiscountPercentageOnceForeverDuration:\n                // res.Discount.DiscountPercentageOnceForeverDuration is populated\n            case components.DiscountUnionTypeDiscountPercentageRepeatDuration:\n                // res.Discount.DiscountPercentageRepeatDuration is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.discounts.create(request={
                    "name": "<value>",
                    "type": "percentage",
                    "duration": polar_sdk.DiscountDuration.ONCE,
                    "basis_points": 419733,
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.discounts.create({
                name: "<value>",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                type: "fixed",
                duration: "once",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;


            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new
            Components\DiscountPercentageOnceForeverDurationCreate(
                duration: Components\DiscountDuration::Once,
                type: Components\DiscountType::Fixed,
                basisPoints: 449604,
                name: '<value>',
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );


            $response = $sdk->discounts->create(
                request: $request
            );


            if ($response->discount !== null) {
                // handle response
            }
  /v1/discounts/{id}:
    get:
      tags:
        - discounts
        - public
      summary: Get Discount
      description: |-
        Get a discount by ID.

        **Scopes**: `discounts:read` `discounts:write`
      operationId: discounts:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The discount ID.
            title: Id
          description: The discount ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
                title: Discount
        '404':
          description: Discount 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-mcp:
        disabled: true
      x-speakeasy-group: discounts
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Discounts.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Discount != nil {\n        switch res.Discount.Type {\n            case components.DiscountUnionTypeDiscountFixedOnceForeverDuration:\n                // res.Discount.DiscountFixedOnceForeverDuration is populated\n            case components.DiscountUnionTypeDiscountFixedRepeatDuration:\n                // res.Discount.DiscountFixedRepeatDuration is populated\n            case components.DiscountUnionTypeDiscountPercentageOnceForeverDuration:\n                // res.Discount.DiscountPercentageOnceForeverDuration is populated\n            case components.DiscountUnionTypeDiscountPercentageRepeatDuration:\n                // res.Discount.DiscountPercentageRepeatDuration is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.discounts.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.discounts.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->discounts->get(
                id: '<value>'
            );

            if ($response->discount !== null) {
                // handle response
            }
    patch:
      tags:
        - discounts
        - public
      summary: Update Discount
      description: |-
        Update a discount.

        **Scopes**: `discounts:write`
      operationId: discounts:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The discount ID.
            title: Id
          description: The discount ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscountUpdate'
      responses:
        '200':
          description: Discount updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
                title: Discount
        '404':
          description: Discount 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-mcp:
        disabled: true
      x-speakeasy-group: discounts
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Discounts.Update(ctx, \"<value>\", components.DiscountUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Discount != nil {\n        switch res.Discount.Type {\n            case components.DiscountUnionTypeDiscountFixedOnceForeverDuration:\n                // res.Discount.DiscountFixedOnceForeverDuration is populated\n            case components.DiscountUnionTypeDiscountFixedRepeatDuration:\n                // res.Discount.DiscountFixedRepeatDuration is populated\n            case components.DiscountUnionTypeDiscountPercentageOnceForeverDuration:\n                // res.Discount.DiscountPercentageOnceForeverDuration is populated\n            case components.DiscountUnionTypeDiscountPercentageRepeatDuration:\n                // res.Discount.DiscountPercentageRepeatDuration is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.discounts.update(id="<value>", discount_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.discounts.update({
                id: "<value>",
                discountUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $discountUpdate = new Components\DiscountUpdate();

            $response = $sdk->discounts->update(
                id: '<value>',
                discountUpdate: $discountUpdate

            );

            if ($response->discount !== null) {
                // handle response
            }
    delete:
      tags:
        - discounts
        - public
      summary: Delete Discount
      description: |-
        Delete a discount.

        **Scopes**: `discounts:write`
      operationId: discounts:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The discount ID.
            title: Id
          description: The discount ID.
      responses:
        '204':
          description: Discount deleted.
        '404':
          description: Discount 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-mcp:
        disabled: true
      x-speakeasy-group: discounts
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Discounts.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.discounts.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.discounts.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->discounts->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customers/:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: List Customers
      description: |-
        List customers.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: email
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by exact email.
            title: Email
          description: Filter by exact email.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by name, email, or external ID.
            title: Query
          description: Filter by name, email, or external ID.
        - name: active
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter by active customers, i.e. customers with at least one
              trialing, active or past_due subscription.
            title: Active
          description: >-
            Filter by active customers, i.e. customers with at least one
            trialing, active or past_due subscription.
        - 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/CustomerSortProperty'
              - 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:
              - '-created_at'
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_Customer_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.List(ctx, operations.CustomersListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateCustomersListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomer != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\CustomersListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->customers->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - customers
        - public
        - mcp
      summary: Create Customer
      description: |-
        Create a customer.

        **Scopes**: `customers:write`
      operationId: customers:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
      responses:
        '201':
          description: Customer created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.Create(ctx, components.CreateCustomerCreateCustomerIndividualCreate(\n        components.CustomerIndividualCreate{\n            ExternalID: polargo.Pointer(\"usr_1337\"),\n            Name: polargo.Pointer(\"John Doe\"),\n            BillingAddress: &components.AddressInput{\n                Country: components.AddressInputCountryAlpha2InputUs,\n            },\n            Locale: polargo.Pointer(\"en\"),\n            OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n            Owner: &components.MemberOwnerCreate{\n                Email: \"member@example.com\",\n                Name: polargo.Pointer(\"Jane Doe\"),\n                ExternalID: polargo.Pointer(\"usr_1337\"),\n            },\n            Email: \"customer@example.com\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Customer != nil {\n        switch res.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.create(request={
                    "external_id": "usr_1337",
                    "name": "John Doe",
                    "billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                    "locale": "en",
                    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                    "owner": None,
                    "type": "team",
                    "email": "customer@example.com",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.create({
                externalId: "usr_1337",
                name: "John Doe",
                billingAddress: {
                  country: "US",
                },
                locale: "en",
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                owner: {
                  email: "member@example.com",
                  name: "Jane Doe",
                  externalId: "usr_1337",
                },
                type: "individual",
                email: "customer@example.com",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\CustomerIndividualCreate(
                externalId: 'usr_1337',
                name: 'John Doe',
                billingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
                locale: 'en',
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                owner: new Components\MemberOwnerCreate(
                    email: 'member@example.com',
                    name: 'Jane Doe',
                    externalId: 'usr_1337',
                ),
                email: 'customer@example.com',
            );

            $response = $sdk->customers->create(
                request: $request
            );

            if ($response->customer !== null) {
                // handle response
            }
  /v1/customers/export:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: Export Customers
      description: |-
        Export customers as a CSV file.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:export
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  description: The organization ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/organizations
                    resourceName: Organization
                    displayProperty: name
              - type: 'null'
            description: Filter by organization ID.
            title: Organization Id
          description: Filter by organization ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/csv:
              schema:
                type: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: export
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.Export(ctx, polargo.Pointer(operations.CreateCustomersExportQueryParamOrganizationIDStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.export(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.export({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->export(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737'
            );

            if ($response->any !== null) {
                // handle response
            }
  /v1/customers/{id}:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: Get Customer
      description: |-
        Get a customer by ID.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer ID.
            title: Id
          description: The customer ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Customer != nil {\n        switch res.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->get(
                id: '<value>'
            );

            if ($response->customer !== null) {
                // handle response
            }
    patch:
      tags:
        - customers
        - public
        - mcp
      summary: Update Customer
      description: |-
        Update a customer.

        **Scopes**: `customers:write`
      operationId: customers:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer ID.
            title: Id
          description: The customer ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdate'
      responses:
        '200':
          description: Customer updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - write
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.Update(ctx, \"<value>\", components.CustomerUpdate{\n        Email: polargo.Pointer(\"customer@example.com\"),\n        Name: polargo.Pointer(\"John Doe\"),\n        BillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n        Locale: polargo.Pointer(\"en\"),\n        ExternalID: polargo.Pointer(\"usr_1337\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Customer != nil {\n        switch res.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.update(id="<value>", customer_update={
                    "email": "customer@example.com",
                    "name": "John Doe",
                    "billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                    "locale": "en",
                    "external_id": "usr_1337",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.update({
                id: "<value>",
                customerUpdate: {
                  email: "customer@example.com",
                  name: "John Doe",
                  billingAddress: {
                    country: "US",
                  },
                  locale: "en",
                  externalId: "usr_1337",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $customerUpdate = new Components\CustomerUpdate(
                email: 'customer@example.com',
                name: 'John Doe',
                billingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
                locale: 'en',
                externalId: 'usr_1337',
            );

            $response = $sdk->customers->update(
                id: '<value>',
                customerUpdate: $customerUpdate

            );

            if ($response->customer !== null) {
                // handle response
            }
    delete:
      tags:
        - customers
        - public
        - mcp
      summary: Delete Customer
      description: >-
        Delete a customer.


        This action cannot be undone and will immediately:

        - Cancel any active subscriptions for the customer

        - Revoke all their benefits

        - Clear any `external_id`


        Use it only in the context of deleting a user within your

        own service. Otherwise, use more granular API endpoints to cancel

        a specific subscription or revoke certain benefits.


        Note: The customers information will nonetheless be retained for
        historic

        orders and subscriptions.


        Set `anonymize=true` to also anonymize PII for GDPR compliance.


        **Scopes**: `customers:write`
      operationId: customers:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer ID.
            title: Id
          description: The customer ID.
        - name: anonymize
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, also anonymize the customer's personal data for GDPR
              compliance. This replaces email with a hashed version, hashes name
              and billing name (name preserved for businesses with tax_id),
              clears billing address, and removes OAuth account data.
            default: false
            title: Anonymize
          description: >-
            If true, also anonymize the customer's personal data for GDPR
            compliance. This replaces email with a hashed version, hashes name
            and billing name (name preserved for businesses with tax_id), clears
            billing address, and removes OAuth account data.
      responses:
        '204':
          description: Customer deleted.
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - write
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.Delete(ctx, \"<value>\", polargo.Pointer(false))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.customers.delete(id="<value>", anonymize=False)

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.customers.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->delete(
                id: '<value>',
                anonymize: false

            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customers/external/{external_id}:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: Get Customer by External ID
      description: |-
        Get a customer by external ID.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:get_external
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The customer external ID.
            title: External Id
          description: The customer external ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: get_external
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.GetExternal(ctx, \"<id>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Customer != nil {\n        switch res.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.get_external(external_id="<id>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.getExternal({
                externalId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->getExternal(
                externalId: '<id>'
            );

            if ($response->customer !== null) {
                // handle response
            }
    patch:
      tags:
        - customers
        - public
        - mcp
      summary: Update Customer by External ID
      description: |-
        Update a customer by external ID.

        **Scopes**: `customers:write`
      operationId: customers:update_external
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The customer external ID.
            title: External Id
          description: The customer external ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdateExternalID'
      responses:
        '200':
          description: Customer updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - write
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: update_external
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.UpdateExternal(ctx, \"<id>\", components.CustomerUpdateExternalID{\n        Email: polargo.Pointer(\"customer@example.com\"),\n        Name: polargo.Pointer(\"John Doe\"),\n        BillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n        Locale: polargo.Pointer(\"en\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Customer != nil {\n        switch res.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.update_external(external_id="<id>", customer_update_external_id={
                    "email": "customer@example.com",
                    "name": "John Doe",
                    "billing_address": None,
                    "locale": "en",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.updateExternal({
                externalId: "<id>",
                customerUpdateExternalID: {
                  email: "customer@example.com",
                  name: "John Doe",
                  billingAddress: {
                    country: "US",
                  },
                  locale: "en",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $customerUpdateExternalID = new Components\CustomerUpdateExternalID(
                email: 'customer@example.com',
                name: 'John Doe',
                billingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
                locale: 'en',
            );

            $response = $sdk->customers->updateExternal(
                externalId: '<id>',
                customerUpdateExternalID: $customerUpdateExternalID

            );

            if ($response->customer !== null) {
                // handle response
            }
    delete:
      tags:
        - customers
        - public
        - mcp
      summary: Delete Customer by External ID
      description: >-
        Delete a customer by external ID.


        Immediately cancels any active subscriptions and revokes any active
        benefits.


        Set `anonymize=true` to also anonymize PII for GDPR compliance.


        **Scopes**: `customers:write`
      operationId: customers:delete_external
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The customer external ID.
            title: External Id
          description: The customer external ID.
        - name: anonymize
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, also anonymize the customer's personal data for GDPR
              compliance.
            default: false
            title: Anonymize
          description: >-
            If true, also anonymize the customer's personal data for GDPR
            compliance.
      responses:
        '204':
          description: Customer deleted.
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - write
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: delete_external
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.DeleteExternal(ctx, \"<id>\", polargo.Pointer(false))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.customers.delete_external(external_id="<id>", anonymize=False)

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.customers.deleteExternal({
                externalId: "<id>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->deleteExternal(
                externalId: '<id>',
                anonymize: false

            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customers/{id}/state:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: Get Customer State
      description: |-
        Get a customer state by ID.

        The customer state includes information about
        the customer's active subscriptions and benefits.

        It's the ideal endpoint to use when you need to get a full overview
        of a customer's status.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:get_state
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer ID.
            title: Id
          description: The customer ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerState'
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: get_state
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.GetState(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerState != nil {\n        switch res.CustomerState.Type {\n            case components.CustomerStateTypeIndividual:\n                // res.CustomerState.CustomerStateIndividual is populated\n            case components.CustomerStateTypeTeam:\n                // res.CustomerState.CustomerStateTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.get_state(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.getState({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->getState(
                id: '<value>'
            );

            if ($response->customerState !== null) {
                // handle response
            }
  /v1/customers/external/{external_id}/state:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: Get Customer State by External ID
      description: |-
        Get a customer state by external ID.

        The customer state includes information about
        the customer's active subscriptions and benefits.

        It's the ideal endpoint to use when you need to get a full overview
        of a customer's status.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:get_state_external
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The customer external ID.
            title: External Id
          description: The customer external ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerState'
        '404':
          description: Customer 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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: get_state_external
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Customers.GetStateExternal(ctx, \"<id>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerState != nil {\n        switch res.CustomerState.Type {\n            case components.CustomerStateTypeIndividual:\n                // res.CustomerState.CustomerStateIndividual is populated\n            case components.CustomerStateTypeTeam:\n                // res.CustomerState.CustomerStateTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.get_state_external(external_id="<id>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.getStateExternal({
                externalId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customers->getStateExternal(
                externalId: '<id>'
            );

            if ($response->customerState !== null) {
                // handle response
            }
  /v1/customers/{id}/payment-methods:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: List Customer Payment Methods
      description: |-
        Get saved payment methods of a customer.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:list_payment_methods
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer ID.
            title: Id
          description: The customer ID.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_PaymentMethod_'
        '404':
          description: Customer 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-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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: list_payment_methods
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.list_payment_methods(id="<value>", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.listPaymentMethods({
                id: "<value>",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
  /v1/customers/external/{external_id}/payment-methods:
    get:
      tags:
        - customers
        - public
        - mcp
      summary: List Customer Payment Methods by External ID
      description: |-
        Get saved payment methods of a customer by external ID.

        **Scopes**: `customers:read` `customers:write`
      operationId: customers:list_payment_methods_external
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The customer external ID.
            title: External Id
          description: The customer external ID.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_PaymentMethod_'
        '404':
          description: Customer 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-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-mcp:
        disabled: false
        scopes:
          - read
          - customers
      x-speakeasy-group: customers
      x-speakeasy-name-override: list_payment_methods_external
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customers.list_payment_methods_external(external_id="<id>", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customers.listPaymentMethodsExternal({
                externalId: "<id>",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
  /v1/members/:
    get:
      tags:
        - members
        - public
        - mcp
      summary: List Members
      description: |-
        List members with optional customer ID filter.

        **Scopes**: `members:read` `members:write`
      operationId: members:list_members
      parameters:
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by customer ID.
            title: Customer Id
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                description: The customer external ID.
              - type: 'null'
            description: Filter by customer external ID.
            title: External Customer Id
          description: Filter by customer external ID.
        - name: role
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/MemberRole'
              - type: 'null'
            description: Filter by member role.
            title: Role
          description: Filter by member role.
        - 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/MemberSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_Member_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: list_members
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Members.ListMembers(ctx, operations.MembersListMembersRequest{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceMember != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.members.list_members(page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.members.listMembers({});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\MembersListMembersRequest();

            $responses = $sdk->members->listMembers(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - members
        - public
        - mcp
      summary: Create Member
      description: >-
        Create a new member for a customer.


        Only B2B customers with the member management feature enabled can add
        members.

        The authenticated user or organization must have access to the
        customer's organization.


        **Scopes**: `members:write`
      operationId: members:create_member
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberCreate'
      responses:
        '201':
          description: Member created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
        '403':
          description: Not permitted to add members.
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - write
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: create_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Members.CreateMember(ctx, components.MemberCreate{\n        CustomerID: \"<value>\",\n        Email: \"member@example.com\",\n        Name: polargo.Pointer(\"Jane Doe\"),\n        ExternalID: polargo.Pointer(\"usr_1337\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Member != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.members.create_member(request={
                    "customer_id": "<value>",
                    "email": "member@example.com",
                    "name": "Jane Doe",
                    "external_id": "usr_1337",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.members.createMember({
                customerId: "<value>",
                email: "member@example.com",
                name: "Jane Doe",
                externalId: "usr_1337",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\MemberCreate(
                customerId: '<value>',
                email: 'member@example.com',
                name: 'Jane Doe',
                externalId: 'usr_1337',
            );

            $response = $sdk->members->createMember(
                request: $request
            );

            if ($response->member !== null) {
                // handle response
            }
  /v1/members/{id}:
    get:
      tags:
        - members
        - public
        - mcp
      summary: Get Member
      description: >-
        Get a member by ID.


        The authenticated user or organization must have access to the member's
        organization.


        **Scopes**: `members:read` `members:write`
      operationId: members:get_member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Id
      responses:
        '200':
          description: Member retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - read
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: get_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Members.GetMember(ctx, \"572bebad-ee17-4d04-a50f-6596a7d92cf3\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Member != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.members.get_member(id="572bebad-ee17-4d04-a50f-6596a7d92cf3")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.members.getMember({
                id: "572bebad-ee17-4d04-a50f-6596a7d92cf3",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->members->getMember(
                id: '572bebad-ee17-4d04-a50f-6596a7d92cf3'
            );

            if ($response->member !== null) {
                // handle response
            }
    patch:
      tags:
        - members
        - public
        - mcp
      summary: Update Member
      description: >-
        Update a member.


        Only name and role can be updated.

        The authenticated user or organization must have access to the member's
        organization.


        **Scopes**: `members:write`
      operationId: members:update_member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberUpdate'
      responses:
        '200':
          description: Member updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - write
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: update_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Members.UpdateMember(ctx, \"ab9b628a-6dbd-4f07-bcd6-163a8b5b7de4\", components.MemberUpdate{\n        Name: polargo.Pointer(\"Jane Doe\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Member != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.members.update_member(id="ab9b628a-6dbd-4f07-bcd6-163a8b5b7de4", member_update={
                    "name": "Jane Doe",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.members.updateMember({
                id: "ab9b628a-6dbd-4f07-bcd6-163a8b5b7de4",
                memberUpdate: {
                  name: "Jane Doe",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $memberUpdate = new Components\MemberUpdate(
                name: 'Jane Doe',
            );

            $response = $sdk->members->updateMember(
                id: 'ab9b628a-6dbd-4f07-bcd6-163a8b5b7de4',
                memberUpdate: $memberUpdate

            );

            if ($response->member !== null) {
                // handle response
            }
    delete:
      tags:
        - members
        - public
        - mcp
      summary: Delete Member
      description: >-
        Delete a member.


        The authenticated user or organization must have access to the member's
        organization.


        **Scopes**: `members:write`
      operationId: members:delete_member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Id
      responses:
        '204':
          description: Member deleted.
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - write
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: delete_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Members.DeleteMember(ctx, \"913247e9-8f2b-4bd1-a47e-9842d173a7cb\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.members.delete_member(id="913247e9-8f2b-4bd1-a47e-9842d173a7cb")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.members.deleteMember({
                id: "913247e9-8f2b-4bd1-a47e-9842d173a7cb",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->members->deleteMember(
                id: '913247e9-8f2b-4bd1-a47e-9842d173a7cb'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/members/external/{external_id}:
    get:
      tags:
        - members
        - public
        - mcp
      summary: Get Member by External ID
      description: >-
        Get a member by external ID. One of customer_id or external_customer_id
        must be specified.


        **Scopes**: `members:read` `members:write`
      operationId: members:get_member_by_external_id
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The member external ID.
            title: External Id
          description: The member external ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: The customer ID.
            title: Customer Id
          description: The customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The customer external ID.
            title: External Customer Id
          description: The customer external ID.
      responses:
        '200':
          description: Member retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - read
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: get_member_by_external_id
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.members.get_member_by_external_id(external_id="<id>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.members.getMemberByExternalId({
                externalId: "<id>",
              });

              console.log(result);
            }

            run();
    patch:
      tags:
        - members
        - public
        - mcp
      summary: Update Member by External ID
      description: >-
        Update a member by external ID. One of customer_id or
        external_customer_id must be specified.


        **Scopes**: `members:write`
      operationId: members:update_member_by_external_id
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The member external ID.
            title: External Id
          description: The member external ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: The customer ID.
            title: Customer Id
          description: The customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The customer external ID.
            title: External Customer Id
          description: The customer external ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberUpdate'
      responses:
        '200':
          description: Member updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - write
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: update_member_by_external_id
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.members.update_member_by_external_id(external_id="<id>", member_update={
                    "name": "Jane Doe",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.members.updateMemberByExternalId({
                externalId: "<id>",
                memberUpdate: {
                  name: "Jane Doe",
                },
              });

              console.log(result);
            }

            run();
    delete:
      tags:
        - members
        - public
        - mcp
      summary: Delete Member by External ID
      description: >-
        Delete a member by external ID. One of customer_id or
        external_customer_id must be specified.


        **Scopes**: `members:write`
      operationId: members:delete_member_by_external_id
      parameters:
        - name: external_id
          in: path
          required: true
          schema:
            type: string
            description: The member external ID.
            title: External Id
          description: The member external ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: The customer ID.
            title: Customer Id
          description: The customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The customer external ID.
            title: External Customer Id
          description: The customer external ID.
      responses:
        '204':
          description: Member deleted.
        '404':
          description: Member 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-mcp:
        disabled: false
        scopes:
          - write
          - members
      x-speakeasy-group: members
      x-speakeasy-name-override: delete_member_by_external_id
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.members.delete_member_by_external_id(external_id="<id>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.members.deleteMemberByExternalId({
                externalId: "<id>",
              });


            }

            run();
  /v1/customer-portal/benefit-grants/:
    get:
      tags:
        - customer_portal
        - benefit-grants
        - public
      summary: List Benefit Grants
      description: |-
        List benefits grants of the authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:benefit-grants:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by benefit description.
            title: Query
          description: Filter by benefit description.
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BenefitType'
              - type: array
                items:
                  $ref: '#/components/schemas/BenefitType'
              - type: 'null'
            title: BenefitType Filter
            description: Filter by benefit type.
          description: Filter by benefit type.
          x-speakeasy-name-override: type_filter
        - name: benefit_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: BenefitID Filter
            description: Filter by benefit ID.
          description: Filter by benefit ID.
        - name: checkout_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: CheckoutID Filter
            description: Filter by checkout ID.
          description: Filter by checkout ID.
        - name: order_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The order ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The order ID.
              - type: 'null'
            title: OrderID Filter
            description: Filter by order ID.
          description: Filter by order ID.
        - name: subscription_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The subscription ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The subscription ID.
              - type: 'null'
            title: SubscriptionID Filter
            description: Filter by subscription ID.
          description: Filter by subscription ID.
        - name: member_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: MemberID Filter
            description: Filter by member ID.
          description: Filter by member ID.
        - 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/CustomerBenefitGrantSortProperty'
              - 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:
              - product_benefit
              - '-granted_at'
            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:
                $ref: '#/components/schemas/ListResource_CustomerBenefitGrant_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Customer
        - Member
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.benefit-grants
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"os\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.BenefitGrants.List(ctx, operations.CustomerPortalBenefitGrantsListRequest{}, operations.CustomerPortalBenefitGrantsListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerBenefitGrant != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.benefit_grants.list(security=polar_sdk.CustomerPortalBenefitGrantsListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.benefitGrants.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Operations\CustomerPortalBenefitGrantsListRequest();

            $requestSecurity = new
            Operations\CustomerPortalBenefitGrantsListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->benefitGrants->list(
                request: $request,
                security: $requestSecurity
            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/benefit-grants/{id}:
    get:
      tags:
        - customer_portal
        - benefit-grants
        - public
      summary: Get Benefit Grant
      description: |-
        Get a benefit grant by ID for the authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:benefit-grants:get
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit grant ID.
            title: Id
          description: The benefit grant ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerBenefitGrant'
                title: CustomerBenefitGrant
        '404':
          description: Benefit grant 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:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.benefit-grants
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.BenefitGrants.Get(ctx, operations.CustomerPortalBenefitGrantsGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerBenefitGrant != nil {\n        switch res.CustomerBenefitGrant.Type {\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantDiscord:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantDiscord is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantGitHubRepository:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantGitHubRepository is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantDownloadables:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantDownloadables is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantLicenseKeys:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantLicenseKeys is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantCustom:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantCustom is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantMeterCredit:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantMeterCredit is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantFeatureFlag:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantFeatureFlag is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.benefit_grants.get(security=polar_sdk.CustomerPortalBenefitGrantsGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.benefitGrants.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalBenefitGrantsGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->benefitGrants->get(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->customerBenefitGrant !== null) {
                // handle response
            }
    patch:
      tags:
        - customer_portal
        - benefit-grants
        - public
      summary: Update Benefit Grant
      description: |-
        Update a benefit grant for the authenticated customer.

        **Scopes**: `customer_portal:write`
      operationId: customer_portal:benefit-grants:update
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The benefit grant ID.
            title: Id
          description: The benefit grant ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerBenefitGrantUpdate'
              title: CustomerBenefitGrantUpdate
      responses:
        '200':
          description: Benefit grant updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerBenefitGrant'
                title: CustomerBenefitGrant
        '403':
          description: The benefit grant is revoked and cannot be updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: Benefit grant 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:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.benefit-grants
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.BenefitGrants.Update(ctx, operations.CustomerPortalBenefitGrantsUpdateSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\", components.CreateCustomerBenefitGrantUpdateLicenseKeys(\n        components.CustomerBenefitGrantLicenseKeysUpdate{},\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerBenefitGrant != nil {\n        switch res.CustomerBenefitGrant.Type {\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantDiscord:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantDiscord is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantGitHubRepository:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantGitHubRepository is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantDownloadables:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantDownloadables is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantLicenseKeys:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantLicenseKeys is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantCustom:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantCustom is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantMeterCredit:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantMeterCredit is populated\n            case components.CustomerBenefitGrantTypeCustomerBenefitGrantFeatureFlag:\n                // res.CustomerBenefitGrant.CustomerBenefitGrantFeatureFlag is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.benefit_grants.update(security=polar_sdk.CustomerPortalBenefitGrantsUpdateSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>", customer_benefit_grant_update={
                    "benefit_type": "license_keys",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.benefitGrants.update({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
                customerBenefitGrantUpdate: {
                  benefitType: "license_keys",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalBenefitGrantsUpdateSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->benefitGrants->update(
                security: $requestSecurity,
                id: '<value>',
                customerBenefitGrantUpdate: new Components\CustomerBenefitGrantLicenseKeysUpdate()

            );


            if ($response->customerBenefitGrant !== null) {
                // handle response
            }
  /v1/customer-portal/customers/me:
    get:
      tags:
        - customer_portal
        - customers
        - public
      summary: Get Customer
      description: |-
        Get authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:customers:get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPortalCustomer'
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      x-polar-allowed-subjects:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.Get(ctx, operations.CustomerPortalCustomersGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerPortalCustomer != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.get(security=polar_sdk.CustomerPortalCustomersGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ))

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomersGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customers->get(
                security: $requestSecurity
            );


            if ($response->customerPortalCustomer !== null) {
                // handle response
            }
    patch:
      tags:
        - customer_portal
        - customers
        - public
      summary: Update Customer
      description: Update authenticated customer.
      operationId: customer_portal:customers:update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerPortalCustomerUpdate'
        required: true
      responses:
        '200':
          description: Customer updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPortalCustomer'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.Update(ctx, components.CustomerPortalCustomerUpdate{\n        BillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n    }, operations.CustomerPortalCustomersUpdateSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerPortalCustomer != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.update(security=polar_sdk.CustomerPortalCustomersUpdateSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), request={
                    "billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.update({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                billingAddress: {
                  country: "US",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Components\CustomerPortalCustomerUpdate(
                billingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
            );

            $requestSecurity = new
            Operations\CustomerPortalCustomersUpdateSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customers->update(
                request: $request,
                security: $requestSecurity
            );


            if ($response->customerPortalCustomer !== null) {
                // handle response
            }
  /v1/customer-portal/customers/me/payment-methods:
    get:
      tags:
        - customer_portal
        - customers
        - public
      summary: List Customer Payment Methods
      description: Get saved payment methods of the authenticated customer.
      operationId: customer_portal:customers:list_payment_methods
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_CustomerPaymentMethod_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: list_payment_methods
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.ListPaymentMethods(ctx, operations.CustomerPortalCustomersListPaymentMethodsSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerPaymentMethod != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.list_payment_methods(security=polar_sdk.CustomerPortalCustomersListPaymentMethodsSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.listPaymentMethods({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomersListPaymentMethodsSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->customers->listPaymentMethods(
                security: $requestSecurity,
                page: 1,
                limit: 10

            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - customer_portal
        - customers
        - public
      summary: Add Customer Payment Method
      description: Add a payment method to the authenticated customer.
      operationId: customer_portal:customers:add_payment_method
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerPaymentMethodCreate'
      responses:
        '201':
          description: Payment method created or setup initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPaymentMethodCreateResponse'
                title: CustomerPaymentMethodCreateResponse
        '400':
          description: The card was declined while setting up the payment method.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodSetupFailed'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: add_payment_method
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.AddPaymentMethod(ctx, components.CustomerPaymentMethodCreate{\n        ConfirmationTokenID: \"<id>\",\n        SetDefault: false,\n        ReturnURL: \"https://yearly-custom.net/\",\n    }, operations.CustomerPortalCustomersAddPaymentMethodSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerPaymentMethodCreateResponse != nil {\n        switch res.CustomerPaymentMethodCreateResponse.Type {\n            case components.CustomerPaymentMethodCreateResponseTypeRequiresAction:\n                // res.CustomerPaymentMethodCreateResponse.CustomerPaymentMethodCreateRequiresActionResponse is populated\n            case components.CustomerPaymentMethodCreateResponseTypeSucceeded:\n                // res.CustomerPaymentMethodCreateResponse.CustomerPaymentMethodCreateSucceededResponse is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.add_payment_method(security=polar_sdk.CustomerPortalCustomersAddPaymentMethodSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), request={
                    "confirmation_token_id": "<id>",
                    "set_default": False,
                    "return_url": "https://yearly-custom.net/",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.addPaymentMethod({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                confirmationTokenId: "<id>",
                setDefault: false,
                returnUrl: "https://yearly-custom.net/",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Components\CustomerPaymentMethodCreate(
                confirmationTokenId: '<id>',
                setDefault: false,
                returnUrl: 'https://yearly-custom.net/',
            );

            $requestSecurity = new
            Operations\CustomerPortalCustomersAddPaymentMethodSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customers->addPaymentMethod(
                request: $request,
                security: $requestSecurity
            );


            if ($response->customerPaymentMethodCreateResponse !== null) {
                // handle response
            }
  /v1/customer-portal/customers/me/payment-methods/confirm:
    post:
      tags:
        - customer_portal
        - customers
        - public
      summary: Confirm Customer Payment Method
      description: Confirm a payment method for the authenticated customer.
      operationId: customer_portal:customers:confirm_payment_method
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerPaymentMethodConfirm'
        required: true
      responses:
        '201':
          description: Payment method created or setup initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPaymentMethodCreateResponse'
                title: CustomerPaymentMethodCreateResponse
        '400':
          description: Customer is not ready to confirm a payment method.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerNotReady'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: confirm_payment_method
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.ConfirmPaymentMethod(ctx, components.CustomerPaymentMethodConfirm{\n        SetupIntentID: \"<id>\",\n        SetDefault: true,\n    }, operations.CustomerPortalCustomersConfirmPaymentMethodSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerPaymentMethodCreateResponse != nil {\n        switch res.CustomerPaymentMethodCreateResponse.Type {\n            case components.CustomerPaymentMethodCreateResponseTypeRequiresAction:\n                // res.CustomerPaymentMethodCreateResponse.CustomerPaymentMethodCreateRequiresActionResponse is populated\n            case components.CustomerPaymentMethodCreateResponseTypeSucceeded:\n                // res.CustomerPaymentMethodCreateResponse.CustomerPaymentMethodCreateSucceededResponse is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.confirm_payment_method(security=polar_sdk.CustomerPortalCustomersConfirmPaymentMethodSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), request={
                    "setup_intent_id": "<id>",
                    "set_default": True,
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.confirmPaymentMethod({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                setupIntentId: "<id>",
                setDefault: true,
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Components\CustomerPaymentMethodConfirm(
                setupIntentId: '<id>',
                setDefault: true,
            );

            $requestSecurity = new
            Operations\CustomerPortalCustomersConfirmPaymentMethodSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customers->confirmPaymentMethod(
                request: $request,
                security: $requestSecurity
            );


            if ($response->customerPaymentMethodCreateResponse !== null) {
                // handle response
            }
  /v1/customer-portal/customers/me/payment-methods/{id}:
    delete:
      tags:
        - customer_portal
        - customers
        - public
      summary: Delete Customer Payment Method
      description: Delete a payment method from the authenticated customer.
      operationId: customer_portal:customers:delete_payment_method
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      responses:
        '204':
          description: Payment method deleted.
        '400':
          description: Payment method is used by active subscription(s).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodInUseByActiveSubscription'
        '404':
          description: Payment method not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: delete_payment_method
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Customers.DeletePaymentMethod(ctx, operations.CustomerPortalCustomersDeletePaymentMethodSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<id>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                polar.customer_portal.customers.delete_payment_method(security=polar_sdk.CustomerPortalCustomersDeletePaymentMethodSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              await polar.customerPortal.customers.deletePaymentMethod({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<id>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomersDeletePaymentMethodSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customers->deletePaymentMethod(
                security: $requestSecurity,
                id: '<id>'

            );


            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customer-portal/customers/me/email-update/request:
    post:
      tags:
        - customer_portal
        - customers
        - public
      summary: Request Email Change
      description: Request an email change for the authenticated customer.
      operationId: customer_portal:customers:request_email_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerEmailUpdateRequest'
        required: true
      responses:
        '202':
          description: Verification email sent.
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: request_email_update
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.request_email_update(security=polar_sdk.CustomerPortalCustomersRequestEmailUpdateSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), request={
                    "email": "Tommie_Larkin78@gmail.com",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.requestEmailUpdate({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                email: "Tommie_Larkin78@gmail.com",
              });

              console.log(result);
            }

            run();
  /v1/customer-portal/customers/me/email-update/check:
    get:
      tags:
        - customer_portal
        - customers
        - public
      summary: Check Email Change Token
      description: Check if an email change verification token is still valid.
      operationId: customer_portal:customers:check_email_update
      parameters:
        - name: token
          in: query
          required: true
          schema:
            type: string
            title: Token
      responses:
        '204':
          description: Token is valid.
        '401':
          description: Invalid or expired verification token.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: check_email_update
      security:
        - {}
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                polar.customer_portal.customers.check_email_update(token="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              await polar.customerPortal.customers.checkEmailUpdate({
                token: "<value>",
              });


            }

            run();
  /v1/customer-portal/customers/me/email-update/verify:
    post:
      tags:
        - customer_portal
        - customers
        - public
      summary: Verify Email Change
      description: Verify an email change using the token from the verification email.
      operationId: customer_portal:customers:verify_email_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerEmailUpdateVerifyRequest'
        required: true
      responses:
        '200':
          description: Email updated successfully. Returns a new session token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerEmailUpdateVerifyResponse'
        '401':
          description: Invalid or expired verification token.
        '422':
          description: Email address is already in use.
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customers
      x-speakeasy-name-override: verify_email_update
      security:
        - {}
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customers.verify_email_update(request={
                    "token": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customers.verifyEmailUpdate({
                token: "<value>",
              });

              console.log(result);
            }

            run();
  /v1/customer-portal/meters/:
    get:
      tags:
        - customer_portal
        - customer_meters
        - public
      summary: List Meters
      description: |-
        List meters of the authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:customer_meters:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: meter_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The meter ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The meter ID.
              - type: 'null'
            title: MeterID Filter
            description: Filter by meter ID.
          description: Filter by meter ID.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by meter name.
            title: Query
          description: Filter by meter name.
        - 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/CustomerCustomerMeterSortProperty'
              - 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:
              - '-modified_at'
            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:
                $ref: '#/components/schemas/ListResource_CustomerCustomerMeter_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Customer
        - Member
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customer_meters
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"os\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.CustomerMeters.List(ctx, operations.CustomerPortalCustomerMetersListRequest{}, operations.CustomerPortalCustomerMetersListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerCustomerMeter != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customer_meters.list(security=polar_sdk.CustomerPortalCustomerMetersListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customerMeters.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Operations\CustomerPortalCustomerMetersListRequest();

            $requestSecurity = new
            Operations\CustomerPortalCustomerMetersListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->customerMeters->list(
                request: $request,
                security: $requestSecurity
            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/meters/{id}:
    get:
      tags:
        - customer_portal
        - customer_meters
        - public
      summary: Get Customer Meter
      description: |-
        Get a meter by ID for the authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:customer_meters:get
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer meter ID.
            title: Id
          description: The customer meter ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCustomerMeter'
        '404':
          description: Customer meter 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:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customer_meters
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.CustomerMeters.Get(ctx, operations.CustomerPortalCustomerMetersGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerCustomerMeter != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customer_meters.get(security=polar_sdk.CustomerPortalCustomerMetersGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customerMeters.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomerMetersGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customerMeters->get(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->customerCustomerMeter !== null) {
                // handle response
            }
  /v1/customer-portal/seats:
    get:
      tags:
        - customer_portal
        - seats
        - public
      summary: List Seats
      description: '**Scopes**: `customer_portal:read` `customer_portal:write`'
      operationId: customer_portal:seats:list_seats
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: subscription_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: 'null'
            description: Subscription ID
            title: Subscription Id
          description: Subscription ID
        - name: order_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: 'null'
            description: Order ID
            title: Order Id
          description: Order ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeatsList'
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Subscription or order not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.seats
      x-speakeasy-name-override: list_seats
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Seats.ListSeats(ctx, operations.CustomerPortalSeatsListSeatsSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, polargo.Pointer(\"<id>\"), nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.SeatsList != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.seats.list_seats(security=polar_sdk.CustomerPortalSeatsListSeatsSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ))

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.seats.listSeats({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                subscriptionId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSeatsListSeatsSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->seats->listSeats(
                security: $requestSecurity,
                subscriptionId: '<id>'

            );


            if ($response->seatsList !== null) {
                // handle response
            }
    post:
      tags:
        - customer_portal
        - seats
        - public
      summary: Assign Seat
      operationId: customer_portal:seats:assign_seat
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerSeatAssign'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeat'
        '400':
          description: No available seats or customer already has a seat
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Subscription, order, or customer not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.seats
      x-speakeasy-name-override: assign_seat
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Seats.AssignSeat(ctx, components.SeatAssign{}, operations.CustomerPortalSeatsAssignSeatSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeat != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.seats.assign_seat(security=polar_sdk.CustomerPortalSeatsAssignSeatSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), request={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.seats.assignSeat({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Components\SeatAssign();

            $requestSecurity = new
            Operations\CustomerPortalSeatsAssignSeatSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->seats->assignSeat(
                request: $request,
                security: $requestSecurity
            );


            if ($response->customerSeat !== null) {
                // handle response
            }
  /v1/customer-portal/seats/{seat_id}:
    delete:
      tags:
        - customer_portal
        - seats
        - public
      summary: Revoke Seat
      operationId: customer_portal:seats:revoke_seat
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: seat_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Seat Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeat'
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Seat not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.seats
      x-speakeasy-name-override: revoke_seat
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Seats.RevokeSeat(ctx, operations.CustomerPortalSeatsRevokeSeatSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"4b3d74b3-01ff-4aac-bd03-320535cd5ce4\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeat != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.seats.revoke_seat(security=polar_sdk.CustomerPortalSeatsRevokeSeatSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), seat_id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.seats.revokeSeat({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                seatId: "4b3d74b3-01ff-4aac-bd03-320535cd5ce4",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSeatsRevokeSeatSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->seats->revokeSeat(
                security: $requestSecurity,
                seatId: '4b3d74b3-01ff-4aac-bd03-320535cd5ce4'

            );


            if ($response->customerSeat !== null) {
                // handle response
            }
  /v1/customer-portal/seats/{seat_id}/resend:
    post:
      tags:
        - customer_portal
        - seats
        - public
      summary: Resend Invitation
      operationId: customer_portal:seats:resend_invitation
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: seat_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Seat Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeat'
        '400':
          description: Seat is not pending or already claimed
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Seat not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.seats
      x-speakeasy-name-override: resend_invitation
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Seats.ResendInvitation(ctx, operations.CustomerPortalSeatsResendInvitationSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"e3817437-8d53-4578-88d2-1dc256825965\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeat != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.seats.resend_invitation(security=polar_sdk.CustomerPortalSeatsResendInvitationSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), seat_id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.seats.resendInvitation({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                seatId: "e3817437-8d53-4578-88d2-1dc256825965",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSeatsResendInvitationSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->seats->resendInvitation(
                security: $requestSecurity,
                seatId: 'e3817437-8d53-4578-88d2-1dc256825965'

            );


            if ($response->customerSeat !== null) {
                // handle response
            }
  /v1/customer-portal/seats/subscriptions:
    get:
      tags:
        - customer_portal
        - seats
        - public
      summary: List Claimed Subscriptions
      description: >-
        List all subscriptions where the authenticated customer has claimed a
        seat.


        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:seats:list_claimed_subscriptions
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_CustomerSubscription_'
        '401':
          description: Authentication required
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Customer
        - Member
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.seats
      x-speakeasy-name-override: list_claimed_subscriptions
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Seats.ListClaimedSubscriptions(ctx, operations.CustomerPortalSeatsListClaimedSubscriptionsSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerSubscription != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.seats.list_claimed_subscriptions(security=polar_sdk.CustomerPortalSeatsListClaimedSubscriptionsSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.seats.listClaimedSubscriptions({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSeatsListClaimedSubscriptionsSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->seats->listClaimedSubscriptions(
                security: $requestSecurity,
                page: 1,
                limit: 10

            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/customer-session/introspect:
    get:
      tags:
        - customer_portal
        - customer-session
        - public
      summary: Introspect Customer Session
      description: |-
        Introspect the current session and return its information.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:customer-session:introspect
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCustomerSession'
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      x-polar-allowed-subjects:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customer-session
      x-speakeasy-name-override: introspect
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.CustomerSession.Introspect(ctx, operations.CustomerPortalCustomerSessionIntrospectSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerCustomerSession != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customer_session.introspect(security=polar_sdk.CustomerPortalCustomerSessionIntrospectSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ))

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customerSession.introspect({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomerSessionIntrospectSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->customerSession->introspect(
                security: $requestSecurity
            );


            if ($response->customerCustomerSession !== null) {
                // handle response
            }
  /v1/customer-portal/customer-session/user:
    get:
      tags:
        - customer_portal
        - customer-session
        - public
      summary: Get Authenticated Portal User
      description: |-
        Get information about the currently authenticated portal user.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:customer-session:get_authenticated_user
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalAuthenticatedUser'
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      x-polar-allowed-subjects:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.customer-session
      x-speakeasy-name-override: get_authenticated_user
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.CustomerSession.GetAuthenticatedUser(ctx, operations.CustomerPortalCustomerSessionGetAuthenticatedUserSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.PortalAuthenticatedUser != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.customer_session.get_authenticated_user(security=polar_sdk.CustomerPortalCustomerSessionGetAuthenticatedUserSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ))

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.customerSession.getAuthenticatedUser({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalCustomerSessionGetAuthenticatedUserSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response =
            $sdk->customerPortal->customerSession->getAuthenticatedUser(
                security: $requestSecurity
            );


            if ($response->portalAuthenticatedUser !== null) {
                // handle response
            }
  /v1/customer-portal/downloadables/:
    get:
      tags:
        - customer_portal
        - downloadables
        - public
      summary: List Downloadables
      description: '**Scopes**: `customer_portal:read` `customer_portal:write`'
      operationId: customer_portal:downloadables:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: benefit_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The benefit ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/benefits
                  resourceName: Benefit
                  displayProperty: description
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The benefit ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/benefits
                    resourceName: Benefit
                    displayProperty: description
              - type: 'null'
            title: BenefitID Filter
            description: Filter by benefit ID.
          description: Filter by benefit ID.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_DownloadableRead_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Customer
        - Member
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.downloadables
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Downloadables.List(ctx, operations.CustomerPortalDownloadablesListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceDownloadableRead != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.downloadables.list(security=polar_sdk.CustomerPortalDownloadablesListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.downloadables.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalDownloadablesListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->downloadables->list(
                security: $requestSecurity,
                page: 1,
                limit: 10

            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/license-keys/:
    get:
      tags:
        - customer_portal
        - license_keys
        - public
      summary: List License Keys
      description: '**Scopes**: `customer_portal:read` `customer_portal:write`'
      operationId: customer_portal:license_keys:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: benefit_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The benefit ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/benefits
                  resourceName: Benefit
                  displayProperty: description
              - type: 'null'
            description: Filter by a specific benefit
            title: Benefit Id
          description: Filter by a specific benefit
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_LicenseKeyRead_'
        '401':
          description: Not authorized to manage license key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: License key 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:
        - Customer
        - Member
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.license_keys
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.LicenseKeys.List(ctx, operations.CustomerPortalLicenseKeysListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceLicenseKeyRead != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.license_keys.list(security=polar_sdk.CustomerPortalLicenseKeysListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.licenseKeys.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalLicenseKeysListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->licenseKeys->list(
                security: $requestSecurity,
                page: 1,
                limit: 10

            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/license-keys/{id}:
    get:
      tags:
        - customer_portal
        - license_keys
        - public
      summary: Get License Key
      description: |-
        Get a license key.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:license_keys:get
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyWithActivations'
        '404':
          description: License key 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:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.license_keys
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.LicenseKeys.Get(ctx, operations.CustomerPortalLicenseKeysGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.LicenseKeyWithActivations != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.license_keys.get(security=polar_sdk.CustomerPortalLicenseKeysGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.licenseKeys.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalLicenseKeysGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->licenseKeys->get(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->licenseKeyWithActivations !== null) {
                // handle response
            }
  /v1/customer-portal/license-keys/validate:
    post:
      tags:
        - customer_portal
        - license_keys
        - public
      summary: Validate License Key
      description: >-
        Validate a license key.


        > This endpoint doesn't require authentication and can be safely used on
        a public

        > client, like a desktop application or a mobile app.

        > If you plan to validate a license key on a server, use the
        `/v1/license-keys/validate`

        > endpoint instead.
      operationId: customer_portal:license_keys:validate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyValidate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidatedLicenseKey'
        '404':
          description: License key not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.license_keys
      x-speakeasy-name-override: validate
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.LicenseKeys.Validate(ctx, components.LicenseKeyValidate{\n        Key: \"<key>\",\n        OrganizationID: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ValidatedLicenseKey != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.license_keys.validate(request={
                    "key": "<key>",
                    "organization_id": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.licenseKeys.validate({
                key: "<key>",
                organizationId: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\LicenseKeyValidate(
                key: '<key>',
                organizationId: '<value>',
            );

            $response = $sdk->customerPortal->licenseKeys->validate(
                request: $request
            );

            if ($response->validatedLicenseKey !== null) {
                // handle response
            }
  /v1/customer-portal/license-keys/activate:
    post:
      tags:
        - customer_portal
        - license_keys
        - public
      summary: Activate License Key
      description: >-
        Activate a license key instance.


        > This endpoint doesn't require authentication and can be safely used on
        a public

        > client, like a desktop application or a mobile app.

        > If you plan to validate a license key on a server, use the
        `/v1/license-keys/activate`

        > endpoint instead.
      operationId: customer_portal:license_keys:activate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyActivate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyActivationRead'
        '403':
          description: >-
            License key activation not supported or limit reached. Use /validate
            endpoint for licenses without activations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotPermitted'
        '404':
          description: License key not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.license_keys
      x-speakeasy-name-override: activate
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.LicenseKeys.Activate(ctx, components.LicenseKeyActivate{\n        Key: \"<key>\",\n        OrganizationID: \"<value>\",\n        Label: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.LicenseKeyActivationRead != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.license_keys.activate(request={
                    "key": "<key>",
                    "organization_id": "<value>",
                    "label": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.licenseKeys.activate({
                key: "<key>",
                organizationId: "<value>",
                label: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\LicenseKeyActivate(
                key: '<key>',
                organizationId: '<value>',
                label: '<value>',
            );

            $response = $sdk->customerPortal->licenseKeys->activate(
                request: $request
            );

            if ($response->licenseKeyActivationRead !== null) {
                // handle response
            }
  /v1/customer-portal/license-keys/deactivate:
    post:
      tags:
        - customer_portal
        - license_keys
        - public
      summary: Deactivate License Key
      description: >-
        Deactivate a license key instance.


        > This endpoint doesn't require authentication and can be safely used on
        a public

        > client, like a desktop application or a mobile app.

        > If you plan to validate a license key on a server, use the
        `/v1/license-keys/deactivate`

        > endpoint instead.
      operationId: customer_portal:license_keys:deactivate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseKeyDeactivate'
        required: true
      responses:
        '204':
          description: License key activation deactivated.
        '404':
          description: License key not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.license_keys
      x-speakeasy-name-override: deactivate
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.LicenseKeys.Deactivate(ctx, components.LicenseKeyDeactivate{\n        Key: \"<key>\",\n        OrganizationID: \"<value>\",\n        ActivationID: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                polar.customer_portal.license_keys.deactivate(request={
                    "key": "<key>",
                    "organization_id": "<value>",
                    "activation_id": "<value>",
                })

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              await polar.customerPortal.licenseKeys.deactivate({
                key: "<key>",
                organizationId: "<value>",
                activationId: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\LicenseKeyDeactivate(
                key: '<key>',
                organizationId: '<value>',
                activationId: '<value>',
            );

            $response = $sdk->customerPortal->licenseKeys->deactivate(
                request: $request
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customer-portal/members:
    get:
      tags:
        - customer_portal
        - members
        - public
      summary: List Members
      description: |-
        List all members of the customer's team.

        Only available to owners and billing managers of team customers.
      operationId: customer_portal:members:list_members
      parameters:
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_CustomerPortalMember_'
        '401':
          description: Authentication required
        '403':
          description: Not permitted - requires owner or billing manager role
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.members
      x-speakeasy-name-override: list_members
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerPortal.Members.ListMembers(ctx, polargo.Pointer[int64](1), polargo.Pointer[int64](10))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerPortalMember != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_portal.members.list_members(page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerPortal.members.listMembers({});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $responses = $sdk->customerPortal->members->listMembers(
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - customer_portal
        - members
        - public
      summary: Add Member
      description: >-
        Add a new member to the customer's team.


        Only available to owners and billing managers of team customers.


        Rules:

        - Cannot add a member with the owner role (there must be exactly one
        owner)

        - If a member with this email already exists, the existing member is
        returned
      operationId: customer_portal:members:add_member
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerPortalMemberCreate'
      responses:
        '201':
          description: Member added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPortalMember'
        '400':
          description: Invalid request or member already exists.
        '401':
          description: Authentication required
        '403':
          description: Not permitted - requires owner or billing manager role
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.members
      x-speakeasy-name-override: add_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerPortal.Members.AddMember(ctx, components.CustomerPortalMemberCreate{\n        Email: \"Domenica.Schamberger@yahoo.com\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerPortalMember != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_portal.members.add_member(request={
                    "email": "Domenica.Schamberger@yahoo.com",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerPortal.members.addMember({
                email: "Domenica.Schamberger@yahoo.com",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\CustomerPortalMemberCreate(
                email: 'Domenica.Schamberger@yahoo.com',
            );

            $response = $sdk->customerPortal->members->addMember(
                request: $request
            );

            if ($response->customerPortalMember !== null) {
                // handle response
            }
  /v1/customer-portal/members/{id}:
    patch:
      tags:
        - customer_portal
        - members
        - public
      summary: Update Member
      description: |-
        Update a member's role.

        Only available to owners and billing managers of team customers.

        Rules:
        - Cannot modify your own role (to prevent self-demotion)
        - Customer must have exactly one owner at all times
      operationId: customer_portal:members:update_member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerPortalMemberUpdate'
      responses:
        '200':
          description: Member updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPortalMember'
        '400':
          description: Invalid role change.
        '401':
          description: Authentication required
        '403':
          description: Not permitted - requires owner or billing manager role
        '404':
          description: Member not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.members
      x-speakeasy-name-override: update_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerPortal.Members.UpdateMember(ctx, \"8319ae11-ed5f-4642-81e4-4b40731df195\", components.CustomerPortalMemberUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerPortalMember != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_portal.members.update_member(id="8319ae11-ed5f-4642-81e4-4b40731df195", customer_portal_member_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerPortal.members.updateMember({
                id: "8319ae11-ed5f-4642-81e4-4b40731df195",
                customerPortalMemberUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;


            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $customerPortalMemberUpdate = new
            Components\CustomerPortalMemberUpdate();


            $response = $sdk->customerPortal->members->updateMember(
                id: '8319ae11-ed5f-4642-81e4-4b40731df195',
                customerPortalMemberUpdate: $customerPortalMemberUpdate

            );


            if ($response->customerPortalMember !== null) {
                // handle response
            }
    delete:
      tags:
        - customer_portal
        - members
        - public
      summary: Remove Member
      description: |-
        Remove a member from the team.

        Only available to owners and billing managers of team customers.

        Rules:
        - Cannot remove yourself
        - Cannot remove the only owner
      operationId: customer_portal:members:remove_member
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Id
      responses:
        '204':
          description: Member removed.
        '400':
          description: Cannot remove the only owner.
        '401':
          description: Authentication required
        '403':
          description: Not permitted - requires owner or billing manager role
        '404':
          description: Member not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.members
      x-speakeasy-name-override: remove_member
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerPortal.Members.RemoveMember(ctx, \"b61c5e87-cda5-4b14-93ee-71a695f42d9d\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.customer_portal.members.remove_member(id="b61c5e87-cda5-4b14-93ee-71a695f42d9d")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.customerPortal.members.removeMember({
                id: "b61c5e87-cda5-4b14-93ee-71a695f42d9d",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customerPortal->members->removeMember(
                id: 'b61c5e87-cda5-4b14-93ee-71a695f42d9d'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customer-portal/orders/:
    get:
      tags:
        - customer_portal
        - orders
        - public
      summary: List Orders
      description: List orders of the authenticated customer.
      operationId: customer_portal:orders:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: product_billing_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ProductBillingType'
              - type: array
                items:
                  $ref: '#/components/schemas/ProductBillingType'
              - type: 'null'
            title: ProductBillingType Filter
            description: >-
              Filter by product billing type. `recurring` will filter data
              corresponding to subscriptions creations or renewals. `one_time`
              will filter data corresponding to one-time purchases.
          description: >-
            Filter by product billing type. `recurring` will filter data
            corresponding to subscriptions creations or renewals. `one_time`
            will filter data corresponding to one-time purchases.
        - name: subscription_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The subscription ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The subscription ID.
              - type: 'null'
            title: SubscriptionID Filter
            description: Filter by subscription ID.
          description: Filter by subscription ID.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search by product or organization name.
            title: Query
          description: Search by product or organization name.
        - 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/CustomerOrderSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_CustomerOrder_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"os\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.List(ctx, operations.CustomerPortalOrdersListRequest{}, operations.CustomerPortalOrdersListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerOrder != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.list(security=polar_sdk.CustomerPortalOrdersListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()->build();

            $request = new Operations\CustomerPortalOrdersListRequest();
            $requestSecurity = new Operations\CustomerPortalOrdersListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );

            $responses = $sdk->customerPortal->orders->list(
                request: $request,
                security: $requestSecurity
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/orders/{id}:
    get:
      tags:
        - customer_portal
        - orders
        - public
      summary: Get Order
      description: Get an order by ID for the authenticated customer.
      operationId: customer_portal:orders:get
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrder'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.Get(ctx, operations.CustomerPortalOrdersGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerOrder != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.get(security=polar_sdk.CustomerPortalOrdersGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()->build();


            $requestSecurity = new Operations\CustomerPortalOrdersGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );

            $response = $sdk->customerPortal->orders->get(
                security: $requestSecurity,
                id: '<value>'

            );

            if ($response->customerOrder !== null) {
                // handle response
            }
    patch:
      tags:
        - customer_portal
        - orders
        - public
      summary: Update Order
      description: Update an order for the authenticated customer.
      operationId: customer_portal:orders:update
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerOrderUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrder'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.Update(ctx, operations.CustomerPortalOrdersUpdateSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\", components.CustomerOrderUpdate{\n        BillingAddress: &components.AddressInput{\n            Country: components.AddressInputCountryAlpha2InputUs,\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerOrder != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.update(security=polar_sdk.CustomerPortalOrdersUpdateSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>", customer_order_update={
                    "billing_address": {
                        "country": polar_sdk.AddressInputCountryAlpha2Input.US,
                    },
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.update({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
                customerOrderUpdate: {
                  billingAddress: {
                    country: "US",
                  },
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $customerOrderUpdate = new Components\CustomerOrderUpdate(
                billingAddress: new Components\AddressInput(
                    country: Components\AddressInputCountryAlpha2Input::Us,
                ),
            );

            $requestSecurity = new
            Operations\CustomerPortalOrdersUpdateSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->orders->update(
                security: $requestSecurity,
                id: '<value>',
                customerOrderUpdate: $customerOrderUpdate

            );


            if ($response->customerOrder !== null) {
                // handle response
            }
  /v1/customer-portal/orders/{id}/invoice:
    post:
      tags:
        - customer_portal
        - orders
        - public
      summary: Generate Order Invoice
      description: Trigger generation of an order's invoice.
      operationId: customer_portal:orders:generate_invoice
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Order is not paid or is missing billing name or address.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/MissingInvoiceBillingDetails'
                  - $ref: '#/components/schemas/NotPaidOrder'
                title: Response 422 Customer Portal:Orders:Generate Invoice
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: generate_invoice
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.GenerateInvoice(ctx, operations.CustomerPortalOrdersGenerateInvoiceSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Any != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.generate_invoice(security=polar_sdk.CustomerPortalOrdersGenerateInvoiceSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.generateInvoice({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalOrdersGenerateInvoiceSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->orders->generateInvoice(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->any !== null) {
                // handle response
            }
    get:
      tags:
        - customer_portal
        - orders
        - public
      summary: Get Order Invoice
      description: Get an order's invoice data.
      operationId: customer_portal:orders:invoice
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrderInvoice'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: invoice
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.Invoice(ctx, operations.CustomerPortalOrdersInvoiceSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerOrderInvoice != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.invoice(security=polar_sdk.CustomerPortalOrdersInvoiceSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.invoice({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalOrdersInvoiceSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->orders->invoice(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->customerOrderInvoice !== null) {
                // handle response
            }
  /v1/customer-portal/orders/{id}/receipt:
    get:
      tags:
        - customer_portal
        - orders
        - public
      summary: Get Order Receipt
      description: Get a presigned URL to download an order's receipt PDF.
      operationId: customer_portal:orders:receipt
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrderReceipt'
        '202':
          description: Receipt generation in progress.
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: receipt
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.receipt(security=polar_sdk.CustomerPortalOrdersReceiptSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                assert res is not None

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.receipt({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
  /v1/customer-portal/orders/{id}/payment-status:
    get:
      tags:
        - customer_portal
        - orders
        - public
      summary: Get Order Payment Status
      description: Get the current payment status for an order.
      operationId: customer_portal:orders:get_payment_status
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrderPaymentStatus'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: get_payment_status
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.GetPaymentStatus(ctx, operations.CustomerPortalOrdersGetPaymentStatusSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerOrderPaymentStatus != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.get_payment_status(security=polar_sdk.CustomerPortalOrdersGetPaymentStatusSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.getPaymentStatus({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalOrdersGetPaymentStatusSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->orders->getPaymentStatus(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->customerOrderPaymentStatus !== null) {
                // handle response
            }
  /v1/customer-portal/orders/{id}/confirm-payment:
    post:
      tags:
        - customer_portal
        - orders
        - public
      summary: Confirm Retry Payment
      description: Confirm a retry payment using a Stripe confirmation token.
      operationId: customer_portal:orders:confirm_retry_payment
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The order ID.
            title: Id
          description: The order ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerOrderConfirmPayment'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrderPaymentConfirmation'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '409':
          description: Payment already in progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAlreadyInProgress'
        '422':
          description: Order not eligible for retry or payment confirmation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderNotEligibleForRetry'
        '429':
          description: Manual retry limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManualRetryLimitExceeded'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.orders
      x-speakeasy-name-override: confirm_retry_payment
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Orders.ConfirmRetryPayment(ctx, operations.CustomerPortalOrdersConfirmRetryPaymentSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\", components.CustomerOrderConfirmPayment{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerOrderPaymentConfirmation != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.orders.confirm_retry_payment(security=polar_sdk.CustomerPortalOrdersConfirmRetryPaymentSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>", customer_order_confirm_payment={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.orders.confirmRetryPayment({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
                customerOrderConfirmPayment: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $customerOrderConfirmPayment = new
            Components\CustomerOrderConfirmPayment();

            $requestSecurity = new
            Operations\CustomerPortalOrdersConfirmRetryPaymentSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->orders->confirmRetryPayment(
                security: $requestSecurity,
                id: '<value>',
                customerOrderConfirmPayment: $customerOrderConfirmPayment

            );


            if ($response->customerOrderPaymentConfirmation !== null) {
                // handle response
            }
  /v1/customer-portal/organizations/{slug}:
    get:
      tags:
        - customer_portal
        - organizations
        - public
      summary: Get Organization
      description: Get a customer portal's organization by slug.
      operationId: customer_portal:organizations:get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            description: The organization slug.
            title: Slug
          description: The organization slug.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrganizationData'
        '404':
          description: Organization not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.organizations
      x-speakeasy-name-override: get
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Organizations.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerOrganizationData != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.organizations.get(slug="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.organizations.get({
                slug: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()->build();



            $response = $sdk->customerPortal->organizations->get(
                slug: '<value>'
            );

            if ($response->customerOrganizationData !== null) {
                // handle response
            }
  /v1/customer-portal/subscriptions/:
    get:
      tags:
        - customer_portal
        - subscriptions
        - public
      summary: List Subscriptions
      description: |-
        List subscriptions of the authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:subscriptions:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The product ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/products
                  resourceName: Product
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The product ID.
                  x-polar-selector-widget:
                    resourceRoot: /v1/products
                    resourceName: Product
                    displayProperty: name
              - type: 'null'
            title: ProductID Filter
            description: Filter by product ID.
          description: Filter by product ID.
        - name: active
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter by active or cancelled subscription.
            title: Active
          description: Filter by active or cancelled subscription.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search by product or organization name.
            title: Query
          description: Search by product or organization name.
        - 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/CustomerSubscriptionSortProperty'
              - 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:
              - '-started_at'
            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:
                $ref: '#/components/schemas/ListResource_CustomerSubscription_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Customer
        - Member
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.subscriptions
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"os\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Subscriptions.List(ctx, operations.CustomerPortalSubscriptionsListRequest{}, operations.CustomerPortalSubscriptionsListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerSubscription != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.subscriptions.list(security=polar_sdk.CustomerPortalSubscriptionsListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.subscriptions.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();


            $request = new Operations\CustomerPortalSubscriptionsListRequest();

            $requestSecurity = new
            Operations\CustomerPortalSubscriptionsListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $responses = $sdk->customerPortal->subscriptions->list(
                request: $request,
                security: $requestSecurity
            );



            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/subscriptions/{id}:
    get:
      tags:
        - customer_portal
        - subscriptions
        - public
      summary: Get Subscription
      description: |-
        Get a subscription for the authenticated customer.

        **Scopes**: `customer_portal:read` `customer_portal:write`
      operationId: customer_portal:subscriptions:get
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The subscription ID.
            title: Id
          description: The subscription ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSubscription'
        '404':
          description: Customer subscription was 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:
        - Customer
        - Member
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.subscriptions
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Subscriptions.Get(ctx, operations.CustomerPortalSubscriptionsGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSubscription != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.subscriptions.get(security=polar_sdk.CustomerPortalSubscriptionsGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.subscriptions.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSubscriptionsGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->subscriptions->get(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->customerSubscription !== null) {
                // handle response
            }
    patch:
      tags:
        - customer_portal
        - subscriptions
        - public
      summary: Update Subscription
      description: Update a subscription of the authenticated customer.
      operationId: customer_portal:subscriptions:update
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The subscription ID.
            title: Id
          description: The subscription ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerSubscriptionUpdate'
      responses:
        '200':
          description: Customer subscription updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSubscription'
        '402':
          description: Payment required to apply the subscription update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentFailed'
        '403':
          description: >-
            Customer subscription is already canceled or will be at the end of
            the period, or the user lacks billing permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlreadyCanceledSubscription'
        '404':
          description: Customer subscription was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.subscriptions
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Subscriptions.Update(ctx, operations.CustomerPortalSubscriptionsUpdateSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\", components.CreateCustomerSubscriptionUpdateCustomerSubscriptionCancel(\n        components.CustomerSubscriptionCancel{},\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSubscription != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.subscriptions.update(security=polar_sdk.CustomerPortalSubscriptionsUpdateSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>", customer_subscription_update={
                    "pending_update": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.subscriptions.update({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
                customerSubscriptionUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSubscriptionsUpdateSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->subscriptions->update(
                security: $requestSecurity,
                id: '<value>',
                customerSubscriptionUpdate: new Components\CustomerSubscriptionCancel()

            );


            if ($response->customerSubscription !== null) {
                // handle response
            }
    delete:
      tags:
        - customer_portal
        - subscriptions
        - public
      summary: Cancel Subscription
      description: Cancel a subscription of the authenticated customer.
      operationId: customer_portal:subscriptions:cancel
      security:
        - customer_session:
            - customer_portal:write
        - member_session:
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The subscription ID.
            title: Id
          description: The subscription ID.
      responses:
        '200':
          description: Customer subscription is canceled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSubscription'
        '403':
          description: >-
            Customer subscription is already canceled or will be at the end of
            the period, or the user lacks billing permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlreadyCanceledSubscription'
        '404':
          description: Customer subscription was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.subscriptions
      x-speakeasy-name-override: cancel
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Subscriptions.Cancel(ctx, operations.CustomerPortalSubscriptionsCancelSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSubscription != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.subscriptions.cancel(security=polar_sdk.CustomerPortalSubscriptionsCancelSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.subscriptions.cancel({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Operations;


            $sdk = Polar\Polar::builder()->build();



            $requestSecurity = new
            Operations\CustomerPortalSubscriptionsCancelSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );


            $response = $sdk->customerPortal->subscriptions->cancel(
                security: $requestSecurity,
                id: '<value>'

            );


            if ($response->customerSubscription !== null) {
                // handle response
            }
  /v1/customer-portal/wallets/:
    get:
      tags:
        - customer_portal
        - wallets
        - public
      summary: List Wallets
      description: List wallets of the authenticated customer.
      operationId: customer_portal:wallets:list
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - 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/CustomerWalletSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_CustomerWallet_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.wallets
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Wallets.List(ctx, operations.CustomerPortalWalletsListSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, polargo.Pointer[int64](1), polargo.Pointer[int64](10), nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerWallet != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.wallets.list(security=polar_sdk.CustomerPortalWalletsListSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.wallets.list({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {});

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()->build();


            $requestSecurity = new Operations\CustomerPortalWalletsListSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );

            $responses = $sdk->customerPortal->wallets->list(
                security: $requestSecurity,
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-portal/wallets/{id}:
    get:
      tags:
        - customer_portal
        - wallets
        - public
      summary: Get Wallet
      description: Get a wallet by ID for the authenticated customer.
      operationId: customer_portal:wallets:get
      security:
        - customer_session:
            - customer_portal:read
            - customer_portal:write
        - member_session:
            - customer_portal:read
            - customer_portal:write
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The wallet ID.
            title: Id
          description: The wallet ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerWallet'
        '404':
          description: Wallet not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFound'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer_portal.wallets
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"os\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerPortal.Wallets.Get(ctx, operations.CustomerPortalWalletsGetSecurity{\n        CustomerSession: polargo.Pointer(os.Getenv(\"POLAR_CUSTOMER_SESSION\")),\n    }, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerWallet != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_portal.wallets.get(security=polar_sdk.CustomerPortalWalletsGetSecurity(
                    customer_session="<YOUR_BEARER_TOKEN_HERE>",
                ), id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerPortal.wallets.get({
                customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
              }, {
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()->build();


            $requestSecurity = new Operations\CustomerPortalWalletsGetSecurity(
                customerSession: '<YOUR_BEARER_TOKEN_HERE>',
            );

            $response = $sdk->customerPortal->wallets->get(
                security: $requestSecurity,
                id: '<value>'

            );

            if ($response->customerWallet !== null) {
                // handle response
            }
  /v1/customer-seats:
    post:
      tags:
        - customer-seats
        - public
      summary: Assign Seat
      description: '**Scopes**: `customer_seats:write`'
      operationId: customer-seats:assign_seat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeatAssign'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeat'
        '400':
          description: No available seats or customer already has a seat
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Subscription, order, or customer not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-seats
      x-speakeasy-name-override: assign_seat
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerSeats.AssignSeat(ctx, components.SeatAssign{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeat != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_seats.assign_seat(request={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerSeats.assignSeat({});

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\SeatAssign();

            $response = $sdk->customerSeats->assignSeat(
                request: $request
            );

            if ($response->customerSeat !== null) {
                // handle response
            }
    get:
      tags:
        - customer-seats
        - public
      summary: List Seats
      description: '**Scopes**: `customer_seats:write`'
      operationId: customer-seats:list_seats
      parameters:
        - name: subscription_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: 'null'
            title: Subscription Id
        - name: order_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: 'null'
            title: Order Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeatsList'
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Subscription or order not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-seats
      x-speakeasy-name-override: list_seats
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerSeats.ListSeats(ctx, nil, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.SeatsList != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_seats.list_seats()

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerSeats.listSeats({});

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customerSeats->listSeats(

            );

            if ($response->seatsList !== null) {
                // handle response
            }
  /v1/customer-seats/{seat_id}:
    delete:
      tags:
        - customer-seats
        - public
      summary: Revoke Seat
      description: '**Scopes**: `customer_seats:write`'
      operationId: customer-seats:revoke_seat
      parameters:
        - name: seat_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Seat Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeat'
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Seat not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-seats
      x-speakeasy-name-override: revoke_seat
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerSeats.RevokeSeat(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeat != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_seats.revoke_seat(seat_id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerSeats.revokeSeat({
                seatId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customerSeats->revokeSeat(
                seatId: '<value>'
            );

            if ($response->customerSeat !== null) {
                // handle response
            }
  /v1/customer-seats/{seat_id}/resend:
    post:
      tags:
        - customer-seats
        - public
      summary: Resend Invitation
      description: '**Scopes**: `customer_seats:write`'
      operationId: customer-seats:resend_invitation
      parameters:
        - name: seat_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Seat Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeat'
        '400':
          description: Seat is not pending or already claimed
        '401':
          description: Authentication required
        '403':
          description: Not permitted or seat-based pricing not enabled
        '404':
          description: Seat not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-seats
      x-speakeasy-name-override: resend_invitation
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerSeats.ResendInvitation(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeat != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_seats.resend_invitation(seat_id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerSeats.resendInvitation({
                seatId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customerSeats->resendInvitation(
                seatId: '<value>'
            );

            if ($response->customerSeat !== null) {
                // handle response
            }
  /v1/customer-seats/claim/{invitation_token}:
    get:
      tags:
        - customer-seats
        - public
      summary: Get Claim Info
      operationId: customer-seats:get_claim_info
      parameters:
        - name: invitation_token
          in: path
          required: true
          schema:
            type: string
            title: Invitation Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeatClaimInfo'
        '400':
          description: Invalid or expired invitation token
        '403':
          description: Seat-based pricing not enabled for organization
        '404':
          description: Seat not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-seats
      x-speakeasy-name-override: get_claim_info
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerSeats.GetClaimInfo(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.SeatClaimInfo != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_seats.get_claim_info(invitation_token="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerSeats.getClaimInfo({
                invitationToken: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()->build();



            $response = $sdk->customerSeats->getClaimInfo(
                invitationToken: '<value>'
            );

            if ($response->seatClaimInfo !== null) {
                // handle response
            }
  /v1/customer-seats/claim:
    post:
      tags:
        - customer-seats
        - public
      summary: Claim Seat
      operationId: customer-seats:claim_seat
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeatClaim'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSeatClaimResponse'
        '400':
          description: Invalid, expired, or already claimed token
        '403':
          description: Seat-based pricing not enabled for organization
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-seats
      x-speakeasy-name-override: claim_seat
      security:
        - {}
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New()\n\n    res, err := s.CustomerSeats.ClaimSeat(ctx, components.SeatClaim{\n        InvitationToken: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSeatClaimResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar() as polar:

                res = polar.customer_seats.claim_seat(request={
                    "invitation_token": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar();

            async function run() {
              const result = await polar.customerSeats.claimSeat({
                invitationToken: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()->build();

            $request = new Components\SeatClaim(
                invitationToken: '<value>',
            );

            $response = $sdk->customerSeats->claimSeat(
                request: $request
            );

            if ($response->customerSeatClaimResponse !== null) {
                // handle response
            }
  /v1/customer-sessions/:
    post:
      tags:
        - customer-sessions
        - public
      summary: Create Customer Session
      description: |-
        Create a customer session.

        For organizations with `member_model_enabled`, this will automatically
        create a member session for the owner member of the customer.

        **Scopes**: `customer_sessions:write`
      operationId: customer-sessions:create
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/CustomerSessionCustomerIDCreate'
                - $ref: '#/components/schemas/CustomerSessionCustomerExternalIDCreate'
              title: Customer Session Create
        required: true
      responses:
        '201':
          description: Customer session created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSession'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: customer-sessions
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerSessions.Create(ctx, operations.CreateCustomerSessionsCreateCustomerSessionCreateCustomerSessionCustomerExternalIDCreate(\n        components.CustomerSessionCustomerExternalIDCreate{\n            ExternalCustomerID: \"<id>\",\n        },\n    ))\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerSession != nil {\n        switch res.CustomerSession.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.CustomerSession.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.CustomerSession.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_sessions.create(request={
                    "return_url": "https://example.com/account",
                    "external_customer_id": "<id>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerSessions.create({
                externalCustomerId: "<id>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\CustomerSessionCustomerExternalIDCreate(
                externalCustomerId: '<id>',
            );

            $response = $sdk->customerSessions->create(
                request: $request
            );

            if ($response->customerSession !== null) {
                // handle response
            }
  /v1/events/:
    get:
      tags:
        - events
        - public
      summary: List Events
      description: |-
        List events.

        **Scopes**: `events:read` `events:write`
      operationId: events:list
      parameters:
        - name: filter
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter events following filter clauses. JSON string following the
              same schema a meter filter clause. 
            title: Filter
          description: >-
            Filter events following filter clauses. JSON string following the
            same schema a meter filter clause. 
        - name: start_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter events after this timestamp.
            title: Start Timestamp
          description: Filter events after this timestamp.
        - name: end_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter events before this timestamp.
            title: End Timestamp
          description: Filter events before this timestamp.
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by external customer ID.
          description: Filter by external customer ID.
        - name: meter_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The meter ID.
              - type: 'null'
            title: MeterID Filter
            description: Filter by a meter filter clause.
          description: Filter by a meter filter clause.
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Name Filter
            description: Filter by event name.
          description: Filter by event name.
        - name: source
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/EventSource'
              - type: array
                items:
                  $ref: '#/components/schemas/EventSource'
              - type: 'null'
            title: Source Filter
            description: Filter by event source.
          description: Filter by event source.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Query
            description: Query to filter events.
          description: Query to filter events.
        - name: parent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The event ID.
              - type: 'null'
            description: >-
              When combined with depth, use this event as the anchor instead of
              root events.
            title: Parent Id
          description: >-
            When combined with depth, use this event as the anchor instead of
            root events.
        - name: depth
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 5
                minimum: 0
              - type: 'null'
            description: >-
              Fetch descendants up to this depth. When set: 0=root events only,
              1=roots+children, etc. Max 5. When not set, returns all events.
            title: Depth
          description: >-
            Fetch descendants up to this depth. When set: 0=root events only,
            1=roots+children, etc. Max 5. When not set, returns all events.
        - 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/EventSortProperty'
              - 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:
              - '-timestamp'
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ListResource_Event_'
                  - $ref: >-
                      #/components/schemas/ListResourceWithCursorPagination_Event_
                title: Response Events:List
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: events
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Events.List(ctx, operations.EventsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateEventsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ResponseEventsList != nil {\n        switch res.ResponseEventsList.Type {\n            case operations.EventsListResponseEventsListTypeListResourceEvent:\n                // res.ResponseEventsList.ListResourceEvent is populated\n            case operations.EventsListResponseEventsListTypeListResourceWithCursorPaginationEvent:\n                // res.ResponseEventsList.ListResourceWithCursorPaginationEvent is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.events.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.events.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\EventsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $response = $sdk->events->list(
                request: $request
            );

            if ($response->responseEventsList !== null) {
                // handle response
            }
  /v1/events/names:
    get:
      tags:
        - events
        - public
      summary: List Event Names
      description: |-
        List event names.

        **Scopes**: `events:read` `events:write`
      operationId: events:list_names
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by external customer ID.
          description: Filter by external customer ID.
        - name: source
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/EventSource'
              - type: array
                items:
                  $ref: '#/components/schemas/EventSource'
              - type: 'null'
            title: Source Filter
            description: Filter by event source.
          description: Filter by event source.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Query
            description: Query to filter event names.
          description: Query to filter event names.
        - 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/EventNamesSortProperty'
              - 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:
              - '-last_seen'
            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:
                $ref: '#/components/schemas/ListResource_EventName_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: events
      x-speakeasy-name-override: list_names
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Events.ListNames(ctx, operations.EventsListNamesRequest{\n        OrganizationID: polargo.Pointer(operations.CreateEventsListNamesQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceEventName != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.events.list_names(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.events.listNames({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\EventsListNamesRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->events->listNames(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/events/{id}:
    get:
      tags:
        - events
        - public
      summary: Get Event
      description: |-
        Get an event by ID.

        **Scopes**: `events:read` `events:write`
      operationId: events:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The event ID.
            title: Id
          description: The event ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '404':
          description: Event 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-mcp:
        disabled: true
      x-speakeasy-group: events
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Events.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Event != nil {\n        switch res.Event.Type {\n            case components.EventUnionTypeSystemEvent:\n                // res.Event.SystemEvent is populated\n            case components.EventUnionTypeUserEvent:\n                // res.Event.UserEvent is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.events.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.events.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->events->get(
                id: '<value>'
            );

            if ($response->event !== null) {
                // handle response
            }
  /v1/events/ingest:
    post:
      tags:
        - events
        - public
      summary: Ingest Events
      description: |-
        Ingest batch of events.

        **Scopes**: `events:write`
      operationId: events:ingest
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventsIngest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsIngestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: events
      x-speakeasy-name-override: ingest
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Events.Ingest(ctx, components.EventsIngest{\n        Events: []components.Events{},\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.EventsIngestResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.events.ingest(request={
                    "events": [],
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.events.ingest({
                events: [],
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\EventsIngest(
                events: [],
            );

            $response = $sdk->events->ingest(
                request: $request
            );

            if ($response->eventsIngestResponse !== null) {
                // handle response
            }
  /v1/event-types/:
    get:
      tags:
        - event-types
        - public
      summary: List Event Types
      description: |-
        List event types with aggregated statistics.

        **Scopes**: `events:read` `events:write`
      operationId: event-types:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by external customer ID.
          description: Filter by external customer ID.
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Query
            description: Query to filter event types by name or label.
          description: Query to filter event types by name or label.
        - name: root_events
          in: query
          required: false
          schema:
            type: boolean
            title: Root Events Filter
            description: >-
              When true, only return event types with root events (parent_id IS
              NULL).
            default: false
          description: >-
            When true, only return event types with root events (parent_id IS
            NULL).
        - name: parent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: ParentID Filter
            description: Filter by specific parent event ID.
          description: Filter by specific parent event ID.
        - name: source
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/EventSource'
              - type: 'null'
            title: EventSource Filter
            description: Filter by event source (system or user).
          description: Filter by event source (system or user).
        - 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/EventTypesSortProperty'
              - 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:
              - '-last_seen'
            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:
                $ref: '#/components/schemas/ListResource_EventTypeWithStats_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: event-types
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.EventTypes.List(ctx, operations.EventTypesListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateEventTypesListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceEventTypeWithStats != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.event_types.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", root_events=False, page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.eventTypes.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\EventTypesListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->eventTypes->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/event-types/{id}:
    patch:
      tags:
        - event-types
        - public
      summary: Update Event Type
      description: |-
        Update an event type's label.

        **Scopes**: `events:write`
      operationId: event-types:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The event type ID.
            title: Id
          description: The event type ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTypeUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventType'
        '404':
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: event-types
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.EventTypes.Update(ctx, \"<value>\", components.EventTypeUpdate{\n        Label: \"<value>\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.EventType != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.event_types.update(id="<value>", event_type_update={
                    "label": "<value>",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.eventTypes.update({
                id: "<value>",
                eventTypeUpdate: {
                  label: "<value>",
                },
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $eventTypeUpdate = new Components\EventTypeUpdate(
                label: '<value>',
            );

            $response = $sdk->eventTypes->update(
                id: '<value>',
                eventTypeUpdate: $eventTypeUpdate

            );

            if ($response->eventType !== null) {
                // handle response
            }
  /v1/meters/:
    get:
      tags:
        - meters
        - public
      summary: List Meters
      description: |-
        List meters.

        **Scopes**: `meters:read` `meters:write`
      operationId: meters:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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 name.
            title: Query
          description: Filter by name.
        - name: is_archived
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter on archived meters.
            title: Is Archived
          description: Filter on archived meters.
        - 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/MeterSortProperty'
              - 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:
              - name
            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.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResource_Meter_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: true
      x-speakeasy-group: meters
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Meters.List(ctx, operations.MetersListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateMetersListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceMeter != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.meters.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.meters.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\MetersListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->meters->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - meters
        - public
      summary: Create Meter
      description: |-
        Create a meter.

        **Scopes**: `meters:write`
      operationId: meters:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeterCreate'
      responses:
        '201':
          description: Meter created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Meter'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: true
      x-speakeasy-group: meters
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Meters.Create(ctx, components.MeterCreate{\n        Name: \"<value>\",\n        Filter: components.Filter{\n            Conjunction: components.FilterConjunctionOr,\n            Clauses: []components.Clauses{\n                components.CreateClausesFilterClause(\n                    components.FilterClause{\n                        Property: \"<value>\",\n                        Operator: components.FilterOperatorNe,\n                        Value: components.CreateValueStr(\n                            \"<value>\",\n                        ),\n                    },\n                ),\n            },\n        },\n        Aggregation: components.CreateMeterCreateAggregationAvg(\n            components.PropertyAggregation{\n                Func: components.FuncMax,\n                Property: \"<value>\",\n            },\n        ),\n        OrganizationID: polargo.Pointer(\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Meter != nil {\n        switch res.Meter.Aggregation.Type {\n            case components.MeterAggregationTypeAvg:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeCount:\n                // res.Meter.Aggregation.CountAggregation is populated\n            case components.MeterAggregationTypeMax:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeMin:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeSum:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeUnique:\n                // res.Meter.Aggregation.UniqueAggregation is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.meters.create(request={
                    "name": "<value>",
                    "filter_": {
                        "conjunction": polar_sdk.FilterConjunction.OR,
                        "clauses": [],
                    },
                    "aggregation": {
                        "func": "count",
                    },
                    "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.meters.create({
                name: "<value>",
                filter: {
                  conjunction: "or",
                  clauses: [
                    {
                      property: "<value>",
                      operator: "ne",
                      value: "<value>",
                    },
                  ],
                },
                aggregation: {
                  func: "max",
                  property: "<value>",
                },
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\MeterCreate(
                name: '<value>',
                filter: new Components\Filter(
                    conjunction: Components\FilterConjunction::Or,
                    clauses: [
                        new Components\FilterClause(
                            property: '<value>',
                            operator: Components\FilterOperator::Ne,
                            value: '<value>',
                        ),
                    ],
                ),
                aggregation: new Components\PropertyAggregation(
                    func: Components\Func::Max,
                    property: '<value>',
                ),
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $response = $sdk->meters->create(
                request: $request
            );

            if ($response->meter !== null) {
                // handle response
            }
  /v1/meters/{id}:
    get:
      tags:
        - meters
        - public
      summary: Get Meter
      description: |-
        Get a meter by ID.

        **Scopes**: `meters:read` `meters:write`
      operationId: meters:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The meter ID.
            title: Id
          description: The meter ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Meter'
        '404':
          description: Meter 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-mcp:
        disabled: true
      x-speakeasy-group: meters
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Meters.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Meter != nil {\n        switch res.Meter.Aggregation.Type {\n            case components.MeterAggregationTypeAvg:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeCount:\n                // res.Meter.Aggregation.CountAggregation is populated\n            case components.MeterAggregationTypeMax:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeMin:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeSum:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeUnique:\n                // res.Meter.Aggregation.UniqueAggregation is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.meters.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.meters.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->meters->get(
                id: '<value>'
            );

            if ($response->meter !== null) {
                // handle response
            }
    patch:
      tags:
        - meters
        - public
      summary: Update Meter
      description: |-
        Update a meter.

        **Scopes**: `meters:write`
      operationId: meters:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The meter ID.
            title: Id
          description: The meter ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeterUpdate'
      responses:
        '200':
          description: Meter updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Meter'
        '404':
          description: Meter 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-mcp:
        disabled: true
      x-speakeasy-group: meters
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Meters.Update(ctx, \"<value>\", components.MeterUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Meter != nil {\n        switch res.Meter.Aggregation.Type {\n            case components.MeterAggregationTypeAvg:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeCount:\n                // res.Meter.Aggregation.CountAggregation is populated\n            case components.MeterAggregationTypeMax:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeMin:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeSum:\n                // res.Meter.Aggregation.PropertyAggregation is populated\n            case components.MeterAggregationTypeUnique:\n                // res.Meter.Aggregation.UniqueAggregation is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.meters.update(id="<value>", meter_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.meters.update({
                id: "<value>",
                meterUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $meterUpdate = new Components\MeterUpdate();

            $response = $sdk->meters->update(
                id: '<value>',
                meterUpdate: $meterUpdate

            );

            if ($response->meter !== null) {
                // handle response
            }
  /v1/meters/{id}/quantities:
    get:
      tags:
        - meters
        - public
      summary: Get Meter Quantities
      description: |-
        Get quantities of a meter over a time period.

        **Scopes**: `meters:read` `meters:write`
      operationId: meters:quantities
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The meter ID.
            title: Id
          description: The meter ID.
        - name: start_timestamp
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: Start timestamp.
            title: Start Timestamp
          description: Start timestamp.
        - name: end_timestamp
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: End timestamp.
            title: End Timestamp
          description: End timestamp.
        - name: interval
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/TimeInterval'
            description: Interval between two timestamps.
          description: Interval between two timestamps.
        - name: timezone
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            description: Timezone to use for the timestamps. Default is UTC.
            default: UTC
            title: Timezone
          description: Timezone to use for the timestamps. Default is UTC.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by external customer ID.
          description: Filter by external customer ID.
        - name: customer_aggregation_function
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AggregationFunction'
              - type: 'null'
            description: >-
              If set, will first compute the quantities per customer before
              aggregating them using the given function. If not set, the
              quantities will be aggregated across all events.
            title: Customer Aggregation Function
          description: >-
            If set, will first compute the quantities per customer before
            aggregating them using the given function. If not set, the
            quantities will be aggregated across all events.
        - name: metadata
          in: query
          required: false
          style: deepObject
          schema:
            $ref: '#/components/schemas/MetadataQuery'
          description: >-
            Filter by metadata key-value pairs. It uses the `deepObject` style,
            e.g. `?metadata[key]=value`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeterQuantities'
        '404':
          description: Meter 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-mcp:
        disabled: true
      x-speakeasy-group: meters
      x-speakeasy-name-override: quantities
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/types\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Meters.Quantities(ctx, operations.MetersQuantitiesRequest{\n        ID: \"<value>\",\n        StartTimestamp: types.MustTimeFromString(\"2025-11-25T04:37:16.823Z\"),\n        EndTimestamp: types.MustTimeFromString(\"2025-11-26T17:06:00.727Z\"),\n        Interval: components.TimeIntervalDay,\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.MeterQuantities != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            import polar_sdk
            from polar_sdk import Polar
            from polar_sdk.utils import parse_datetime


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.meters.quantities(id="<value>", start_timestamp=parse_datetime("2026-11-25T04:37:16.823Z"), end_timestamp=parse_datetime("2026-11-26T17:06:00.727Z"), interval=polar_sdk.TimeInterval.DAY, timezone="UTC")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.meters.quantities({
                id: "<value>",
                startTimestamp: new Date("2025-11-25T04:37:16.823Z"),
                endTimestamp: new Date("2025-11-26T17:06:00.727Z"),
                interval: "day",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;
            use Polar\Models\Operations;
            use Polar\Utils;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\MetersQuantitiesRequest(
                id: '<value>',
                startTimestamp: Utils\Utils::parseDateTime('2025-11-25T04:37:16.823Z'),
                endTimestamp: Utils\Utils::parseDateTime('2025-11-26T17:06:00.727Z'),
                interval: Components\TimeInterval::Day,
            );

            $response = $sdk->meters->quantities(
                request: $request
            );

            if ($response->meterQuantities !== null) {
                // handle response
            }
  /v1/organization-access-tokens/:
    get:
      tags:
        - organization_access_tokens
        - public
        - mcp
      summary: List
      description: >-
        List organization access tokens.


        **Scopes**: `organization_access_tokens:read`
        `organization_access_tokens:write`
      operationId: organization_access_tokens:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: 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/OrganizationAccessTokenSortProperty'
              - 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:
              - created_at
            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:
                $ref: '#/components/schemas/ListResource_OrganizationAccessToken_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - organization_access_tokens
      x-speakeasy-group: organization_access_tokens
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.OrganizationAccessTokens.List(ctx, polargo.Pointer(operations.CreateOrganizationAccessTokensListQueryParamOrganizationIDFilterStr(\n        \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n    )), polargo.Pointer[int64](1), polargo.Pointer[int64](10), nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceOrganizationAccessToken != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organization_access_tokens.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizationAccessTokens.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $responses = $sdk->organizationAccessTokens->list(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
                page: 1,
                limit: 10

            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
    post:
      tags:
        - organization_access_tokens
        - public
        - mcp
      summary: Create
      description: '**Scopes**: `organization_access_tokens:write`'
      operationId: organization_access_tokens:create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationAccessTokenCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationAccessTokenCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - organization_access_tokens
      x-speakeasy-group: organization_access_tokens
      x-speakeasy-name-override: create
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.OrganizationAccessTokens.Create(ctx, components.OrganizationAccessTokenCreate{\n        Comment: \"The Football Is Good For Training And Recreational Purposes\",\n        Scopes: []components.AvailableScope{},\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.OrganizationAccessTokenCreateResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organization_access_tokens.create(request={
                    "comment": "The Football Is Good For Training And Recreational Purposes",
                    "scopes": [],
                })

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizationAccessTokens.create({
                comment: "The Football Is Good For Training And Recreational Purposes",
                scopes: [],
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Components;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Components\OrganizationAccessTokenCreate(
                comment: 'The Football Is Good For Training And Recreational Purposes',
                scopes: [],
            );

            $response = $sdk->organizationAccessTokens->create(
                request: $request
            );

            if ($response->organizationAccessTokenCreateResponse !== null) {
                // handle response
            }
  /v1/organization-access-tokens/{id}:
    patch:
      tags:
        - organization_access_tokens
        - public
        - mcp
      summary: Update
      description: '**Scopes**: `organization_access_tokens:write`'
      operationId: organization_access_tokens:update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationAccessTokenUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationAccessToken'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - organization_access_tokens
      x-speakeasy-group: organization_access_tokens
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.OrganizationAccessTokens.Update(ctx, \"<value>\", components.OrganizationAccessTokenUpdate{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.OrganizationAccessToken != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.organization_access_tokens.update(id="<value>", organization_access_token_update={})

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.organizationAccessTokens.update({
                id: "<value>",
                organizationAccessTokenUpdate: {},
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use Polar;

            use Polar\Models\Components;


            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $organizationAccessTokenUpdate = new
            Components\OrganizationAccessTokenUpdate();


            $response = $sdk->organizationAccessTokens->update(
                id: '<value>',
                organizationAccessTokenUpdate: $organizationAccessTokenUpdate

            );


            if ($response->organizationAccessToken !== null) {
                // handle response
            }
    delete:
      tags:
        - organization_access_tokens
        - public
        - mcp
      summary: Delete
      description: '**Scopes**: `organization_access_tokens:write`'
      operationId: organization_access_tokens:delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-polar-allowed-subjects:
        - Organization
        - User
      x-speakeasy-mcp:
        disabled: false
        scopes:
          - write
          - organization_access_tokens
      x-speakeasy-group: organization_access_tokens
      x-speakeasy-name-override: delete
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.OrganizationAccessTokens.Delete(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                polar.organization_access_tokens.delete(id="<value>")

                # Use the SDK ...
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              await polar.organizationAccessTokens.delete({
                id: "<value>",
              });


            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->organizationAccessTokens->delete(
                id: '<value>'
            );

            if ($response->statusCode === 200) {
                // handle response
            }
  /v1/customer-meters/:
    get:
      tags:
        - customer_meters
        - public
        - mcp
      summary: List Customer Meters
      description: |-
        List customer meters.

        **Scopes**: `customer_meters:read`
      operationId: customer_meters:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: external_customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: ExternalCustomerID Filter
            description: Filter by external customer ID.
          description: Filter by external customer ID.
        - name: meter_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The meter ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The meter ID.
              - type: 'null'
            title: MeterID Filter
            description: Filter by meter ID.
          description: Filter by meter ID.
        - 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/CustomerMeterSortProperty'
              - 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:
              - '-modified_at'
            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:
                $ref: '#/components/schemas/ListResource_CustomerMeter_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - customer_meters
      x-speakeasy-group: customer_meters
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerMeters.List(ctx, operations.CustomerMetersListRequest{\n        OrganizationID: polargo.Pointer(operations.CreateCustomerMetersListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourceCustomerMeter != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_meters.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerMeters.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\CustomerMetersListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->customerMeters->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/customer-meters/{id}:
    get:
      tags:
        - customer_meters
        - public
        - mcp
      summary: Get Customer Meter
      description: |-
        Get a customer meter by ID.

        **Scopes**: `customer_meters:read`
      operationId: customer_meters:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The customer meter ID.
            title: Id
          description: The customer meter ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerMeter'
        '404':
          description: Customer meter 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-mcp:
        disabled: false
        scopes:
          - read
          - customer_meters
      x-speakeasy-group: customer_meters
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.CustomerMeters.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.CustomerMeter != nil {\n        switch res.CustomerMeter.Customer.Type {\n            case components.CustomerUnionTypeIndividual:\n                // res.CustomerMeter.Customer.CustomerIndividual is populated\n            case components.CustomerUnionTypeTeam:\n                // res.CustomerMeter.Customer.CustomerTeam is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.customer_meters.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.customerMeters.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->customerMeters->get(
                id: '<value>'
            );

            if ($response->customerMeter !== null) {
                // handle response
            }
  /v1/payments/:
    get:
      tags:
        - payments
        - public
        - mcp
      summary: List Payments
      description: |-
        List payments.

        **Scopes**: `payments:read`
      operationId: payments:list
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                examples:
                  - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                description: The organization ID.
                x-polar-selector-widget:
                  resourceRoot: /v1/organizations
                  resourceName: Organization
                  displayProperty: name
              - type: array
                items:
                  type: string
                  format: uuid4
                  examples:
                    - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
                  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: checkout_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: CheckoutID Filter
            description: Filter by checkout ID.
          description: Filter by checkout ID.
        - name: order_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
              - type: array
                items:
                  type: string
                  format: uuid4
              - type: 'null'
            title: OrderID Filter
            description: Filter by order ID.
          description: Filter by order ID.
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid4
                description: The customer ID.
              - type: array
                items:
                  type: string
                  format: uuid4
                  description: The customer ID.
              - type: 'null'
            title: CustomerID Filter
            description: Filter by customer ID.
          description: Filter by customer ID.
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/PaymentStatus'
              - type: array
                items:
                  $ref: '#/components/schemas/PaymentStatus'
              - type: 'null'
            title: Status Filter
            description: Filter by payment status.
          description: Filter by payment status.
        - name: method
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Method Filter
            description: Filter by payment method.
          description: Filter by payment method.
        - name: customer_email
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: 'null'
            title: CustomerEmail Filter
            description: Filter by customer email.
          description: Filter by customer email.
        - 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/PaymentSortProperty'
              - 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:
              - '-created_at'
            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:
                $ref: '#/components/schemas/ListResource_Payment_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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-mcp:
        disabled: false
        scopes:
          - read
          - payments
      x-speakeasy-group: payments
      x-speakeasy-name-override: list
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"github.com/polarsource/polar-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Payments.List(ctx, operations.PaymentsListRequest{\n        OrganizationID: polargo.Pointer(operations.CreatePaymentsListQueryParamOrganizationIDFilterStr(\n            \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n        )),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListResourcePayment != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.payments.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.payments.list({
                organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;
            use Polar\Models\Operations;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();

            $request = new Operations\PaymentsListRequest(
                organizationId: '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
            );

            $responses = $sdk->payments->list(
                request: $request
            );


            foreach ($responses as $response) {
                if ($response->statusCode === 200) {
                    // handle response
                }
            }
  /v1/payments/{id}:
    get:
      tags:
        - payments
        - public
        - mcp
      summary: Get Payment
      description: |-
        Get a payment by ID.

        **Scopes**: `payments:read`
      operationId: payments:get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            description: The payment ID.
            title: Id
          description: The payment ID.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '404':
          description: Payment 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-mcp:
        disabled: false
        scopes:
          - read
          - payments
      x-speakeasy-group: payments
      x-speakeasy-name-override: get
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tpolargo \"github.com/polarsource/polar-go\"\n\t\"log\"\n\t\"github.com/polarsource/polar-go/models/components\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := polargo.New(\n        polargo.WithSecurity(os.Getenv(\"POLAR_ACCESS_TOKEN\")),\n    )\n\n    res, err := s.Payments.Get(ctx, \"<value>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Payment != nil {\n        switch res.Payment.Type {\n            case components.PaymentTypeCardPayment:\n                // res.Payment.CardPayment is populated\n            case components.PaymentTypeGenericPayment:\n                // res.Payment.GenericPayment is populated\n        }\n\n    }\n}"
        - lang: python
          label: Python (SDK)
          source: |-
            from polar_sdk import Polar


            with Polar(
                access_token="<YOUR_BEARER_TOKEN_HERE>",
            ) as polar:

                res = polar.payments.get(id="<value>")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Polar } from "@polar-sh/sdk";

            const polar = new Polar({
              accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
            });

            async function run() {
              const result = await polar.payments.get({
                id: "<value>",
              });

              console.log(result);
            }

            run();
        - lang: php
          label: PHP (SDK)
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Polar;

            $sdk = Polar\Polar::builder()
                ->setSecurity(
                    '<YOUR_BEARER_TOKEN_HERE>'
                )
                ->build();



            $response = $sdk->payments->get(
                id: '<value>'
            );

            if ($response->payment !== null) {
                // handle response
            }
webhooks:
  checkout.created:
    post:
      summary: checkout.created
      description: |-
        Sent when a new checkout is created.

        **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:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  checkout.updated:
    post:
      summary: checkout.updated
      description: |-
        Sent when a checkout is updated.

        **Discord & Slack support:** Basic
      operationId: _endpointcheckout_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCheckoutUpdatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  checkout.expired:
    post:
      summary: checkout.expired
      description: >-
        Sent when a checkout expires.


        This event fires when a checkout reaches its expiration time without
        being completed.

        Developers can use this to send reminder emails or track checkout
        abandonment.


        **Discord & Slack support:** Basic
      operationId: _endpointcheckout_expired_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCheckoutExpiredPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer.created:
    post:
      summary: customer.created
      description: |-
        Sent when a new customer is created.

        A customer can be created:

        * After a successful checkout.
        * Programmatically via the API.

        **Discord & Slack support:** Basic
      operationId: _endpointcustomer_created_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerCreatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer.updated:
    post:
      summary: customer.updated
      description: >-
        Sent when a customer is updated.


        This event is fired when the customer details are updated.


        If you want to be notified when a customer subscription or benefit state
        changes, you should listen to the `customer_state_changed` event.


        **Discord & Slack support:** Basic
      operationId: _endpointcustomer_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerUpdatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer.deleted:
    post:
      summary: customer.deleted
      description: |-
        Sent when a customer is deleted.

        **Discord & Slack support:** Basic
      operationId: _endpointcustomer_deleted_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerDeletedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer.state_changed:
    post:
      summary: customer.state_changed
      description: |-
        Sent when a customer state has changed.

        It's triggered when:

        * Customer is created, updated or deleted.
        * A subscription is created or updated.
        * A benefit is granted or revoked.

        **Discord & Slack support:** Basic
      operationId: _endpointcustomer_state_changed_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerStateChangedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer_seat.assigned:
    post:
      summary: customer_seat.assigned
      description: >-
        Sent when a new customer seat is assigned.


        This event is triggered when a seat is assigned to a customer by the
        organization.

        The customer will receive an invitation email to claim the seat.
      operationId: _endpointcustomer_seat_assigned_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerSeatAssignedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer_seat.claimed:
    post:
      summary: customer_seat.claimed
      description: >-
        Sent when a customer seat is claimed.


        This event is triggered when a customer accepts the seat invitation and
        claims their access.
      operationId: _endpointcustomer_seat_claimed_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerSeatClaimedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  customer_seat.revoked:
    post:
      summary: customer_seat.revoked
      description: >-
        Sent when a customer seat is revoked.


        This event is triggered when access to a seat is revoked, either
        manually by the organization or automatically when a subscription is
        canceled.
      operationId: _endpointcustomer_seat_revoked_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCustomerSeatRevokedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  member.created:
    post:
      summary: member.created
      description: |-
        Sent when a new member is created.

        A member represents an individual within a customer (team).
        This event is triggered when a member is added to a customer,
        either programmatically via the API or when an owner is automatically
        created for a new customer.

        **Discord & Slack support:** Basic
      operationId: _endpointmember_created_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookMemberCreatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  member.updated:
    post:
      summary: member.updated
      description: |-
        Sent when a member is updated.

        This event is triggered when member details are updated,
        such as their name or role within the customer.

        **Discord & Slack support:** Basic
      operationId: _endpointmember_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookMemberUpdatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  member.deleted:
    post:
      summary: member.deleted
      description: |-
        Sent when a member is deleted.

        This event is triggered when a member is removed from a customer.
        Any active seats assigned to the member will be automatically revoked.

        **Discord & Slack support:** Basic
      operationId: _endpointmember_deleted_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookMemberDeletedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  order.created:
    post:
      summary: order.created
      description: >-
        Sent when a new order is created.


        A new order is created when:


        * A customer purchases a one-time product. In this case,
        `billing_reason` is set to `purchase`.

        * A customer starts a subscription. In this case, `billing_reason` is
        set to `subscription_create`.

        * A subscription is renewed. In this case, `billing_reason` is set to
        `subscription_cycle`.

        * A subscription is upgraded or downgraded with an immediate proration
        invoice. In this case, `billing_reason` is set to `subscription_update`.


        > [!WARNING]

        > The order might not be paid yet, so the `status` field might be
        `pending`.


        **Discord & Slack support:** Full
      operationId: _endpointorder_created_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookOrderCreatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  order.updated:
    post:
      summary: order.updated
      description: |-
        Sent when an order is updated.

        An order is updated when:

        * Its status changes, e.g. from `pending` to `paid`.
        * It's refunded, partially or fully.

        **Discord & Slack support:** Full
      operationId: _endpointorder_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookOrderUpdatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  order.paid:
    post:
      summary: order.paid
      description: >-
        Sent when an order is paid.


        When you receive this event, the order is fully processed and payment
        has been received.


        **Discord & Slack support:** Full
      operationId: _endpointorder_paid_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookOrderPaidPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  order.refunded:
    post:
      summary: order.refunded
      description: |-
        Sent when an order is fully or partially refunded.

        **Discord & Slack support:** Full
      operationId: _endpointorder_refunded_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookOrderRefundedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.created:
    post:
      summary: subscription.created
      description: >-
        Sent when a new subscription is created.


        When this event occurs, the subscription `status` might not be `active`
        yet, as we can still have to wait for the first payment to be processed.


        **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: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.updated:
    post:
      summary: subscription.updated
      description: >-
        Sent when a subscription is updated. This event fires for all changes to
        the subscription, including renewals.


        If you want more specific events, you can listen to
        `subscription.active`, `subscription.canceled`, `subscription.past_due`,
        and `subscription.revoked`.


        To listen specifically for renewals, you can listen to `order.created`
        events and check the `billing_reason` field.


        **Discord & Slack support:** On cancellation, past due, and revocation.
        Renewals are skipped.
      operationId: _endpointsubscription_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionUpdatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.active:
    post:
      summary: subscription.active
      description: >-
        Sent when a subscription becomes active,

        whether because it's a new paid subscription or because payment was
        recovered.


        **Discord & Slack support:** Full
      operationId: _endpointsubscription_active_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionActivePayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.canceled:
    post:
      summary: subscription.canceled
      description: |-
        Sent when a subscription is canceled.
        Customers might still have access until the end of the current period.

        **Discord & Slack support:** Full
      operationId: _endpointsubscription_canceled_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionCanceledPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.uncanceled:
    post:
      summary: subscription.uncanceled
      description: >-
        Sent when a customer revokes a pending cancellation.


        When a customer cancels with "at period end", they retain access until
        the

        subscription would renew. During this time, they can change their mind
        and

        undo the cancellation. This event is triggered when they do so.


        **Discord & Slack support:** Full
      operationId: _endpointsubscription_uncanceled_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionUncanceledPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.revoked:
    post:
      summary: subscription.revoked
      description: >-
        Sent when a subscription is revoked and the user loses access
        immediately.

        Happens when the subscription is canceled or payment retries are
        exhausted (status becomes `unpaid`).


        For payment failures that can still be recovered, see
        `subscription.past_due`.


        **Discord & Slack support:** Full
      operationId: _endpointsubscription_revoked_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionRevokedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  subscription.past_due:
    post:
      summary: subscription.past_due
      description: >-
        Sent when a subscription payment fails and the subscription enters
        `past_due` status.


        This is a recoverable state - the customer can update their payment
        method to restore the subscription.

        Benefits may be revoked depending on the organization's grace period
        settings.


        If payment retries are exhausted, a `subscription.revoked` event will be
        sent.


        **Discord & Slack support:** Full
      operationId: _endpointsubscription_past_due_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionPastDuePayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  refund.created:
    post:
      summary: refund.created
      description: |-
        Sent when a refund is created regardless of status.

        **Discord & Slack support:** Full
      operationId: _endpointrefund_created_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookRefundCreatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  refund.updated:
    post:
      summary: refund.updated
      description: |-
        Sent when a refund is updated.

        **Discord & Slack support:** Full
      operationId: _endpointrefund_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookRefundUpdatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  product.created:
    post:
      summary: product.created
      description: |-
        Sent when a new product is created.

        **Discord & Slack support:** Basic
      operationId: _endpointproduct_created_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookProductCreatedPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  product.updated:
    post:
      summary: product.updated
      description: |-
        Sent when a product is updated.

        **Discord & Slack support:** Basic
      operationId: _endpointproduct_updated_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookProductUpdatedPayload'
        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.

        **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.

        **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.

        **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.

        **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 benefit grant is updated.

        **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.cycled:
    post:
      summary: benefit_grant.cycled
      description: |-
        Sent when a benefit grant is cycled,
        meaning the related subscription has been renewed for another period.

        **Discord & Slack support:** Basic
      operationId: _endpointbenefit_grant_cycled_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookBenefitGrantCycledPayload'
        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 benefit grant is revoked.

        **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:
    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
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          title: CountryAlpha2
          examples:
            - US
            - SE
            - FR
          x-speakeasy-enums:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
      type: object
      required:
        - country
      title: Address
    AddressDict:
      properties:
        line1:
          type: string
          title: Line1
        line2:
          type: string
          title: Line2
        postal_code:
          type: string
          title: Postal Code
        city:
          type: string
          title: City
        state:
          type: string
          title: State
        country:
          type: string
          title: Country
      type: object
      required:
        - country
      title: AddressDict
    AddressInput:
      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
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          title: CountryAlpha2Input
          examples:
            - US
            - SE
            - FR
          x-speakeasy-enums:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BF
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - YE
            - YT
            - ZA
            - ZM
            - ZW
      type: object
      required:
        - country
      title: AddressInput
    AggregateField:
      type: string
      maxLength: 255
      minLength: 1
    AggregationFunction:
      type: string
      enum:
        - count
        - sum
        - max
        - min
        - avg
        - unique
      title: AggregationFunction
    AlreadyActiveSubscriptionError:
      properties:
        error:
          type: string
          const: AlreadyActiveSubscriptionError
          title: Error
          examples:
            - AlreadyActiveSubscriptionError
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: AlreadyActiveSubscriptionError
    AlreadyCanceledSubscription:
      properties:
        error:
          type: string
          const: AlreadyCanceledSubscription
          title: Error
          examples:
            - AlreadyCanceledSubscription
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: AlreadyCanceledSubscription
    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'
          title: CustomField
        order:
          type: integer
          title: Order
          description: Order of the custom field in the resource.
        required:
          type: boolean
          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.
    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
          const: organization
          title: Sub Type
        sub:
          anyOf:
            - $ref: '#/components/schemas/AuthorizeOrganization'
            - type: 'null'
        scopes:
          items:
            $ref: '#/components/schemas/Scope'
          type: array
          title: Scopes
        scope_display_names:
          additionalProperties:
            type: string
          type: object
          title: Scope Display Names
          default:
            openid: OpenID
            profile: Read your profile
            email: Read your email address
            user:read: Read your user account
            user:write: Manage your user account
            organizations:read: Read your organizations
            organizations:write: Create or modify organizations
            custom_fields:read: Read custom fields
            custom_fields:write: Create or modify custom fields
            discounts:read: Read discounts
            discounts:write: Create or modify discounts
            checkout_links:read: Read checkout links
            checkout_links:write: Create or modify checkout links
            checkouts:read: Read checkout sessions
            checkouts:write: Create or modify checkout sessions
            transactions:read: Read transactions
            transactions:write: Create or modify transactions
            payouts:read: Read payouts
            payouts:write: Create or modify payouts
            products:read: Read products
            products:write: Create or modify products
            benefits:read: Read benefits
            benefits:write: Create or modify benefits
            events:read: Read events
            events:write: Create events
            meters:read: Read meters
            meters:write: Create or modify meters
            files:read: Read file uploads
            files:write: Create or modify file uploads
            subscriptions:read: Read subscriptions made on your organizations
            subscriptions:write: Create or modify subscriptions made on your organizations
            customers:read: Read customers
            customers:write: Create or modify customers
            members:read: Read members
            members:write: Create or modify members
            wallets:read: Read wallets
            wallets:write: Create or modify wallets
            disputes:read: Read disputes
            customer_meters:read: Read customer meters
            customer_sessions:write: Create or modify customer sessions
            member_sessions:write: Create or modify member sessions
            customer_seats:read: Read customer seats
            customer_seats:write: Create or modify customer seats
            orders:read: Read orders made on your organizations
            orders:write: Modify orders made on your organizations
            refunds:read: Read refunds made on your organizations
            refunds:write: Create or modify refunds
            payments:read: Read payments made on your organizations
            metrics:read: Read metrics
            metrics:write: Create or modify metric definitions
            webhooks:read: Read webhooks
            webhooks:write: Create or modify webhooks
            license_keys:read: Read license keys
            license_keys:write: Modify license keys
            customer_portal:read: Read your orders, subscriptions and benefits
            customer_portal:write: Create or modify your orders, subscriptions and benefits
            notifications:read: Read notifications
            notifications:write: Mark notifications as read
            notification_recipients:read: Read notification recipients
            notification_recipients:write: Create or modify notification recipients
            organization_access_tokens:read: Read organization access tokens
            organization_access_tokens:write: Create or modify organization access tokens
        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
          const: user
          title: Sub Type
        sub:
          anyOf:
            - $ref: '#/components/schemas/AuthorizeUser'
            - type: 'null'
        scopes:
          items:
            $ref: '#/components/schemas/Scope'
          type: array
          title: Scopes
        scope_display_names:
          additionalProperties:
            type: string
          type: object
          title: Scope Display Names
          default:
            openid: OpenID
            profile: Read your profile
            email: Read your email address
            user:read: Read your user account
            user:write: Manage your user account
            organizations:read: Read your organizations
            organizations:write: Create or modify organizations
            custom_fields:read: Read custom fields
            custom_fields:write: Create or modify custom fields
            discounts:read: Read discounts
            discounts:write: Create or modify discounts
            checkout_links:read: Read checkout links
            checkout_links:write: Create or modify checkout links
            checkouts:read: Read checkout sessions
            checkouts:write: Create or modify checkout sessions
            transactions:read: Read transactions
            transactions:write: Create or modify transactions
            payouts:read: Read payouts
            payouts:write: Create or modify payouts
            products:read: Read products
            products:write: Create or modify products
            benefits:read: Read benefits
            benefits:write: Create or modify benefits
            events:read: Read events
            events:write: Create events
            meters:read: Read meters
            meters:write: Create or modify meters
            files:read: Read file uploads
            files:write: Create or modify file uploads
            subscriptions:read: Read subscriptions made on your organizations
            subscriptions:write: Create or modify subscriptions made on your organizations
            customers:read: Read customers
            customers:write: Create or modify customers
            members:read: Read members
            members:write: Create or modify members
            wallets:read: Read wallets
            wallets:write: Create or modify wallets
            disputes:read: Read disputes
            customer_meters:read: Read customer meters
            customer_sessions:write: Create or modify customer sessions
            member_sessions:write: Create or modify member sessions
            customer_seats:read: Read customer seats
            customer_seats:write: Create or modify customer seats
            orders:read: Read orders made on your organizations
            orders:write: Modify orders made on your organizations
            refunds:read: Read refunds made on your organizations
            refunds:write: Create or modify refunds
            payments:read: Read payments made on your organizations
            metrics:read: Read metrics
            metrics:write: Create or modify metric definitions
            webhooks:read: Read webhooks
            webhooks:write: Create or modify webhooks
            license_keys:read: Read license keys
            license_keys:write: Modify license keys
            customer_portal:read: Read your orders, subscriptions and benefits
            customer_portal:write: Create or modify your orders, subscriptions and benefits
            notifications:read: Read notifications
            notifications:write: Mark notifications as read
            notification_recipients:read: Read notification recipients
            notification_recipients:write: Create or modify notification recipients
            organization_access_tokens:read: Read organization access tokens
            organization_access_tokens:write: Create or modify organization access tokens
      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
    AvailableScope:
      type: string
      enum:
        - openid
        - profile
        - email
        - user:read
        - user:write
        - organizations:read
        - organizations:write
        - custom_fields:read
        - custom_fields:write
        - discounts:read
        - discounts:write
        - checkout_links:read
        - checkout_links:write
        - checkouts:read
        - checkouts:write
        - transactions:read
        - transactions:write
        - payouts:read
        - payouts:write
        - products:read
        - products:write
        - benefits:read
        - benefits:write
        - events:read
        - events:write
        - meters:read
        - meters:write
        - files:read
        - files:write
        - subscriptions:read
        - subscriptions:write
        - customers:read
        - customers:write
        - members:read
        - members:write
        - wallets:read
        - wallets:write
        - disputes:read
        - customer_meters:read
        - customer_sessions:write
        - member_sessions:write
        - customer_seats:read
        - customer_seats:write
        - orders:read
        - orders:write
        - refunds:read
        - refunds:write
        - payments:read
        - metrics:read
        - metrics:write
        - webhooks:read
        - webhooks:write
        - license_keys:read
        - license_keys:write
        - customer_portal:read
        - customer_portal:write
        - notifications:read
        - notifications:write
        - notification_recipients:read
        - notification_recipients:write
        - organization_access_tokens:read
        - organization_access_tokens:write
      title: AvailableScope
    BalanceCreditOrderEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: balance.credit_order
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BalanceCreditOrderMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BalanceCreditOrderEvent
      description: An event created by Polar when an order is paid via customer balance.
    BalanceCreditOrderMetadata:
      properties:
        order_id:
          type: string
          title: Order Id
        product_id:
          type: string
          title: Product Id
        subscription_id:
          type: string
          title: Subscription Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        tax_amount:
          type: integer
          title: Tax Amount
        tax_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax State
        tax_country:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Country
        fee:
          type: integer
          title: Fee
        exchange_rate:
          type: number
          title: Exchange Rate
      type: object
      required:
        - order_id
        - amount
        - currency
        - tax_amount
        - fee
      title: BalanceCreditOrderMetadata
    BalanceDisputeEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: balance.dispute
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BalanceDisputeMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BalanceDisputeEvent
      description: An event created by Polar when an order is disputed.
    BalanceDisputeMetadata:
      properties:
        transaction_id:
          type: string
          title: Transaction Id
        dispute_id:
          type: string
          title: Dispute Id
        order_id:
          type: string
          title: Order Id
        order_created_at:
          type: string
          title: Order Created At
        product_id:
          type: string
          title: Product Id
        subscription_id:
          type: string
          title: Subscription Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        presentment_amount:
          type: integer
          title: Presentment Amount
        presentment_currency:
          type: string
          title: Presentment Currency
        tax_amount:
          type: integer
          title: Tax Amount
        tax_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax State
        tax_country:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Country
        fee:
          type: integer
          title: Fee
        exchange_rate:
          type: number
          title: Exchange Rate
      type: object
      required:
        - transaction_id
        - dispute_id
        - amount
        - currency
        - presentment_amount
        - presentment_currency
        - tax_amount
        - fee
      title: BalanceDisputeMetadata
    BalanceDisputeReversalEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: balance.dispute_reversal
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BalanceDisputeMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BalanceDisputeReversalEvent
      description: >-
        An event created by Polar when a dispute is won and funds are
        reinstated.
    BalanceOrderEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: balance.order
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BalanceOrderMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BalanceOrderEvent
      description: An event created by Polar when an order is paid.
    BalanceOrderMetadata:
      properties:
        transaction_id:
          type: string
          title: Transaction Id
        order_id:
          type: string
          title: Order Id
        product_id:
          type: string
          title: Product Id
        subscription_id:
          type: string
          title: Subscription Id
        amount:
          type: integer
          title: Amount
        net_amount:
          type: integer
          title: Net Amount
        currency:
          type: string
          title: Currency
        presentment_amount:
          type: integer
          title: Presentment Amount
        presentment_currency:
          type: string
          title: Presentment Currency
        tax_amount:
          type: integer
          title: Tax Amount
        tax_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax State
        tax_country:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Country
        fee:
          type: integer
          title: Fee
        exchange_rate:
          type: number
          title: Exchange Rate
      type: object
      required:
        - transaction_id
        - order_id
        - amount
        - currency
        - presentment_amount
        - presentment_currency
        - tax_amount
        - fee
      title: BalanceOrderMetadata
    BalanceRefundEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: balance.refund
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BalanceRefundMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BalanceRefundEvent
      description: An event created by Polar when an order is refunded.
    BalanceRefundMetadata:
      properties:
        transaction_id:
          type: string
          title: Transaction Id
        refund_id:
          type: string
          title: Refund Id
        order_id:
          type: string
          title: Order Id
        order_created_at:
          type: string
          title: Order Created At
        product_id:
          type: string
          title: Product Id
        subscription_id:
          type: string
          title: Subscription Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        presentment_amount:
          type: integer
          title: Presentment Amount
        presentment_currency:
          type: string
          title: Presentment Currency
        refundable_amount:
          type: integer
          title: Refundable Amount
        tax_amount:
          type: integer
          title: Tax Amount
        tax_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax State
        tax_country:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Country
        fee:
          type: integer
          title: Fee
        exchange_rate:
          type: number
          title: Exchange Rate
      type: object
      required:
        - transaction_id
        - refund_id
        - amount
        - currency
        - presentment_amount
        - presentment_currency
        - tax_amount
        - fee
      title: BalanceRefundMetadata
    BalanceRefundReversalEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: balance.refund_reversal
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BalanceRefundMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BalanceRefundReversalEvent
      description: An event created by Polar when a refund is reverted.
    Benefit:
      oneOf:
        - $ref: '#/components/schemas/BenefitCustom'
        - $ref: '#/components/schemas/BenefitDiscord'
        - $ref: '#/components/schemas/BenefitGitHubRepository'
        - $ref: '#/components/schemas/BenefitDownloadables'
        - $ref: '#/components/schemas/BenefitLicenseKeys'
        - $ref: '#/components/schemas/BenefitMeterCredit'
        - $ref: '#/components/schemas/BenefitFeatureFlag'
        - $ref: '#/components/schemas/BenefitSlackSharedChannel'
      discriminator:
        propertyName: type
        mapping:
          custom: '#/components/schemas/BenefitCustom'
          discord: '#/components/schemas/BenefitDiscord'
          downloadables: '#/components/schemas/BenefitDownloadables'
          feature_flag: '#/components/schemas/BenefitFeatureFlag'
          github_repository: '#/components/schemas/BenefitGitHubRepository'
          license_keys: '#/components/schemas/BenefitLicenseKeys'
          meter_credit: '#/components/schemas/BenefitMeterCredit'
          slack_shared_channel: '#/components/schemas/BenefitSlackSharedChannel'
    BenefitCreate:
      oneOf:
        - $ref: '#/components/schemas/BenefitCustomCreate'
        - $ref: '#/components/schemas/BenefitDiscordCreate'
        - $ref: '#/components/schemas/BenefitGitHubRepositoryCreate'
        - $ref: '#/components/schemas/BenefitDownloadablesCreate'
        - $ref: '#/components/schemas/BenefitLicenseKeysCreate'
        - $ref: '#/components/schemas/BenefitMeterCreditCreate'
        - $ref: '#/components/schemas/BenefitFeatureFlagCreate'
        - $ref: '#/components/schemas/BenefitSlackSharedChannelCreate'
      discriminator:
        propertyName: type
        mapping:
          custom: '#/components/schemas/BenefitCustomCreate'
          discord: '#/components/schemas/BenefitDiscordCreate'
          downloadables: '#/components/schemas/BenefitDownloadablesCreate'
          feature_flag: '#/components/schemas/BenefitFeatureFlagCreate'
          github_repository: '#/components/schemas/BenefitGitHubRepositoryCreate'
          license_keys: '#/components/schemas/BenefitLicenseKeysCreate'
          meter_credit: '#/components/schemas/BenefitMeterCreditCreate'
          slack_shared_channel: '#/components/schemas/BenefitSlackSharedChannelCreate'
    BenefitCustom:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitCustomProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitCustom
      description: |-
        A benefit of type `custom`.

        Use it to grant any kind of benefit that doesn't fit in the other types.
    BenefitCustomCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          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.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitCustomCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitCustomCreate
      description: Schema to create a benefit of type `custom`.
    BenefitCustomCreateProperties:
      properties:
        note:
          anyOf:
            - anyOf:
                - type: string
                - type: 'null'
              description: >-
                Private note to be shared with customers who have this benefit
                granted.
            - type: 'null'
          title: Note
      type: object
      title: BenefitCustomCreateProperties
      description: Properties for creating a benefit of type `custom`.
    BenefitCustomProperties:
      properties:
        note:
          anyOf:
            - anyOf:
                - type: string
                - type: 'null'
              description: >-
                Private note to be shared with customers who have this benefit
                granted.
            - type: 'null'
          title: Note
      type: object
      required:
        - note
      title: BenefitCustomProperties
      description: Properties for a benefit of type `custom`.
    BenefitCustomSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitCustomSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitCustomSubscriber
    BenefitCustomSubscriberProperties:
      properties:
        note:
          anyOf:
            - anyOf:
                - type: string
                - type: 'null'
              description: >-
                Private note to be shared with customers who have this benefit
                granted.
            - type: 'null'
          title: Note
      type: object
      required:
        - note
      title: BenefitCustomSubscriberProperties
      description: Properties available to subscribers for a benefit of type `custom`.
    BenefitCustomUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: custom
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitCustomProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitCustomUpdate
    BenefitCycledEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: benefit.cycled
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BenefitGrantMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BenefitCycledEvent
      description: An event created by Polar when a benefit is cycled.
    BenefitDiscord:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitDiscordProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitDiscord
      description: |-
        A benefit of type `discord`.

        Use it to automatically invite your backers to a Discord server.
    BenefitDiscordCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: discord
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitDiscordCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitDiscordCreate
    BenefitDiscordCreateProperties:
      properties:
        guild_token:
          type: string
          title: Guild Token
        role_id:
          type: string
          title: Role Id
          description: The ID of the Discord role to grant.
        kick_member:
          type: boolean
          title: Kick Member
          description: Whether to kick the member from the Discord server on revocation.
      type: object
      required:
        - guild_token
        - role_id
        - kick_member
      title: BenefitDiscordCreateProperties
      description: Properties to create a benefit of type `discord`.
    BenefitDiscordProperties:
      properties:
        guild_id:
          type: string
          title: Guild Id
          description: The ID of the Discord server.
        role_id:
          type: string
          title: Role Id
          description: The ID of the Discord role to grant.
        kick_member:
          type: boolean
          title: Kick Member
          description: Whether to kick the member from the Discord server on revocation.
        guild_token:
          type: string
          title: Guild Token
      type: object
      required:
        - guild_id
        - role_id
        - kick_member
        - guild_token
      title: BenefitDiscordProperties
      description: Properties for a benefit of type `discord`.
    BenefitDiscordSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitDiscordSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitDiscordSubscriber
    BenefitDiscordSubscriberProperties:
      properties:
        guild_id:
          type: string
          title: Guild Id
          description: The ID of the Discord server.
      type: object
      required:
        - guild_id
      title: BenefitDiscordSubscriberProperties
      description: Properties available to subscribers for a benefit of type `discord`.
    BenefitDiscordUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: discord
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitDiscordCreateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitDiscordUpdate
    BenefitDownloadables:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitDownloadablesProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitDownloadables
    BenefitDownloadablesCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: downloadables
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitDownloadablesCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitDownloadablesCreate
    BenefitDownloadablesCreateProperties:
      properties:
        archived:
          additionalProperties:
            type: boolean
          propertyNames:
            format: uuid4
          type: object
          title: Archived
          default: {}
        files:
          items:
            type: string
            format: uuid4
          type: array
          minItems: 1
          title: Files
      type: object
      required:
        - files
      title: BenefitDownloadablesCreateProperties
    BenefitDownloadablesProperties:
      properties:
        archived:
          additionalProperties:
            type: boolean
          propertyNames:
            format: uuid4
          type: object
          title: Archived
        files:
          items:
            type: string
            format: uuid4
          type: array
          title: Files
      type: object
      required:
        - archived
        - files
      title: BenefitDownloadablesProperties
    BenefitDownloadablesSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitDownloadablesSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitDownloadablesSubscriber
    BenefitDownloadablesSubscriberProperties:
      properties:
        active_files:
          items:
            type: string
            format: uuid4
          type: array
          title: Active Files
      type: object
      required:
        - active_files
      title: BenefitDownloadablesSubscriberProperties
    BenefitDownloadablesUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: downloadables
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitDownloadablesCreateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitDownloadablesUpdate
    BenefitFeatureFlag:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: feature_flag
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitFeatureFlagProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitFeatureFlag
      description: |-
        A benefit of type `feature_flag`.

        Use it to grant feature flags with key-value metadata
        that can be queried via the API and webhooks.
    BenefitFeatureFlagCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: feature_flag
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitFeatureFlagCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitFeatureFlagCreate
      description: Schema to create a benefit of type `feature_flag`.
    BenefitFeatureFlagCreateProperties:
      properties: {}
      type: object
      title: BenefitFeatureFlagCreateProperties
      description: Properties for creating a benefit of type `feature_flag`.
    BenefitFeatureFlagProperties:
      properties: {}
      type: object
      title: BenefitFeatureFlagProperties
      description: Properties for a benefit of type `feature_flag`.
    BenefitFeatureFlagSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: feature_flag
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitFeatureFlagSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitFeatureFlagSubscriber
    BenefitFeatureFlagSubscriberProperties:
      properties: {}
      type: object
      title: BenefitFeatureFlagSubscriberProperties
      description: >-
        Properties available to subscribers for a benefit of type
        `feature_flag`.
    BenefitFeatureFlagUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: feature_flag
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitFeatureFlagProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitFeatureFlagUpdate
    BenefitGitHubRepository:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: github_repository
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitGitHubRepositoryProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitGitHubRepository
      description: >-
        A benefit of type `github_repository`.


        Use it to automatically invite your backers to a private GitHub
        repository.
    BenefitGitHubRepositoryCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitGitHubRepositoryCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitGitHubRepositoryCreate
    BenefitGitHubRepositoryCreateProperties:
      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
        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_owner
        - repository_name
        - permission
      title: BenefitGitHubRepositoryCreateProperties
      description: Properties to create a benefit of type `github_repository`.
    BenefitGitHubRepositoryProperties:
      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
        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_owner
        - repository_name
        - permission
      title: BenefitGitHubRepositoryProperties
      description: Properties for a benefit of type `github_repository`.
    BenefitGitHubRepositorySubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: github_repository
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitGitHubRepositorySubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - 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:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: github_repository
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGitHubRepositoryCreateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitGitHubRepositoryUpdate
    BenefitGrant:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/Benefit'
          title: Benefit
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantDiscordProperties'
            - $ref: '#/components/schemas/BenefitGrantGitHubRepositoryProperties'
            - $ref: '#/components/schemas/BenefitGrantDownloadablesProperties'
            - $ref: '#/components/schemas/BenefitGrantLicenseKeysProperties'
            - $ref: '#/components/schemas/BenefitGrantCustomProperties'
            - $ref: '#/components/schemas/BenefitGrantFeatureFlagProperties'
            - $ref: '#/components/schemas/BenefitGrantSlackSharedChannelProperties'
          title: Properties
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrant
    BenefitGrantCustomProperties:
      properties: {}
      type: object
      title: BenefitGrantCustomProperties
    BenefitGrantCustomWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitCustom'
        properties:
          $ref: '#/components/schemas/BenefitGrantCustomProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantCustomProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantCustomWebhook
    BenefitGrantDiscordProperties:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        guild_id:
          type: string
          title: Guild Id
        role_id:
          type: string
          title: Role Id
        granted_account_id:
          type: string
          title: Granted Account Id
      type: object
      title: BenefitGrantDiscordProperties
    BenefitGrantDiscordWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitDiscord'
        properties:
          $ref: '#/components/schemas/BenefitGrantDiscordProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantDiscordProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantDiscordWebhook
    BenefitGrantDownloadablesProperties:
      properties:
        files:
          items:
            type: string
          type: array
          title: Files
      type: object
      title: BenefitGrantDownloadablesProperties
    BenefitGrantDownloadablesWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitDownloadables'
        properties:
          $ref: '#/components/schemas/BenefitGrantDownloadablesProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantDownloadablesProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantDownloadablesWebhook
    BenefitGrantError:
      properties:
        message:
          type: string
          title: Message
        type:
          type: string
          title: Type
        timestamp:
          type: string
          title: Timestamp
      type: object
      required:
        - message
        - type
        - timestamp
      title: BenefitGrantError
    BenefitGrantFeatureFlagProperties:
      properties: {}
      type: object
      title: BenefitGrantFeatureFlagProperties
    BenefitGrantFeatureFlagWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitFeatureFlag'
        properties:
          $ref: '#/components/schemas/BenefitGrantFeatureFlagProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantFeatureFlagProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantFeatureFlagWebhook
    BenefitGrantGitHubRepositoryProperties:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        repository_owner:
          type: string
          title: Repository Owner
        repository_name:
          type: string
          title: Repository Name
        permission:
          type: string
          enum:
            - pull
            - triage
            - push
            - maintain
            - admin
          title: Permission
        granted_account_id:
          type: string
          title: Granted Account Id
      type: object
      title: BenefitGrantGitHubRepositoryProperties
    BenefitGrantGitHubRepositoryWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitGitHubRepository'
        properties:
          $ref: '#/components/schemas/BenefitGrantGitHubRepositoryProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantGitHubRepositoryProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantGitHubRepositoryWebhook
    BenefitGrantLicenseKeysProperties:
      properties:
        user_provided_key:
          type: string
          title: User Provided Key
        license_key_id:
          type: string
          title: License Key Id
        display_key:
          type: string
          title: Display Key
      type: object
      title: BenefitGrantLicenseKeysProperties
    BenefitGrantLicenseKeysWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitLicenseKeys'
        properties:
          $ref: '#/components/schemas/BenefitGrantLicenseKeysProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantLicenseKeysProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantLicenseKeysWebhook
    BenefitGrantMetadata:
      properties:
        benefit_id:
          type: string
          title: Benefit Id
        benefit_grant_id:
          type: string
          title: Benefit Grant Id
        benefit_type:
          $ref: '#/components/schemas/BenefitType'
        member_id:
          type: string
          title: Member Id
      type: object
      required:
        - benefit_id
        - benefit_grant_id
        - benefit_type
      title: BenefitGrantMetadata
    BenefitGrantMeterCreditProperties:
      properties:
        last_credited_meter_id:
          type: string
          title: Last Credited Meter Id
        last_credited_units:
          type: integer
          title: Last Credited Units
        last_credited_at:
          type: string
          title: Last Credited At
      type: object
      title: BenefitGrantMeterCreditProperties
    BenefitGrantMeterCreditWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitMeterCredit'
        properties:
          $ref: '#/components/schemas/BenefitGrantMeterCreditProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantMeterCreditProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantMeterCreditWebhook
    BenefitGrantSlackSharedChannelProperties:
      properties:
        invited_email:
          type: string
          title: Invited Email
        channel_id:
          type: string
          title: Channel Id
        channel_name:
          type: string
          title: Channel Name
        invite_id:
          type: string
          title: Invite Id
        invite_url:
          type: string
          title: Invite Url
        connected_team_id:
          type: string
          title: Connected Team Id
      type: object
      title: BenefitGrantSlackSharedChannelProperties
    BenefitGrantSlackSharedChannelWebhook:
      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 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
              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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer concerned by this grant.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: The ID of the member concerned by this grant.
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
          description: >-
            The error information if the benefit grant failed with an
            unrecoverable error.
        customer:
          $ref: '#/components/schemas/Customer'
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
        benefit:
          $ref: '#/components/schemas/BenefitSlackSharedChannel'
        properties:
          $ref: '#/components/schemas/BenefitGrantSlackSharedChannelProperties'
        previous_properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantSlackSharedChannelProperties'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - is_granted
        - is_revoked
        - subscription_id
        - order_id
        - customer_id
        - benefit_id
        - customer
        - benefit
        - properties
      title: BenefitGrantSlackSharedChannelWebhook
    BenefitGrantSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - granted_at
        - '-granted_at'
        - revoked_at
        - '-revoked_at'
      title: BenefitGrantSortProperty
    BenefitGrantWebhook:
      anyOf:
        - $ref: '#/components/schemas/BenefitGrantDiscordWebhook'
        - $ref: '#/components/schemas/BenefitGrantCustomWebhook'
        - $ref: '#/components/schemas/BenefitGrantGitHubRepositoryWebhook'
        - $ref: '#/components/schemas/BenefitGrantDownloadablesWebhook'
        - $ref: '#/components/schemas/BenefitGrantLicenseKeysWebhook'
        - $ref: '#/components/schemas/BenefitGrantMeterCreditWebhook'
        - $ref: '#/components/schemas/BenefitGrantFeatureFlagWebhook'
        - $ref: '#/components/schemas/BenefitGrantSlackSharedChannelWebhook'
    BenefitGrantedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: benefit.granted
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BenefitGrantMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BenefitGrantedEvent
      description: An event created by Polar when a benefit is granted to a customer.
    BenefitLicenseKeyActivationCreateProperties:
      properties:
        limit:
          type: integer
          maximum: 50
          exclusiveMinimum: 0
          title: Limit
        enable_customer_admin:
          type: boolean
          title: Enable Customer Admin
      type: object
      required:
        - limit
        - enable_customer_admin
      title: BenefitLicenseKeyActivationCreateProperties
    BenefitLicenseKeyActivationProperties:
      properties:
        limit:
          type: integer
          title: Limit
        enable_customer_admin:
          type: boolean
          title: Enable Customer Admin
      type: object
      required:
        - limit
        - enable_customer_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:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitLicenseKeysProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitLicenseKeys
    BenefitLicenseKeysCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: license_keys
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitLicenseKeysCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitLicenseKeysCreate
    BenefitLicenseKeysCreateProperties:
      properties:
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
        expires:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeyExpirationProperties'
            - type: 'null'
        activations:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeyActivationCreateProperties'
            - type: 'null'
        limit_usage:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Limit Usage
      type: object
      title: BenefitLicenseKeysCreateProperties
    BenefitLicenseKeysProperties:
      properties:
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
        expires:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeyExpirationProperties'
            - type: 'null'
        activations:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeyActivationProperties'
            - type: 'null'
        limit_usage:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Usage
      type: object
      required:
        - prefix
        - expires
        - activations
        - limit_usage
      title: BenefitLicenseKeysProperties
    BenefitLicenseKeysSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitLicenseKeysSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitLicenseKeysSubscriber
    BenefitLicenseKeysSubscriberProperties:
      properties:
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
        expires:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeyExpirationProperties'
            - type: 'null'
        activations:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeyActivationProperties'
            - type: 'null'
        limit_usage:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Usage
      type: object
      required:
        - prefix
        - expires
        - activations
        - limit_usage
      title: BenefitLicenseKeysSubscriberProperties
    BenefitLicenseKeysUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: license_keys
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitLicenseKeysCreateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitLicenseKeysUpdate
    BenefitMeterCredit:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: meter_credit
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitMeterCreditProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitMeterCredit
      description: |-
        A benefit of type `meter_unit`.

        Use it to grant a number of units on a specific meter.
    BenefitMeterCreditCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: meter_credit
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitMeterCreditCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitMeterCreditCreate
      description: Schema to create a benefit of type `meter_unit`.
    BenefitMeterCreditCreateProperties:
      properties:
        units:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Units
        rollover:
          type: boolean
          title: Rollover
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
      type: object
      required:
        - units
        - rollover
        - meter_id
      title: BenefitMeterCreditCreateProperties
      description: Properties for creating a benefit of type `meter_unit`.
    BenefitMeterCreditProperties:
      properties:
        units:
          type: integer
          title: Units
        rollover:
          type: boolean
          title: Rollover
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
      type: object
      required:
        - units
        - rollover
        - meter_id
      title: BenefitMeterCreditProperties
      description: Properties for a benefit of type `meter_unit`.
    BenefitMeterCreditSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: meter_credit
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitMeterCreditSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitMeterCreditSubscriber
    BenefitMeterCreditSubscriberProperties:
      properties:
        units:
          type: integer
          title: Units
        rollover:
          type: boolean
          title: Rollover
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
      type: object
      required:
        - units
        - rollover
        - meter_id
      title: BenefitMeterCreditSubscriberProperties
      description: Properties available to subscribers for a benefit of type `meter_unit`.
    BenefitMeterCreditUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: meter_credit
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitMeterCreditCreateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitMeterCreditUpdate
    BenefitPublic:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          $ref: '#/components/schemas/BenefitType'
          description: The type of the benefit.
        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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
      title: BenefitPublic
    BenefitRevokedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: benefit.revoked
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BenefitGrantMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BenefitRevokedEvent
      description: An event created by Polar when a benefit is revoked from a customer.
    BenefitSlackSharedChannel:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: slack_shared_channel
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        visibility:
          $ref: '#/components/schemas/BenefitVisibility'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitSlackSharedChannelProperties'
        visibility_configurable:
          type: boolean
          title: Visibility Configurable
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - metadata
        - visibility
        - properties
        - visibility_configurable
      title: BenefitSlackSharedChannel
    BenefitSlackSharedChannelCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: slack_shared_channel
          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.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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.**
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        properties:
          $ref: '#/components/schemas/BenefitSlackSharedChannelCreateProperties'
      type: object
      required:
        - type
        - description
        - properties
      title: BenefitSlackSharedChannelCreate
    BenefitSlackSharedChannelCreateProperties:
      properties:
        slack_integration_id:
          type: string
          format: uuid4
          title: Slack Integration Id
          description: Polar Slack integration to use for this benefit.
        channel_name_template:
          type: string
          maxLength: 80
          minLength: 1
          title: Channel Name Template
        private:
          type: boolean
          title: Private
          default: true
        welcome_message:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Welcome Message
        archive_on_revoke:
          type: boolean
          title: Archive On Revoke
          default: true
        team_invitees:
          items:
            type: string
          type: array
          title: Team Invitees
      type: object
      required:
        - slack_integration_id
        - channel_name_template
      title: BenefitSlackSharedChannelCreateProperties
    BenefitSlackSharedChannelProperties:
      properties:
        slack_integration_id:
          type: string
          format: uuid4
          title: Slack Integration Id
          description: Polar Slack integration linked to this benefit.
        channel_name_template:
          type: string
          maxLength: 80
          minLength: 1
          title: Channel Name Template
          description: >-
            Template for the channel name. Supports placeholders:
            {customer_name}, {customer_email_local}, and {metadata.<key>} for
            any value stored in customer user metadata.
        private:
          type: boolean
          title: Private
          description: Create the channel as private (recommended).
          default: true
        welcome_message:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Welcome Message
          description: Optional message posted to the channel right after creation.
        archive_on_revoke:
          type: boolean
          title: Archive On Revoke
          description: Archive the channel when the benefit is revoked.
          default: true
        team_invitees:
          items:
            type: string
          type: array
          title: Team Invitees
          description: >-
            Slack user IDs from the merchant workspace to invite to every
            channel created for this benefit.
      type: object
      required:
        - slack_integration_id
        - channel_name_template
      title: BenefitSlackSharedChannelProperties
    BenefitSlackSharedChannelSubscriber:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the benefit.
        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.
        type:
          type: string
          const: slack_shared_channel
          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.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: Whether the benefit is deleted.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the benefit.
        organization:
          $ref: '#/components/schemas/BenefitSubscriberOrganization'
        properties:
          $ref: '#/components/schemas/BenefitSlackSharedChannelSubscriberProperties'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - type
        - description
        - selectable
        - deletable
        - is_deleted
        - organization_id
        - organization
        - properties
      title: BenefitSlackSharedChannelSubscriber
    BenefitSlackSharedChannelSubscriberProperties:
      properties: {}
      type: object
      title: BenefitSlackSharedChannelSubscriberProperties
    BenefitSlackSharedChannelUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        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.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/BenefitVisibility'
            - type: 'null'
          description: The visibility of the benefit in the customer portal.
        type:
          type: string
          const: slack_shared_channel
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitSlackSharedChannelCreateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: BenefitSlackSharedChannelUpdate
    BenefitSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - description
        - '-description'
        - type
        - '-type'
        - user_order
        - '-user_order'
      title: BenefitSortProperty
    BenefitSubscriberOrganization:
      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 object.
        name:
          type: string
          title: Name
          description: Organization name shown in checkout, customer portal, emails etc.
        slug:
          type: string
          title: Slug
          description: >-
            Unique organization slug in checkout, customer portal and credit
            card statements.
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          description: Avatar URL shown in checkout, customer portal, emails etc.
        proration_behavior:
          $ref: '#/components/schemas/SubscriptionProrationBehavior'
          description: >-
            Proration behavior applied when customer updates their subscription
            from the portal.
        allow_customer_updates:
          type: boolean
          title: Allow Customer Updates
          description: >-
            Whether customers can update their subscriptions from the customer
            portal.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
        - slug
        - avatar_url
        - proration_behavior
        - allow_customer_updates
      title: BenefitSubscriberOrganization
    BenefitType:
      type: string
      enum:
        - custom
        - discord
        - github_repository
        - downloadables
        - license_keys
        - meter_credit
        - feature_flag
        - slack_shared_channel
      title: BenefitType
    BenefitUpdatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: benefit.updated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/BenefitGrantMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: BenefitUpdatedEvent
      description: An event created by Polar when a benefit is updated.
    BenefitVisibility:
      type: string
      enum:
        - draft
        - private
        - public
      title: Visibility
    BillingAddressFieldMode:
      type: string
      enum:
        - required
        - optional
        - disabled
      title: BillingAddressFieldMode
    CardPayment:
      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 object.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
          description: The payment processor.
          examples:
            - stripe
        status:
          $ref: '#/components/schemas/PaymentStatus'
          description: The payment status.
          examples:
            - succeeded
        amount:
          type: integer
          title: Amount
          description: The payment amount in cents.
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          description: The payment currency. Currently, only `usd` is supported.
          examples:
            - usd
        method:
          type: string
          const: card
          title: Method
          description: The payment method used.
          examples:
            - card
        decline_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Decline Reason
          description: Error code, if the payment was declined.
          examples:
            - insufficient_funds
        decline_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Decline Message
          description: Human-readable error message, if the payment was declined.
          examples:
            - Your card has insufficient funds.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization that owns the payment.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
          description: The ID of the checkout session associated with this payment.
          examples:
            - e4b478fa-cd25-4253-9f1f-8a41e6370ede
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
          description: The ID of the order associated with this payment.
          examples:
            - e4b478fa-cd25-4253-9f1f-8a41e6370ede
        processor_metadata:
          additionalProperties: true
          type: object
          title: Processor Metadata
          description: Additional metadata from the payment processor for internal use.
        method_metadata:
          $ref: '#/components/schemas/CardPaymentMetadata'
          description: Additional metadata for the card payment method.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - processor
        - status
        - amount
        - currency
        - method
        - decline_reason
        - decline_message
        - organization_id
        - checkout_id
        - order_id
        - method_metadata
      title: CardPayment
      description: Schema of a payment with a card payment method.
    CardPaymentMetadata:
      properties:
        brand:
          type: string
          title: Brand
          description: The brand of the card used for the payment.
          examples:
            - visa
            - amex
        last4:
          type: string
          title: Last4
          description: The last 4 digits of the card number.
          examples:
            - '4242'
      type: object
      required:
        - brand
        - last4
      title: CardPaymentMetadata
      description: Additional metadata for a card payment method.
    Checkout:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        payment_processor:
          $ref: '#/components/schemas/PaymentProcessor'
          description: Payment processor used.
        status:
          $ref: '#/components/schemas/CheckoutStatus'
          description: |2-

                    Status of the checkout session.

                    - Open: the checkout session was opened.
                    - Expired: the checkout session was expired and is no more accessible.
                    - Confirmed: the user on the checkout session clicked Pay. This is not indicative of the payment's success status.
                    - Failed: the checkout definitely failed for technical reasons and cannot be retried. In most cases, this state is never reached.
                    - Succeeded: the payment on the checkout was performed successfully.
                    
        client_secret:
          type: string
          title: Client Secret
          description: >-
            Client secret used to update and complete the checkout session from
            the client.
        url:
          type: string
          title: Url
          description: URL where the customer can access the checkout session.
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Expiration date and time of the checkout session.
        success_url:
          type: string
          title: Success Url
          description: >-
            URL where the customer will be redirected after a successful
            payment.
        return_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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.
        amount:
          type: integer
          title: Amount
          description: Amount in cents, before discounts and taxes.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: Predefined number of seats (works with seat-based pricing only)
        min_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Seats
          description: Minimum number of seats (works with seat-based pricing only)
        max_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (works with seat-based pricing only)
        discount_amount:
          type: integer
          title: Discount Amount
          description: Discount amount in cents.
        net_amount:
          type: integer
          title: Net Amount
          description: Amount in cents, after discounts but before taxes.
        tax_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tax Amount
          description: >-
            Sales tax amount in cents. If `null`, it means there is no enough
            information yet to calculate it.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehavior'
            - type: 'null'
          description: >-
            Tax behavior of the checkout. `inclusive` means the price includes
            tax, `exclusive` means tax is added on top. If `null`, tax is not
            yet calculated.
        total_amount:
          type: integer
          title: Total Amount
          description: Amount in cents, after discounts and taxes.
        currency:
          type: string
          title: Currency
          description: Currency code of the checkout session.
        allow_trial:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
        active_trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: >-
            Interval unit of the trial period, if any. This value is either set
            from the checkout, if `trial_interval` is set, or from the selected
            product.
        active_trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Active Trial Interval Count
          description: >-
            Number of interval units of the trial period, if any. This value is
            either set from the checkout, if `trial_interval_count` is set, or
            from the selected product.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: End date and time of the trial period, if any.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: ID of the organization owning the checkout session.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: ID of the product to checkout.
        product_price_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Price Id
          description: ID of the product price to checkout.
          deprecated: true
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount applied to the checkout.
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
        is_discount_applicable:
          type: boolean
          title: Is Discount Applicable
          description: >-
            Whether the discount is applicable to the checkout. Typically, free
            and custom prices are not discountable.
        is_free_product_price:
          type: boolean
          title: Is Free Product Price
          description: Whether the product price is free, regardless of discounts.
        is_payment_required:
          type: boolean
          title: Is Payment Required
          description: >-
            Whether the checkout requires payment, e.g. in case of free products
            or discounts that cover the total amount.
        is_payment_setup_required:
          type: boolean
          title: Is Payment Setup Required
          description: >-
            Whether the checkout requires setting up a payment method,
            regardless of the amount, e.g. subscriptions that have first free
            cycles.
        is_payment_form_required:
          type: boolean
          title: Is Payment Form Required
          description: >-
            Whether the checkout requires a payment form, whether because of a
            payment or payment method setup.
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
        is_business_customer:
          type: boolean
          title: Is Business Customer
          description: >-
            Whether the customer is a business or an individual. If `true`, the
            customer will be required to fill their full billing address and
            billing name.
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
          description: Name of the customer.
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
          description: Email address of the customer.
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        payment_processor_metadata:
          additionalProperties:
            type: string
          type: object
          title: Payment Processor Metadata
        billing_address_fields:
          $ref: '#/components/schemas/CheckoutBillingAddressFields'
          description: >-
            Determine which billing address fields should be disabled, optional
            or required in the checkout form.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: >-
            ID of the customer in your system. If a matching customer exists on
            Polar, the resulting order will be linked to this customer.
            Otherwise, a new customer will be created with this external ID set.
        products:
          items:
            $ref: '#/components/schemas/CheckoutProduct'
          type: array
          title: Products
          description: List of products available to select.
        product:
          anyOf:
            - $ref: '#/components/schemas/CheckoutProduct'
            - type: 'null'
          description: Product selected to checkout.
        product_price:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/LegacyRecurringProductPrice'
                - $ref: '#/components/schemas/ProductPrice'
            - type: 'null'
          title: Product Price
          description: Price of the selected product.
          deprecated: true
        prices:
          anyOf:
            - additionalProperties:
                items:
                  oneOf:
                    - $ref: '#/components/schemas/LegacyRecurringProductPrice'
                    - $ref: '#/components/schemas/ProductPrice'
                type: array
                description: List of prices for this product.
              propertyNames:
                format: uuid4
              type: object
            - type: 'null'
          title: Prices
          description: Mapping of product IDs to their list of prices.
        discount:
          anyOf:
            - oneOf:
                - $ref: >-
                    #/components/schemas/CheckoutDiscountFixedOnceForeverDuration
                - $ref: '#/components/schemas/CheckoutDiscountFixedRepeatDuration'
                - $ref: >-
                    #/components/schemas/CheckoutDiscountPercentageOnceForeverDuration
                - $ref: >-
                    #/components/schemas/CheckoutDiscountPercentageRepeatDuration
            - type: 'null'
          title: Discount
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        attached_custom_fields:
          anyOf:
            - items:
                $ref: '#/components/schemas/AttachedCustomField'
              type: array
            - type: 'null'
          title: Attached Custom Fields
        customer_metadata:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
          type: object
          title: Customer Metadata
      type: object
      required:
        - id
        - created_at
        - modified_at
        - payment_processor
        - status
        - client_secret
        - url
        - expires_at
        - success_url
        - return_url
        - embed_origin
        - amount
        - discount_amount
        - net_amount
        - tax_amount
        - tax_behavior
        - total_amount
        - currency
        - allow_trial
        - active_trial_interval
        - active_trial_interval_count
        - trial_end
        - organization_id
        - product_id
        - product_price_id
        - discount_id
        - allow_discount_codes
        - require_billing_address
        - is_discount_applicable
        - is_free_product_price
        - is_payment_required
        - is_payment_setup_required
        - is_payment_form_required
        - customer_id
        - is_business_customer
        - customer_name
        - customer_email
        - customer_ip_address
        - customer_billing_name
        - customer_billing_address
        - customer_tax_id
        - payment_processor_metadata
        - billing_address_fields
        - trial_interval
        - trial_interval_count
        - metadata
        - external_customer_id
        - products
        - product
        - product_price
        - prices
        - discount
        - subscription_id
        - attached_custom_fields
        - customer_metadata
      title: Checkout
      description: Checkout session data retrieved using an access token.
    CheckoutBillingAddressFields:
      properties:
        country:
          $ref: '#/components/schemas/BillingAddressFieldMode'
        state:
          $ref: '#/components/schemas/BillingAddressFieldMode'
        city:
          $ref: '#/components/schemas/BillingAddressFieldMode'
        postal_code:
          $ref: '#/components/schemas/BillingAddressFieldMode'
        line1:
          $ref: '#/components/schemas/BillingAddressFieldMode'
        line2:
          $ref: '#/components/schemas/BillingAddressFieldMode'
      type: object
      required:
        - country
        - state
        - city
        - postal_code
        - line1
        - line2
      title: CheckoutBillingAddressFields
    CheckoutConfirmStripe:
      properties:
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: >-
            ID of the product to checkout. Must be present in the checkout's
            product list.
        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
            present in the checkout's product list.
          deprecated: true
        amount:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Amount in cents, before discounts and taxes. Only useful for
                custom prices, it'll be ignored for fixed and free prices. 
            - type: 'null'
          title: Amount
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: Number of seats for seat-based pricing.
        is_business_customer:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Business Customer
        customer_name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Customer Name
        customer_email:
          anyOf:
            - type: string
              format: email
              description: Email address of the customer.
            - type: 'null'
          title: Customer Email
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        discount_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Discount Code
          description: Discount code to apply to the checkout.
        allow_trial:
          anyOf:
            - type: boolean
              const: false
            - type: 'null'
          title: Allow Trial
          description: >-
            Disable the trial period for the checkout session. It's mainly
            useful when the trial is blocked because the customer already
            redeemed one.
        confirmation_token_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Confirmation Token Id
          description: >-
            ID of the Stripe confirmation token. Required for fixed prices and
            custom prices.
      type: object
      title: CheckoutConfirmStripe
      description: Confirm a checkout session using a Stripe confirmation token.
    CheckoutCreate:
      $ref: '#/components/schemas/CheckoutProductsCreate'
    CheckoutCreatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: checkout.created
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/CheckoutCreatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: CheckoutCreatedEvent
      description: An event created by Polar when a checkout is created.
    CheckoutCreatedMetadata:
      properties:
        checkout_id:
          type: string
          title: Checkout Id
        checkout_status:
          type: string
          title: Checkout Status
        product_id:
          type: string
          title: Product Id
      type: object
      required:
        - checkout_id
        - checkout_status
      title: CheckoutCreatedMetadata
    CheckoutCustomerBillingAddressFields:
      properties:
        country:
          type: boolean
          title: Country
        state:
          type: boolean
          title: State
        city:
          type: boolean
          title: City
        postal_code:
          type: boolean
          title: Postal Code
        line1:
          type: boolean
          title: Line1
        line2:
          type: boolean
          title: Line2
      type: object
      required:
        - country
        - state
        - city
        - postal_code
        - line1
        - line2
      title: CheckoutCustomerBillingAddressFields
      description: 'Deprecated: Use CheckoutBillingAddressFields instead.'
    CheckoutDiscountFixedOnceForeverDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        type:
          $ref: '#/components/schemas/DiscountType'
        amount:
          type: integer
          title: Amount
          deprecated: true
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          deprecated: true
          examples:
            - usd
        amounts:
          additionalProperties:
            type: integer
          type: object
          title: Amounts
          description: Map of currency to fixed amount to discount from the total.
          examples:
            - eur: 900
              usd: 1000
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        name:
          type: string
          title: Name
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
      type: object
      required:
        - duration
        - type
        - amount
        - currency
        - amounts
        - id
        - name
        - code
      title: CheckoutDiscountFixedOnceForeverDuration
      description: Schema for a fixed amount discount that is applied once or forever.
    CheckoutDiscountFixedRepeatDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        duration_in_months:
          type: integer
          title: Duration In Months
        type:
          $ref: '#/components/schemas/DiscountType'
        amount:
          type: integer
          title: Amount
          deprecated: true
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          deprecated: true
          examples:
            - usd
        amounts:
          additionalProperties:
            type: integer
          type: object
          title: Amounts
          description: Map of currency to fixed amount to discount from the total.
          examples:
            - eur: 900
              usd: 1000
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        name:
          type: string
          title: Name
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
      type: object
      required:
        - duration
        - duration_in_months
        - type
        - amount
        - currency
        - amounts
        - id
        - name
        - code
      title: CheckoutDiscountFixedRepeatDuration
      description: |-
        Schema for a fixed amount discount that is applied on every invoice
        for a certain number of months.
    CheckoutDiscountPercentageOnceForeverDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        type:
          $ref: '#/components/schemas/DiscountType'
        basis_points:
          type: integer
          title: Basis Points
          description: >-
            Discount percentage in basis points. A basis point is 1/100th of a
            percent. For example, 1000 basis points equals a 10% discount.
          examples:
            - 1000
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        name:
          type: string
          title: Name
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
      type: object
      required:
        - duration
        - type
        - basis_points
        - id
        - name
        - code
      title: CheckoutDiscountPercentageOnceForeverDuration
      description: Schema for a percentage discount that is applied once or forever.
    CheckoutDiscountPercentageRepeatDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        duration_in_months:
          type: integer
          title: Duration In Months
        type:
          $ref: '#/components/schemas/DiscountType'
        basis_points:
          type: integer
          title: Basis Points
          description: >-
            Discount percentage in basis points. A basis point is 1/100th of a
            percent. For example, 1000 basis points equals a 10% discount.
          examples:
            - 1000
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        name:
          type: string
          title: Name
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
      type: object
      required:
        - duration
        - duration_in_months
        - type
        - basis_points
        - id
        - name
        - code
      title: CheckoutDiscountPercentageRepeatDuration
      description: |-
        Schema for a percentage discount that is applied on every invoice
        for a certain number of months.
    CheckoutForbiddenError:
      anyOf:
        - $ref: '#/components/schemas/AlreadyActiveSubscriptionError'
        - $ref: '#/components/schemas/NotOpenCheckout'
        - $ref: '#/components/schemas/PaymentNotReady'
        - $ref: '#/components/schemas/TrialAlreadyRedeemed'
    CheckoutLink:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        payment_processor:
          $ref: '#/components/schemas/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
            - type: 'null'
          title: Success Url
          description: >-
            URL where the customer will be redirected after a successful
            payment.
        return_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: Optional label to distinguish links internally
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: >-
            ID of the discount to apply to the checkout. If the discount is not
            applicable anymore when opening the checkout link, it'll be ignored.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: >-
            Preconfigured number of seats for seat-based pricing. When set,
            checkout sessions created from this link are locked to this number
            of seats and the customer won't be able to change it. All products
            on the link must use seat-based pricing and allow this number of
            seats. If the products no longer accommodate this value when the
            link is opened, it'll be ignored.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        products:
          items:
            $ref: '#/components/schemas/CheckoutLinkProduct'
          type: array
          title: Products
        discount:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/DiscountFixedOnceForeverDurationBase'
                - $ref: '#/components/schemas/DiscountFixedRepeatDurationBase'
                - $ref: >-
                    #/components/schemas/DiscountPercentageOnceForeverDurationBase
                - $ref: '#/components/schemas/DiscountPercentageRepeatDurationBase'
              title: CheckoutLinkDiscount
            - type: 'null'
          title: Discount
        url:
          type: string
          title: Url
      type: object
      required:
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - metadata
        - payment_processor
        - client_secret
        - success_url
        - return_url
        - label
        - allow_discount_codes
        - require_billing_address
        - discount_id
        - seats
        - organization_id
        - products
        - discount
        - url
      title: CheckoutLink
      description: Checkout link data.
    CheckoutLinkCreate:
      anyOf:
        - $ref: '#/components/schemas/CheckoutLinkCreateProductPrice'
        - $ref: '#/components/schemas/CheckoutLinkCreateProduct'
        - $ref: '#/components/schemas/CheckoutLinkCreateProducts'
    CheckoutLinkCreateProduct:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        payment_processor:
          type: string
          const: stripe
          title: Payment Processor
          description: Payment processor to use. Currently only Stripe is supported.
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: Optional label to distinguish links internally
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
          default: true
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting.
          default: false
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: >-
            ID of the discount to apply to the checkout. If the discount is not
            applicable anymore when opening the checkout link, it'll be ignored.
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: >-
            Preconfigured number of seats for seat-based pricing. When set,
            checkout sessions created from this link are locked to this number
            of seats and the customer won't be able to change it. All products
            on the link must use seat-based pricing and allow this number of
            seats. If the products no longer accommodate this value when the
            link is opened, it'll be ignored.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        product_id:
          type: string
          format: uuid4
          title: Product Id
      type: object
      required:
        - payment_processor
        - product_id
      title: CheckoutLinkCreateProduct
      description: |-
        Schema to create a new checkout link from a a single product.

        **Deprecated**: Use `CheckoutLinkCreateProducts` instead.
    CheckoutLinkCreateProductPrice:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        payment_processor:
          type: string
          const: stripe
          title: Payment Processor
          description: Payment processor to use. Currently only Stripe is supported.
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: Optional label to distinguish links internally
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
          default: true
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting.
          default: false
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: >-
            ID of the discount to apply to the checkout. If the discount is not
            applicable anymore when opening the checkout link, it'll be ignored.
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: >-
            Preconfigured number of seats for seat-based pricing. When set,
            checkout sessions created from this link are locked to this number
            of seats and the customer won't be able to change it. All products
            on the link must use seat-based pricing and allow this number of
            seats. If the products no longer accommodate this value when the
            link is opened, it'll be ignored.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        product_price_id:
          type: string
          format: uuid4
          title: Product Price Id
      type: object
      required:
        - payment_processor
        - product_price_id
      title: CheckoutLinkCreateProductPrice
      description: |-
        Schema to create a new checkout link from a a single product price.

        **Deprecated**: Use `CheckoutLinkCreateProducts` instead.
    CheckoutLinkCreateProducts:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        payment_processor:
          type: string
          const: stripe
          title: Payment Processor
          description: Payment processor to use. Currently only Stripe is supported.
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: Optional label to distinguish links internally
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
          default: true
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting.
          default: false
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: >-
            ID of the discount to apply to the checkout. If the discount is not
            applicable anymore when opening the checkout link, it'll be ignored.
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: >-
            Preconfigured number of seats for seat-based pricing. When set,
            checkout sessions created from this link are locked to this number
            of seats and the customer won't be able to change it. All products
            on the link must use seat-based pricing and allow this number of
            seats. If the products no longer accommodate this value when the
            link is opened, it'll be ignored.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        products:
          items:
            type: string
            format: uuid4
          type: array
          minItems: 1
          title: Products
          description: List of products that will be available to select at checkout.
      type: object
      required:
        - payment_processor
        - products
      title: CheckoutLinkCreateProducts
      description: Schema to create a new checkout link.
    CheckoutLinkProduct:
      properties:
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of prices for this product.
        benefits:
          items:
            $ref: '#/components/schemas/BenefitPublic'
          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
      required:
        - metadata
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
        - prices
        - benefits
        - medias
      title: CheckoutLinkProduct
      description: Product data for a checkout link.
    CheckoutLinkSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - label
        - '-label'
        - success_url
        - '-success_url'
        - allow_discount_codes
        - '-allow_discount_codes'
      title: CheckoutLinkSortProperty
    CheckoutLinkUpdate:
      properties:
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        products:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
              minItems: 1
            - type: 'null'
          title: Products
          description: List of products that will be available to select at checkout.
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        allow_discount_codes:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
        require_billing_address:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: >-
            ID of the discount to apply to the checkout. If the discount is not
            applicable anymore when opening the checkout link, it'll be ignored.
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: >-
            Preconfigured number of seats for seat-based pricing. When set,
            checkout sessions created from this link are locked to this number
            of seats and the customer won't be able to change it. All products
            on the link must use seat-based pricing and allow this number of
            seats. If the products no longer accommodate this value when the
            link is opened, it'll be ignored.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
      type: object
      title: CheckoutLinkUpdate
      description: Schema to update an existing checkout link.
    CheckoutOrganization:
      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 object.
        name:
          type: string
          title: Name
          description: Organization name shown in checkout, customer portal, emails etc.
        slug:
          type: string
          title: Slug
          description: >-
            Unique organization slug in checkout, customer portal and credit
            card statements.
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          description: Avatar URL shown in checkout, customer portal, emails etc.
        proration_behavior:
          $ref: '#/components/schemas/SubscriptionProrationBehavior'
          description: >-
            Proration behavior applied when customer updates their subscription
            from the portal.
        allow_customer_updates:
          type: boolean
          title: Allow Customer Updates
          description: >-
            Whether customers can update their subscriptions from the customer
            portal.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
        - slug
        - avatar_url
        - proration_behavior
        - allow_customer_updates
      title: CheckoutOrganization
    CheckoutPriceCreate:
      properties:
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount to apply to the checkout.
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
          default: true
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
          default: false
        amount:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Amount in cents, before discounts and taxes. Only useful for
                custom prices, it'll be ignored for fixed and free prices. 
            - type: 'null'
          title: Amount
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: Predefined number of seats (works with seat-based pricing only)
        min_seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Min Seats
          description: Minimum number of seats (works with seat-based pricing only)
        max_seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (works with seat-based pricing only)
        allow_trial:
          type: boolean
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
          default: true
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of an existing customer in the organization. The customer data
            will be pre-filled in the checkout form. The resulting order will be
            linked to this customer.
        is_business_customer:
          type: boolean
          title: Is Business Customer
          description: >-
            Whether the customer is a business or an individual. If `true`, the
            customer will be required to fill their full billing address and
            billing name.
          default: false
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: >-
            ID of the customer in your system. If a matching customer exists on
            Polar, the resulting order will be linked to this customer.
            Otherwise, a new customer will be created with this external ID set.
        customer_name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Customer Name
        customer_email:
          anyOf:
            - type: string
              format: email
              description: Email address of the customer.
            - type: 'null'
          title: Customer Email
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        customer_metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Customer Metadata
          description: >-
            Key-value object allowing you to store additional information
            that'll be copied to the created customer.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
          description: >-
            ID of a subscription to upgrade. It must be on a free pricing. If
            checkout is successful, metadata set on this checkout will be copied
            to the subscription, and existing keys will be overwritten.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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.
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        product_price_id:
          type: string
          format: uuid4
          title: Product Price Id
          description: ID of the product price to checkout.
      type: object
      required:
        - product_price_id
      title: CheckoutPriceCreate
      description: |-
        Create a new checkout session from a product price.

        **Deprecated**: Use `CheckoutProductsCreate` instead.

        Metadata set on the checkout will be copied
        to the resulting order and/or subscription.
    CheckoutProduct:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of prices for this product.
        benefits:
          items:
            $ref: '#/components/schemas/BenefitPublic'
          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
      required:
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
        - prices
        - benefits
        - medias
      title: CheckoutProduct
      description: Product data for a checkout session.
    CheckoutProductCreate:
      properties:
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount to apply to the checkout.
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
          default: true
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
          default: false
        amount:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Amount in cents, before discounts and taxes. Only useful for
                custom prices, it'll be ignored for fixed and free prices. 
            - type: 'null'
          title: Amount
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: Predefined number of seats (works with seat-based pricing only)
        min_seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Min Seats
          description: Minimum number of seats (works with seat-based pricing only)
        max_seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (works with seat-based pricing only)
        allow_trial:
          type: boolean
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
          default: true
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of an existing customer in the organization. The customer data
            will be pre-filled in the checkout form. The resulting order will be
            linked to this customer.
        is_business_customer:
          type: boolean
          title: Is Business Customer
          description: >-
            Whether the customer is a business or an individual. If `true`, the
            customer will be required to fill their full billing address and
            billing name.
          default: false
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: >-
            ID of the customer in your system. If a matching customer exists on
            Polar, the resulting order will be linked to this customer.
            Otherwise, a new customer will be created with this external ID set.
        customer_name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Customer Name
        customer_email:
          anyOf:
            - type: string
              format: email
              description: Email address of the customer.
            - type: 'null'
          title: Customer Email
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        customer_metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Customer Metadata
          description: >-
            Key-value object allowing you to store additional information
            that'll be copied to the created customer.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
          description: >-
            ID of a subscription to upgrade. It must be on a free pricing. If
            checkout is successful, metadata set on this checkout will be copied
            to the subscription, and existing keys will be overwritten.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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.
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        currency:
          anyOf:
            - $ref: '#/components/schemas/PresentmentCurrency'
              maxLength: 3
              minLength: 3
            - type: 'null'
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: >-
            ID of the product to checkout. First available price will be
            selected.
      type: object
      required:
        - product_id
      title: CheckoutProductCreate
      description: |-
        Create a new checkout session from a product.

        **Deprecated**: Use `CheckoutProductsCreate` instead.

        Metadata set on the checkout will be copied
        to the resulting order and/or subscription.
    CheckoutProductsCreate:
      properties:
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount to apply to the checkout.
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
          default: true
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
          default: false
        amount:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Amount in cents, before discounts and taxes. Only useful for
                custom prices, it'll be ignored for fixed and free prices. 
            - type: 'null'
          title: Amount
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: Predefined number of seats (works with seat-based pricing only)
        min_seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Min Seats
          description: Minimum number of seats (works with seat-based pricing only)
        max_seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (works with seat-based pricing only)
        allow_trial:
          type: boolean
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
          default: true
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of an existing customer in the organization. The customer data
            will be pre-filled in the checkout form. The resulting order will be
            linked to this customer.
        is_business_customer:
          type: boolean
          title: Is Business Customer
          description: >-
            Whether the customer is a business or an individual. If `true`, the
            customer will be required to fill their full billing address and
            billing name.
          default: false
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: >-
            ID of the customer in your system. If a matching customer exists on
            Polar, the resulting order will be linked to this customer.
            Otherwise, a new customer will be created with this external ID set.
        customer_name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Customer Name
        customer_email:
          anyOf:
            - type: string
              format: email
              description: Email address of the customer.
            - type: 'null'
          title: Customer Email
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        customer_metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Customer Metadata
          description: >-
            Key-value object allowing you to store additional information
            that'll be copied to the created customer.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
          description: >-
            ID of a subscription to upgrade. It must be on a free pricing. If
            checkout is successful, metadata set on this checkout will be copied
            to the subscription, and existing keys will be overwritten.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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.
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        currency:
          anyOf:
            - $ref: '#/components/schemas/PresentmentCurrency'
              maxLength: 3
              minLength: 3
            - type: 'null'
        products:
          items:
            type: string
            format: uuid4
          type: array
          minItems: 1
          title: Products
          description: >-
            List of product IDs available to select at that checkout. The first
            one will be selected by default.
        prices:
          anyOf:
            - additionalProperties:
                items:
                  oneOf:
                    - $ref: '#/components/schemas/ProductPriceFixedCreate'
                    - $ref: '#/components/schemas/ProductPriceCustomCreate'
                    - $ref: '#/components/schemas/ProductPriceFreeCreate'
                    - $ref: '#/components/schemas/ProductPriceSeatBasedCreate'
                    - $ref: '#/components/schemas/ProductPriceMeteredUnitCreate'
                  discriminator:
                    propertyName: amount_type
                    mapping:
                      custom: '#/components/schemas/ProductPriceCustomCreate'
                      fixed: '#/components/schemas/ProductPriceFixedCreate'
                      free: '#/components/schemas/ProductPriceFreeCreate'
                      metered_unit: '#/components/schemas/ProductPriceMeteredUnitCreate'
                      seat_based: '#/components/schemas/ProductPriceSeatBasedCreate'
                type: array
                minItems: 1
                description: >-
                  List of prices for the product. At most one fixed price and
                  one seat-based price may be combined (billed as `fixed +
                  seat_charge`), or a single custom or free price may stand
                  alone, plus any number of metered prices. A free price cannot
                  be combined with other prices, and a custom price cannot be
                  combined with a fixed or seat-based price.
              propertyNames:
                format: uuid4
              type: object
            - type: 'null'
          title: Prices
          description: >-
            Optional mapping of product IDs to a list of ad-hoc prices to create
            for that product. If not set, catalog prices of the product will be
            used.
      type: object
      required:
        - products
      title: CheckoutProductsCreate
      description: |-
        Create a new checkout session from a list of products.
        Customers will be able to switch between those products.

        Metadata set on the checkout will be copied
        to the resulting order and/or subscription.
    CheckoutPublic:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        payment_processor:
          $ref: '#/components/schemas/PaymentProcessor'
          description: Payment processor used.
        status:
          $ref: '#/components/schemas/CheckoutStatus'
          description: |2-

                    Status of the checkout session.

                    - Open: the checkout session was opened.
                    - Expired: the checkout session was expired and is no more accessible.
                    - Confirmed: the user on the checkout session clicked Pay. This is not indicative of the payment's success status.
                    - Failed: the checkout definitely failed for technical reasons and cannot be retried. In most cases, this state is never reached.
                    - Succeeded: the payment on the checkout was performed successfully.
                    
        client_secret:
          type: string
          title: Client Secret
          description: >-
            Client secret used to update and complete the checkout session from
            the client.
        url:
          type: string
          title: Url
          description: URL where the customer can access the checkout session.
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Expiration date and time of the checkout session.
        success_url:
          type: string
          title: Success Url
          description: >-
            URL where the customer will be redirected after a successful
            payment.
        return_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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.
        amount:
          type: integer
          title: Amount
          description: Amount in cents, before discounts and taxes.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: Predefined number of seats (works with seat-based pricing only)
        min_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Seats
          description: Minimum number of seats (works with seat-based pricing only)
        max_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (works with seat-based pricing only)
        discount_amount:
          type: integer
          title: Discount Amount
          description: Discount amount in cents.
        net_amount:
          type: integer
          title: Net Amount
          description: Amount in cents, after discounts but before taxes.
        tax_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tax Amount
          description: >-
            Sales tax amount in cents. If `null`, it means there is no enough
            information yet to calculate it.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehavior'
            - type: 'null'
          description: >-
            Tax behavior of the checkout. `inclusive` means the price includes
            tax, `exclusive` means tax is added on top. If `null`, tax is not
            yet calculated.
        total_amount:
          type: integer
          title: Total Amount
          description: Amount in cents, after discounts and taxes.
        currency:
          type: string
          title: Currency
          description: Currency code of the checkout session.
        allow_trial:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
        active_trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: >-
            Interval unit of the trial period, if any. This value is either set
            from the checkout, if `trial_interval` is set, or from the selected
            product.
        active_trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Active Trial Interval Count
          description: >-
            Number of interval units of the trial period, if any. This value is
            either set from the checkout, if `trial_interval_count` is set, or
            from the selected product.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: End date and time of the trial period, if any.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: ID of the organization owning the checkout session.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: ID of the product to checkout.
        product_price_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Price Id
          description: ID of the product price to checkout.
          deprecated: true
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount applied to the checkout.
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
        is_discount_applicable:
          type: boolean
          title: Is Discount Applicable
          description: >-
            Whether the discount is applicable to the checkout. Typically, free
            and custom prices are not discountable.
        is_free_product_price:
          type: boolean
          title: Is Free Product Price
          description: Whether the product price is free, regardless of discounts.
        is_payment_required:
          type: boolean
          title: Is Payment Required
          description: >-
            Whether the checkout requires payment, e.g. in case of free products
            or discounts that cover the total amount.
        is_payment_setup_required:
          type: boolean
          title: Is Payment Setup Required
          description: >-
            Whether the checkout requires setting up a payment method,
            regardless of the amount, e.g. subscriptions that have first free
            cycles.
        is_payment_form_required:
          type: boolean
          title: Is Payment Form Required
          description: >-
            Whether the checkout requires a payment form, whether because of a
            payment or payment method setup.
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
        is_business_customer:
          type: boolean
          title: Is Business Customer
          description: >-
            Whether the customer is a business or an individual. If `true`, the
            customer will be required to fill their full billing address and
            billing name.
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
          description: Name of the customer.
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
          description: Email address of the customer.
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        payment_processor_metadata:
          additionalProperties:
            type: string
          type: object
          title: Payment Processor Metadata
        billing_address_fields:
          $ref: '#/components/schemas/CheckoutBillingAddressFields'
          description: >-
            Determine which billing address fields should be disabled, optional
            or required in the checkout form.
        products:
          items:
            $ref: '#/components/schemas/CheckoutProduct'
          type: array
          title: Products
          description: List of products available to select.
        product:
          anyOf:
            - $ref: '#/components/schemas/CheckoutProduct'
            - type: 'null'
          description: Product selected to checkout.
        product_price:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/LegacyRecurringProductPrice'
                - $ref: '#/components/schemas/ProductPrice'
            - type: 'null'
          title: Product Price
          description: Price of the selected product.
          deprecated: true
        prices:
          anyOf:
            - additionalProperties:
                items:
                  oneOf:
                    - $ref: '#/components/schemas/LegacyRecurringProductPrice'
                    - $ref: '#/components/schemas/ProductPrice'
                type: array
                description: List of prices for this product.
              propertyNames:
                format: uuid4
              type: object
            - type: 'null'
          title: Prices
          description: Mapping of product IDs to their list of prices.
        discount:
          anyOf:
            - oneOf:
                - $ref: >-
                    #/components/schemas/CheckoutDiscountFixedOnceForeverDuration
                - $ref: '#/components/schemas/CheckoutDiscountFixedRepeatDuration'
                - $ref: >-
                    #/components/schemas/CheckoutDiscountPercentageOnceForeverDuration
                - $ref: >-
                    #/components/schemas/CheckoutDiscountPercentageRepeatDuration
            - type: 'null'
          title: Discount
        organization:
          $ref: '#/components/schemas/CheckoutOrganization'
        attached_custom_fields:
          anyOf:
            - items:
                $ref: '#/components/schemas/AttachedCustomField'
              type: array
            - type: 'null'
          title: Attached Custom Fields
      type: object
      required:
        - id
        - created_at
        - modified_at
        - payment_processor
        - status
        - client_secret
        - url
        - expires_at
        - success_url
        - return_url
        - embed_origin
        - amount
        - discount_amount
        - net_amount
        - tax_amount
        - tax_behavior
        - total_amount
        - currency
        - allow_trial
        - active_trial_interval
        - active_trial_interval_count
        - trial_end
        - organization_id
        - product_id
        - product_price_id
        - discount_id
        - allow_discount_codes
        - require_billing_address
        - is_discount_applicable
        - is_free_product_price
        - is_payment_required
        - is_payment_setup_required
        - is_payment_form_required
        - customer_id
        - is_business_customer
        - customer_name
        - customer_email
        - customer_ip_address
        - customer_billing_name
        - customer_billing_address
        - customer_tax_id
        - payment_processor_metadata
        - billing_address_fields
        - products
        - product
        - product_price
        - prices
        - discount
        - organization
        - attached_custom_fields
      title: CheckoutPublic
      description: Checkout session data retrieved using the client secret.
    CheckoutPublicConfirmed:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        payment_processor:
          $ref: '#/components/schemas/PaymentProcessor'
          description: Payment processor used.
        status:
          type: string
          const: confirmed
          title: Status
        client_secret:
          type: string
          title: Client Secret
          description: >-
            Client secret used to update and complete the checkout session from
            the client.
        url:
          type: string
          title: Url
          description: URL where the customer can access the checkout session.
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Expiration date and time of the checkout session.
        success_url:
          type: string
          title: Success Url
          description: >-
            URL where the customer will be redirected after a successful
            payment.
        return_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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.
        amount:
          type: integer
          title: Amount
          description: Amount in cents, before discounts and taxes.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: Predefined number of seats (works with seat-based pricing only)
        min_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Seats
          description: Minimum number of seats (works with seat-based pricing only)
        max_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (works with seat-based pricing only)
        discount_amount:
          type: integer
          title: Discount Amount
          description: Discount amount in cents.
        net_amount:
          type: integer
          title: Net Amount
          description: Amount in cents, after discounts but before taxes.
        tax_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tax Amount
          description: >-
            Sales tax amount in cents. If `null`, it means there is no enough
            information yet to calculate it.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehavior'
            - type: 'null'
          description: >-
            Tax behavior of the checkout. `inclusive` means the price includes
            tax, `exclusive` means tax is added on top. If `null`, tax is not
            yet calculated.
        total_amount:
          type: integer
          title: Total Amount
          description: Amount in cents, after discounts and taxes.
        currency:
          type: string
          title: Currency
          description: Currency code of the checkout session.
        allow_trial:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
        active_trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: >-
            Interval unit of the trial period, if any. This value is either set
            from the checkout, if `trial_interval` is set, or from the selected
            product.
        active_trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Active Trial Interval Count
          description: >-
            Number of interval units of the trial period, if any. This value is
            either set from the checkout, if `trial_interval_count` is set, or
            from the selected product.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: End date and time of the trial period, if any.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: ID of the organization owning the checkout session.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: ID of the product to checkout.
        product_price_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Price Id
          description: ID of the product price to checkout.
          deprecated: true
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount applied to the checkout.
        allow_discount_codes:
          type: boolean
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
        require_billing_address:
          type: boolean
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
        is_discount_applicable:
          type: boolean
          title: Is Discount Applicable
          description: >-
            Whether the discount is applicable to the checkout. Typically, free
            and custom prices are not discountable.
        is_free_product_price:
          type: boolean
          title: Is Free Product Price
          description: Whether the product price is free, regardless of discounts.
        is_payment_required:
          type: boolean
          title: Is Payment Required
          description: >-
            Whether the checkout requires payment, e.g. in case of free products
            or discounts that cover the total amount.
        is_payment_setup_required:
          type: boolean
          title: Is Payment Setup Required
          description: >-
            Whether the checkout requires setting up a payment method,
            regardless of the amount, e.g. subscriptions that have first free
            cycles.
        is_payment_form_required:
          type: boolean
          title: Is Payment Form Required
          description: >-
            Whether the checkout requires a payment form, whether because of a
            payment or payment method setup.
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
        is_business_customer:
          type: boolean
          title: Is Business Customer
          description: >-
            Whether the customer is a business or an individual. If `true`, the
            customer will be required to fill their full billing address and
            billing name.
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
          description: Name of the customer.
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
          description: Email address of the customer.
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        payment_processor_metadata:
          additionalProperties:
            type: string
          type: object
          title: Payment Processor Metadata
        billing_address_fields:
          $ref: '#/components/schemas/CheckoutBillingAddressFields'
          description: >-
            Determine which billing address fields should be disabled, optional
            or required in the checkout form.
        products:
          items:
            $ref: '#/components/schemas/CheckoutProduct'
          type: array
          title: Products
          description: List of products available to select.
        product:
          anyOf:
            - $ref: '#/components/schemas/CheckoutProduct'
            - type: 'null'
          description: Product selected to checkout.
        product_price:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/LegacyRecurringProductPrice'
                - $ref: '#/components/schemas/ProductPrice'
            - type: 'null'
          title: Product Price
          description: Price of the selected product.
          deprecated: true
        prices:
          anyOf:
            - additionalProperties:
                items:
                  oneOf:
                    - $ref: '#/components/schemas/LegacyRecurringProductPrice'
                    - $ref: '#/components/schemas/ProductPrice'
                type: array
                description: List of prices for this product.
              propertyNames:
                format: uuid4
              type: object
            - type: 'null'
          title: Prices
          description: Mapping of product IDs to their list of prices.
        discount:
          anyOf:
            - oneOf:
                - $ref: >-
                    #/components/schemas/CheckoutDiscountFixedOnceForeverDuration
                - $ref: '#/components/schemas/CheckoutDiscountFixedRepeatDuration'
                - $ref: >-
                    #/components/schemas/CheckoutDiscountPercentageOnceForeverDuration
                - $ref: >-
                    #/components/schemas/CheckoutDiscountPercentageRepeatDuration
            - type: 'null'
          title: Discount
        organization:
          $ref: '#/components/schemas/CheckoutOrganization'
        attached_custom_fields:
          anyOf:
            - items:
                $ref: '#/components/schemas/AttachedCustomField'
              type: array
            - type: 'null'
          title: Attached Custom Fields
        customer_session_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Session Token
      type: object
      required:
        - id
        - created_at
        - modified_at
        - payment_processor
        - status
        - client_secret
        - url
        - expires_at
        - success_url
        - return_url
        - embed_origin
        - amount
        - discount_amount
        - net_amount
        - tax_amount
        - tax_behavior
        - total_amount
        - currency
        - allow_trial
        - active_trial_interval
        - active_trial_interval_count
        - trial_end
        - organization_id
        - product_id
        - product_price_id
        - discount_id
        - allow_discount_codes
        - require_billing_address
        - is_discount_applicable
        - is_free_product_price
        - is_payment_required
        - is_payment_setup_required
        - is_payment_form_required
        - customer_id
        - is_business_customer
        - customer_name
        - customer_email
        - customer_ip_address
        - customer_billing_name
        - customer_billing_address
        - customer_tax_id
        - payment_processor_metadata
        - billing_address_fields
        - products
        - product
        - product_price
        - prices
        - discount
        - organization
        - attached_custom_fields
        - customer_session_token
      title: CheckoutPublicConfirmed
      description: >-
        Checkout session data retrieved using the client secret after
        confirmation.


        It contains a customer session token to retrieve order information

        right after the checkout.
    CheckoutSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - expires_at
        - '-expires_at'
        - status
        - '-status'
      title: CheckoutSortProperty
    CheckoutStatus:
      type: string
      enum:
        - open
        - expired
        - confirmed
        - succeeded
        - failed
      title: CheckoutStatus
    CheckoutUpdate:
      properties:
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: >-
            ID of the product to checkout. Must be present in the checkout's
            product list.
        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
            present in the checkout's product list.
          deprecated: true
        amount:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Amount in cents, before discounts and taxes. Only useful for
                custom prices, it'll be ignored for fixed and free prices. 
            - type: 'null'
          title: Amount
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: Number of seats for seat-based pricing.
        is_business_customer:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Business Customer
        customer_name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Customer Name
        customer_email:
          anyOf:
            - type: string
              format: email
              description: Email address of the customer.
            - type: 'null'
          title: Customer Email
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        currency:
          anyOf:
            - $ref: '#/components/schemas/PresentmentCurrency'
              maxLength: 3
              minLength: 3
            - type: 'null'
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: ID of the discount to apply to the checkout.
        allow_discount_codes:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Discount Codes
          description: >-
            Whether to allow the customer to apply discount codes. If you apply
            a discount through `discount_id`, it'll still be applied, but the
            customer won't be able to change it.
        require_billing_address:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Require Billing Address
          description: >-
            Whether to require the customer to fill their full billing address,
            instead of just the country. Customers in the US will always be
            required to fill their full address, regardless of this setting. If
            you preset the billing address, this setting will be automatically
            set to `true`.
        allow_trial:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Trial
          description: >-
            Whether to enable the trial period for the checkout session. If
            `false`, the trial period will be disabled, even if the selected
            product has a trial configured.
        customer_ip_address:
          anyOf:
            - type: string
              format: ipvanyaddress
            - type: 'null'
          title: Customer Ip Address
        customer_metadata:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                    maxLength: 500
                    minLength: 1
                  - type: integer
                  - type: number
                  - type: boolean
              propertyNames:
                maxLength: 40
                minLength: 1
              type: object
              maxProperties: 50
              description: >-
                Key-value object allowing you to store additional information.


                The key must be a string with a maximum length of **40
                characters**.

                The value must be either:


                * A string with a maximum length of **500 characters**

                * An integer

                * A floating-point number

                * A boolean


                You can store up to **50 key-value pairs**.
            - type: 'null'
          title: Customer Metadata
          description: >-
            Key-value object allowing you to store additional information
            that'll be copied to the created customer.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        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.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the checkout to return to
            this URL.
        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
      title: CheckoutUpdate
      description: Update an existing checkout session using an access token.
    CheckoutUpdatePublic:
      properties:
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: >-
            ID of the product to checkout. Must be present in the checkout's
            product list.
        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
            present in the checkout's product list.
          deprecated: true
        amount:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Amount in cents, before discounts and taxes. Only useful for
                custom prices, it'll be ignored for fixed and free prices. 
            - type: 'null'
          title: Amount
        seats:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Seats
          description: Number of seats for seat-based pricing.
        is_business_customer:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Business Customer
        customer_name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Customer Name
        customer_email:
          anyOf:
            - type: string
              format: email
              description: Email address of the customer.
            - type: 'null'
          title: Customer Email
        customer_billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Billing Name
        customer_billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
              description: Billing address of the customer.
            - type: 'null'
        customer_tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        discount_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Discount Code
          description: Discount code to apply to the checkout.
        allow_trial:
          anyOf:
            - type: boolean
              const: false
            - type: 'null'
          title: Allow Trial
          description: >-
            Disable the trial period for the checkout session. It's mainly
            useful when the trial is blocked because the customer already
            redeemed one.
      type: object
      title: CheckoutUpdatePublic
      description: Update an existing checkout session using the client secret.
    CostMetadata-Input:
      properties:
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: >-
                ^(?!^[-+.]*$)[+-]?0*(?:\d{0,5}|(?=[\d.]{1,18}0*$)\d{0,5}\.\d{0,12}0*$)
          title: Amount
          description: The amount in cents.
        currency:
          type: string
          pattern: usd
          title: Currency
          description: The currency. Currently, only `usd` is supported.
      type: object
      required:
        - amount
        - currency
      title: CostMetadata
    CostMetadata-Output:
      properties:
        amount:
          type: string
          pattern: >-
            ^(?!^[-+.]*$)[+-]?0*(?:\d{0,5}|(?=[\d.]{1,18}0*$)\d{0,5}\.\d{0,12}0*$)
          title: Amount
          description: The amount in cents.
        currency:
          type: string
          pattern: usd
          title: Currency
          description: The currency. Currently, only `usd` is supported.
      type: object
      required:
        - amount
        - currency
      title: CostMetadata
    CountAggregation:
      properties:
        func:
          type: string
          const: count
          title: Func
          default: count
      type: object
      title: CountAggregation
    CountryAlpha2:
      type: string
      enum:
        - AD
        - AE
        - AF
        - AG
        - AI
        - AL
        - AM
        - AO
        - AQ
        - AR
        - AS
        - AT
        - AU
        - AW
        - AX
        - AZ
        - BA
        - BB
        - BD
        - BE
        - BF
        - BG
        - BH
        - BI
        - BJ
        - BL
        - BM
        - BN
        - BO
        - BQ
        - BR
        - BS
        - BT
        - BV
        - BW
        - BY
        - BZ
        - CA
        - CC
        - CD
        - CF
        - CG
        - CH
        - CI
        - CK
        - CL
        - CM
        - CN
        - CO
        - CR
        - CU
        - CV
        - CW
        - CX
        - CY
        - CZ
        - DE
        - DJ
        - DK
        - DM
        - DO
        - DZ
        - EC
        - EE
        - EG
        - EH
        - ER
        - ES
        - ET
        - FI
        - FJ
        - FK
        - FM
        - FO
        - FR
        - GA
        - GB
        - GD
        - GE
        - GF
        - GG
        - GH
        - GI
        - GL
        - GM
        - GN
        - GP
        - GQ
        - GR
        - GS
        - GT
        - GU
        - GW
        - GY
        - HK
        - HM
        - HN
        - HR
        - HT
        - HU
        - ID
        - IE
        - IL
        - IM
        - IN
        - IO
        - IQ
        - IR
        - IS
        - IT
        - JE
        - JM
        - JO
        - JP
        - KE
        - KG
        - KH
        - KI
        - KM
        - KN
        - KP
        - KR
        - KW
        - KY
        - KZ
        - LA
        - LB
        - LC
        - LI
        - LK
        - LR
        - LS
        - LT
        - LU
        - LV
        - LY
        - MA
        - MC
        - MD
        - ME
        - MF
        - MG
        - MH
        - MK
        - ML
        - MM
        - MN
        - MO
        - MP
        - MQ
        - MR
        - MS
        - MT
        - MU
        - MV
        - MW
        - MX
        - MY
        - MZ
        - NA
        - NC
        - NE
        - NF
        - NG
        - NI
        - NL
        - 'NO'
        - NP
        - NR
        - NU
        - NZ
        - OM
        - PA
        - PE
        - PF
        - PG
        - PH
        - PK
        - PL
        - PM
        - PN
        - PR
        - PS
        - PT
        - PW
        - PY
        - QA
        - RE
        - RO
        - RS
        - RU
        - RW
        - SA
        - SB
        - SC
        - SD
        - SE
        - SG
        - SH
        - SI
        - SJ
        - SK
        - SL
        - SM
        - SN
        - SO
        - SR
        - SS
        - ST
        - SV
        - SX
        - SY
        - SZ
        - TC
        - TD
        - TF
        - TG
        - TH
        - TJ
        - TK
        - TL
        - TM
        - TN
        - TO
        - TR
        - TT
        - TV
        - TW
        - TZ
        - UA
        - UG
        - UM
        - US
        - UY
        - UZ
        - VA
        - VC
        - VE
        - VG
        - VI
        - VN
        - VU
        - WF
        - WS
        - YE
        - YT
        - ZA
        - ZM
        - ZW
      title: CountryAlpha2
    CountryAlpha2Input:
      type: string
      enum:
        - AD
        - AE
        - AF
        - AG
        - AI
        - AL
        - AM
        - AO
        - AQ
        - AR
        - AS
        - AT
        - AU
        - AW
        - AX
        - AZ
        - BA
        - BB
        - BD
        - BE
        - BF
        - BG
        - BH
        - BI
        - BJ
        - BL
        - BM
        - BN
        - BO
        - BQ
        - BR
        - BS
        - BT
        - BV
        - BW
        - BY
        - BZ
        - CA
        - CC
        - CD
        - CF
        - CG
        - CH
        - CI
        - CK
        - CL
        - CM
        - CN
        - CO
        - CR
        - CV
        - CW
        - CX
        - CY
        - CZ
        - DE
        - DJ
        - DK
        - DM
        - DO
        - DZ
        - EC
        - EE
        - EG
        - EH
        - ER
        - ES
        - ET
        - FI
        - FJ
        - FK
        - FM
        - FO
        - FR
        - GA
        - GB
        - GD
        - GE
        - GF
        - GG
        - GH
        - GI
        - GL
        - GM
        - GN
        - GP
        - GQ
        - GR
        - GS
        - GT
        - GU
        - GW
        - GY
        - HK
        - HM
        - HN
        - HR
        - HT
        - HU
        - ID
        - IE
        - IL
        - IM
        - IN
        - IO
        - IQ
        - IS
        - IT
        - JE
        - JM
        - JO
        - JP
        - KE
        - KG
        - KH
        - KI
        - KM
        - KN
        - KR
        - KW
        - KY
        - KZ
        - LA
        - LB
        - LC
        - LI
        - LK
        - LR
        - LS
        - LT
        - LU
        - LV
        - LY
        - MA
        - MC
        - MD
        - ME
        - MF
        - MG
        - MH
        - MK
        - ML
        - MM
        - MN
        - MO
        - MP
        - MQ
        - MR
        - MS
        - MT
        - MU
        - MV
        - MW
        - MX
        - MY
        - MZ
        - NA
        - NC
        - NE
        - NF
        - NG
        - NI
        - NL
        - 'NO'
        - NP
        - NR
        - NU
        - NZ
        - OM
        - PA
        - PE
        - PF
        - PG
        - PH
        - PK
        - PL
        - PM
        - PN
        - PR
        - PS
        - PT
        - PW
        - PY
        - QA
        - RE
        - RO
        - RS
        - RW
        - SA
        - SB
        - SC
        - SD
        - SE
        - SG
        - SH
        - SI
        - SJ
        - SK
        - SL
        - SM
        - SN
        - SO
        - SR
        - SS
        - ST
        - SV
        - SX
        - SZ
        - TC
        - TD
        - TF
        - TG
        - TH
        - TJ
        - TK
        - TL
        - TM
        - TN
        - TO
        - TR
        - TT
        - TV
        - TW
        - TZ
        - UA
        - UG
        - UM
        - US
        - UY
        - UZ
        - VA
        - VC
        - VE
        - VG
        - VI
        - VN
        - VU
        - WF
        - WS
        - YE
        - YT
        - ZA
        - ZM
        - ZW
      title: CountryAlpha2Input
    CursorPagination:
      properties:
        has_next_page:
          type: boolean
          title: Has Next Page
      type: object
      required:
        - has_next_page
      title: CursorPagination
    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
          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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        type:
          type: string
          const: checkbox
          title: Type
        slug:
          type: string
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value.
        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.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        properties:
          $ref: '#/components/schemas/CustomFieldCheckboxProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - metadata
        - type
        - slug
        - name
        - organization_id
        - properties
      title: CustomFieldCheckbox
      description: Schema for a custom field of type checkbox.
    CustomFieldCheckboxProperties:
      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
      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:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: checkbox
          title: Type
        slug:
          type: string
          minLength: 1
          pattern: ^[a-z0-9-_]+$
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value. Must be unique across the organization.It can only
            contain ASCII letters, numbers and hyphens.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the custom field.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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/CustomFieldCheckboxProperties'
      type: object
      required:
        - type
        - slug
        - name
        - properties
      title: CustomFieldCreateCheckbox
      description: Schema to create a custom field of type checkbox.
    CustomFieldCreateDate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: date
          title: Type
        slug:
          type: string
          minLength: 1
          pattern: ^[a-z0-9-_]+$
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value. Must be unique across the organization.It can only
            contain ASCII letters, numbers and hyphens.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the custom field.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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
        - slug
        - name
        - properties
      title: CustomFieldCreateDate
      description: Schema to create a custom field of type date.
    CustomFieldCreateNumber:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: number
          title: Type
        slug:
          type: string
          minLength: 1
          pattern: ^[a-z0-9-_]+$
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value. Must be unique across the organization.It can only
            contain ASCII letters, numbers and hyphens.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the custom field.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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/CustomFieldNumberProperties'
      type: object
      required:
        - type
        - slug
        - name
        - properties
      title: CustomFieldCreateNumber
      description: Schema to create a custom field of type number.
    CustomFieldCreateSelect:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: select
          title: Type
        slug:
          type: string
          minLength: 1
          pattern: ^[a-z0-9-_]+$
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value. Must be unique across the organization.It can only
            contain ASCII letters, numbers and hyphens.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the custom field.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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/CustomFieldSelectProperties'
      type: object
      required:
        - type
        - slug
        - name
        - properties
      title: CustomFieldCreateSelect
      description: Schema to create a custom field of type select.
    CustomFieldCreateText:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        type:
          type: string
          const: text
          title: Type
        slug:
          type: string
          minLength: 1
          pattern: ^[a-z0-9-_]+$
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value. Must be unique across the organization.It can only
            contain ASCII letters, numbers and hyphens.
        name:
          type: string
          minLength: 1
          title: Name
          description: Name of the custom field.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              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/CustomFieldTextProperties'
      type: object
      required:
        - type
        - slug
        - name
        - properties
      title: CustomFieldCreateText
      description: Schema to create a custom field of type text.
    CustomFieldDate:
      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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        type:
          type: string
          const: date
          title: Type
        slug:
          type: string
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value.
        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.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        properties:
          $ref: '#/components/schemas/CustomFieldDateProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - metadata
        - type
        - slug
        - name
        - organization_id
        - properties
      title: CustomFieldDate
      description: Schema for a custom field of type date.
    CustomFieldDateProperties:
      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
        ge:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Ge
        le:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Le
      type: object
      title: CustomFieldDateProperties
    CustomFieldNumber:
      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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        type:
          type: string
          const: number
          title: Type
        slug:
          type: string
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value.
        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.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        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
          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
        ge:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          title: Ge
        le:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          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
              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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        type:
          type: string
          const: select
          title: Type
        slug:
          type: string
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value.
        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.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          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
          minLength: 1
          title: Value
        label:
          type: string
          minLength: 1
          title: Label
      type: object
      required:
        - value
        - label
      title: CustomFieldSelectOption
    CustomFieldSelectProperties:
      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
        options:
          items:
            $ref: '#/components/schemas/CustomFieldSelectOption'
          type: array
          minItems: 1
          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.
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        type:
          type: string
          const: text
          title: Type
        slug:
          type: string
          title: Slug
          description: >-
            Identifier of the custom field. It'll be used as key when storing
            the value.
        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.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        properties:
          $ref: '#/components/schemas/CustomFieldTextProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - metadata
        - type
        - slug
        - name
        - organization_id
        - properties
      title: CustomFieldText
      description: Schema for a custom field of type text.
    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
          maximum: 2147483647
          minimum: 0
          title: Min Length
        max_length:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Max Length
      type: object
      title: CustomFieldTextProperties
    CustomFieldType:
      type: string
      enum:
        - text
        - number
        - date
        - checkbox
        - select
      title: CustomFieldType
    CustomFieldUpdate:
      oneOf:
        - $ref: '#/components/schemas/CustomFieldUpdateText'
        - $ref: '#/components/schemas/CustomFieldUpdateNumber'
        - $ref: '#/components/schemas/CustomFieldUpdateDate'
        - $ref: '#/components/schemas/CustomFieldUpdateCheckbox'
        - $ref: '#/components/schemas/CustomFieldUpdateSelect'
      discriminator:
        propertyName: type
        mapping:
          checkbox: '#/components/schemas/CustomFieldUpdateCheckbox'
          date: '#/components/schemas/CustomFieldUpdateDate'
          number: '#/components/schemas/CustomFieldUpdateNumber'
          select: '#/components/schemas/CustomFieldUpdateSelect'
          text: '#/components/schemas/CustomFieldUpdateText'
    CustomFieldUpdateCheckbox:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 1
              description: Name of the custom field.
            - type: 'null'
          title: Name
        slug:
          anyOf:
            - type: string
              minLength: 1
              pattern: ^[a-z0-9-_]+$
              description: >-
                Identifier of the custom field. It'll be used as key when
                storing the value. Must be unique across the organization.It can
                only contain ASCII letters, numbers and hyphens.
            - type: 'null'
          title: Slug
        type:
          type: string
          const: checkbox
          title: Type
        properties:
          anyOf:
            - $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:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 1
              description: Name of the custom field.
            - type: 'null'
          title: Name
        slug:
          anyOf:
            - type: string
              minLength: 1
              pattern: ^[a-z0-9-_]+$
              description: >-
                Identifier of the custom field. It'll be used as key when
                storing the value. Must be unique across the organization.It can
                only contain ASCII letters, numbers and hyphens.
            - type: 'null'
          title: Slug
        type:
          type: string
          const: date
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/CustomFieldDateProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: CustomFieldUpdateDate
      description: Schema to update a custom field of type date.
    CustomFieldUpdateNumber:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 1
              description: Name of the custom field.
            - type: 'null'
          title: Name
        slug:
          anyOf:
            - type: string
              minLength: 1
              pattern: ^[a-z0-9-_]+$
              description: >-
                Identifier of the custom field. It'll be used as key when
                storing the value. Must be unique across the organization.It can
                only contain ASCII letters, numbers and hyphens.
            - type: 'null'
          title: Slug
        type:
          type: string
          const: number
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/CustomFieldNumberProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: CustomFieldUpdateNumber
      description: Schema to update a custom field of type number.
    CustomFieldUpdateSelect:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 1
              description: Name of the custom field.
            - type: 'null'
          title: Name
        slug:
          anyOf:
            - type: string
              minLength: 1
              pattern: ^[a-z0-9-_]+$
              description: >-
                Identifier of the custom field. It'll be used as key when
                storing the value. Must be unique across the organization.It can
                only contain ASCII letters, numbers and hyphens.
            - type: 'null'
          title: Slug
        type:
          type: string
          const: select
          title: Type
        properties:
          anyOf:
            - $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:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 1
              description: Name of the custom field.
            - type: 'null'
          title: Name
        slug:
          anyOf:
            - type: string
              minLength: 1
              pattern: ^[a-z0-9-_]+$
              description: >-
                Identifier of the custom field. It'll be used as key when
                storing the value. Must be unique across the organization.It can
                only contain ASCII letters, numbers and hyphens.
            - type: 'null'
          title: Slug
        type:
          type: string
          const: text
          title: Type
        properties:
          anyOf:
            - $ref: '#/components/schemas/CustomFieldTextProperties'
            - type: 'null'
      type: object
      required:
        - type
      title: CustomFieldUpdateText
      description: Schema to update a custom field of type text.
    Customer:
      oneOf:
        - $ref: '#/components/schemas/CustomerIndividual'
        - $ref: '#/components/schemas/CustomerTeam'
      discriminator:
        propertyName: type
        mapping:
          individual: '#/components/schemas/CustomerIndividual'
          team: '#/components/schemas/CustomerTeam'
    CustomerBenefitGrant:
      anyOf:
        - $ref: '#/components/schemas/CustomerBenefitGrantDiscord'
        - $ref: '#/components/schemas/CustomerBenefitGrantGitHubRepository'
        - $ref: '#/components/schemas/CustomerBenefitGrantDownloadables'
        - $ref: '#/components/schemas/CustomerBenefitGrantLicenseKeys'
        - $ref: '#/components/schemas/CustomerBenefitGrantCustom'
        - $ref: '#/components/schemas/CustomerBenefitGrantMeterCredit'
        - $ref: '#/components/schemas/CustomerBenefitGrantFeatureFlag'
        - $ref: '#/components/schemas/CustomerBenefitGrantSlackSharedChannel'
    CustomerBenefitGrantCustom:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitCustomSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantCustomProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantCustom
    CustomerBenefitGrantCustomUpdate:
      properties:
        benefit_type:
          type: string
          const: custom
          title: Benefit Type
      type: object
      required:
        - benefit_type
      title: CustomerBenefitGrantCustomUpdate
    CustomerBenefitGrantDiscord:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitDiscordSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantDiscordProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantDiscord
    CustomerBenefitGrantDiscordPropertiesUpdate:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
      type: object
      required:
        - account_id
      title: CustomerBenefitGrantDiscordPropertiesUpdate
    CustomerBenefitGrantDiscordUpdate:
      properties:
        benefit_type:
          type: string
          const: discord
          title: Benefit Type
        properties:
          $ref: '#/components/schemas/CustomerBenefitGrantDiscordPropertiesUpdate'
      type: object
      required:
        - benefit_type
        - properties
      title: CustomerBenefitGrantDiscordUpdate
    CustomerBenefitGrantDownloadables:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitDownloadablesSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantDownloadablesProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantDownloadables
    CustomerBenefitGrantDownloadablesUpdate:
      properties:
        benefit_type:
          type: string
          const: downloadables
          title: Benefit Type
      type: object
      required:
        - benefit_type
      title: CustomerBenefitGrantDownloadablesUpdate
    CustomerBenefitGrantFeatureFlag:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitFeatureFlagSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantFeatureFlagProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantFeatureFlag
    CustomerBenefitGrantFeatureFlagUpdate:
      properties:
        benefit_type:
          type: string
          const: feature_flag
          title: Benefit Type
      type: object
      required:
        - benefit_type
      title: CustomerBenefitGrantFeatureFlagUpdate
    CustomerBenefitGrantGitHubRepository:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitGitHubRepositorySubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantGitHubRepositoryProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantGitHubRepository
    CustomerBenefitGrantGitHubRepositoryPropertiesUpdate:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
      type: object
      required:
        - account_id
      title: CustomerBenefitGrantGitHubRepositoryPropertiesUpdate
    CustomerBenefitGrantGitHubRepositoryUpdate:
      properties:
        benefit_type:
          type: string
          const: github_repository
          title: Benefit Type
        properties:
          $ref: >-
            #/components/schemas/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate
      type: object
      required:
        - benefit_type
        - properties
      title: CustomerBenefitGrantGitHubRepositoryUpdate
    CustomerBenefitGrantLicenseKeys:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitLicenseKeysSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantLicenseKeysProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantLicenseKeys
    CustomerBenefitGrantLicenseKeysUpdate:
      properties:
        benefit_type:
          type: string
          const: license_keys
          title: Benefit Type
      type: object
      required:
        - benefit_type
      title: CustomerBenefitGrantLicenseKeysUpdate
    CustomerBenefitGrantMeterCredit:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitMeterCreditSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantMeterCreditProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantMeterCredit
    CustomerBenefitGrantMeterCreditUpdate:
      properties:
        benefit_type:
          type: string
          const: meter_credit
          title: Benefit Type
      type: object
      required:
        - benefit_type
      title: CustomerBenefitGrantMeterCreditUpdate
    CustomerBenefitGrantSlackSharedChannel:
      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 object.
        granted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Granted At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
        is_granted:
          type: boolean
          title: Is Granted
        is_revoked:
          type: boolean
          title: Is Revoked
        error:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantError'
            - type: 'null'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomer'
        benefit:
          $ref: '#/components/schemas/BenefitSlackSharedChannelSubscriber'
        properties:
          $ref: '#/components/schemas/BenefitGrantSlackSharedChannelProperties'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - granted_at
        - revoked_at
        - customer_id
        - benefit_id
        - subscription_id
        - order_id
        - is_granted
        - is_revoked
        - customer
        - benefit
        - properties
      title: CustomerBenefitGrantSlackSharedChannel
    CustomerBenefitGrantSlackSharedChannelPropertiesUpdate:
      properties:
        invited_email:
          type: string
          format: email
          title: Invited Email
      type: object
      required:
        - invited_email
      title: CustomerBenefitGrantSlackSharedChannelPropertiesUpdate
    CustomerBenefitGrantSlackSharedChannelUpdate:
      properties:
        benefit_type:
          type: string
          const: slack_shared_channel
          title: Benefit Type
        properties:
          $ref: >-
            #/components/schemas/CustomerBenefitGrantSlackSharedChannelPropertiesUpdate
      type: object
      required:
        - benefit_type
        - properties
      title: CustomerBenefitGrantSlackSharedChannelUpdate
    CustomerBenefitGrantSortProperty:
      type: string
      enum:
        - granted_at
        - '-granted_at'
        - type
        - '-type'
        - organization
        - '-organization'
        - product_benefit
        - '-product_benefit'
      title: CustomerBenefitGrantSortProperty
    CustomerBenefitGrantUpdate:
      oneOf:
        - $ref: '#/components/schemas/CustomerBenefitGrantDiscordUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantGitHubRepositoryUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantDownloadablesUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantLicenseKeysUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantCustomUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantMeterCreditUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantFeatureFlagUpdate'
        - $ref: '#/components/schemas/CustomerBenefitGrantSlackSharedChannelUpdate'
      discriminator:
        propertyName: benefit_type
        mapping:
          custom: '#/components/schemas/CustomerBenefitGrantCustomUpdate'
          discord: '#/components/schemas/CustomerBenefitGrantDiscordUpdate'
          downloadables: '#/components/schemas/CustomerBenefitGrantDownloadablesUpdate'
          feature_flag: '#/components/schemas/CustomerBenefitGrantFeatureFlagUpdate'
          github_repository: '#/components/schemas/CustomerBenefitGrantGitHubRepositoryUpdate'
          license_keys: '#/components/schemas/CustomerBenefitGrantLicenseKeysUpdate'
          meter_credit: '#/components/schemas/CustomerBenefitGrantMeterCreditUpdate'
          slack_shared_channel: '#/components/schemas/CustomerBenefitGrantSlackSharedChannelUpdate'
    CustomerCancellationReason:
      type: string
      enum:
        - customer_service
        - low_quality
        - missing_features
        - switched_service
        - too_complex
        - too_expensive
        - unused
        - other
      title: CustomerCancellationReason
    CustomerCreate:
      oneOf:
        - $ref: '#/components/schemas/CustomerIndividualCreate'
        - $ref: '#/components/schemas/CustomerTeamCreate'
    CustomerCreatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: customer.created
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/CustomerCreatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: CustomerCreatedEvent
      description: An event created by Polar when a customer is created.
    CustomerCreatedMetadata:
      properties:
        customer_id:
          type: string
          title: Customer Id
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
        customer_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer External Id
      type: object
      required:
        - customer_id
        - customer_email
        - customer_name
        - customer_external_id
      title: CustomerCreatedMetadata
    CustomerCustomerMeter:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
        consumed_units:
          type: number
          title: Consumed Units
          description: The number of consumed units.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: The number of credited units.
          examples:
            - 100
        balance:
          type: number
          title: Balance
          description: >-
            The balance of the meter, i.e. the difference between credited and
            consumed units.
          examples:
            - 75
        meter:
          $ref: '#/components/schemas/CustomerCustomerMeterMeter'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - customer_id
        - meter_id
        - consumed_units
        - credited_units
        - balance
        - meter
      title: CustomerCustomerMeter
    CustomerCustomerMeterMeter:
      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 object.
        name:
          type: string
          title: Name
          description: >-
            The name of the meter. Will be shown on customer's invoices and
            usage.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
      title: CustomerCustomerMeterMeter
    CustomerCustomerMeterSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - modified_at
        - '-modified_at'
        - meter_id
        - '-meter_id'
        - meter_name
        - '-meter_name'
        - consumed_units
        - '-consumed_units'
        - credited_units
        - '-credited_units'
        - balance
        - '-balance'
      title: CustomerCustomerMeterSortProperty
    CustomerCustomerSession:
      properties:
        expires_at:
          type: string
          format: date-time
          title: Expires At
        return_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Return Url
      type: object
      required:
        - expires_at
        - return_url
      title: CustomerCustomerSession
    CustomerDeletedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: customer.deleted
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/CustomerDeletedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: CustomerDeletedEvent
      description: An event created by Polar when a customer is deleted.
    CustomerDeletedMetadata:
      properties:
        customer_id:
          type: string
          title: Customer Id
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
        customer_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer External Id
      type: object
      required:
        - customer_id
        - customer_email
        - customer_name
        - customer_external_id
      title: CustomerDeletedMetadata
    CustomerEmailUpdateRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
      type: object
      required:
        - email
      title: CustomerEmailUpdateRequest
    CustomerEmailUpdateVerifyRequest:
      properties:
        token:
          type: string
          title: Token
      type: object
      required:
        - token
      title: CustomerEmailUpdateVerifyRequest
    CustomerEmailUpdateVerifyResponse:
      properties:
        token:
          type: string
          title: Token
      type: object
      required:
        - token
      title: CustomerEmailUpdateVerifyResponse
    CustomerIndividual:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          type: string
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          type: string
          const: individual
          title: Type
          description: The type of customer.
          examples:
            - individual
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
      title: CustomerIndividual
      description: A customer in an organization.
    CustomerIndividualCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Name
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the customer. **Required unless
            you use an organization token.**
        owner:
          anyOf:
            - $ref: '#/components/schemas/MemberOwnerCreate'
            - type: 'null'
          description: >-
            Optional owner member to create with the customer. If not provided,
            an owner member will be automatically created using the customer's
            email and name.
        type:
          type: string
          const: individual
          title: Type
          default: individual
        email:
          type: string
          format: email
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
      type: object
      required:
        - email
      title: CustomerIndividualCreate
    CustomerMeter:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
        consumed_units:
          type: number
          title: Consumed Units
          description: The number of consumed units.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: The number of credited units.
          examples:
            - 100
        balance:
          type: number
          title: Balance
          description: >-
            The balance of the meter, i.e. the difference between credited and
            consumed units.
          examples:
            - 75
        customer:
          $ref: '#/components/schemas/Customer'
          description: The customer associated with this meter.
        meter:
          $ref: '#/components/schemas/Meter'
          description: The meter associated with this customer.
      type: object
      required:
        - id
        - created_at
        - modified_at
        - customer_id
        - meter_id
        - consumed_units
        - credited_units
        - balance
        - customer
        - meter
      title: CustomerMeter
      description: An active customer meter, with current consumed and credited units.
    CustomerMeterSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - modified_at
        - '-modified_at'
        - customer_id
        - '-customer_id'
        - customer_name
        - '-customer_name'
        - meter_id
        - '-meter_id'
        - meter_name
        - '-meter_name'
        - consumed_units
        - '-consumed_units'
        - credited_units
        - '-credited_units'
        - balance
        - '-balance'
      title: CustomerMeterSortProperty
    CustomerNotReady:
      properties:
        error:
          type: string
          const: CustomerNotReady
          title: Error
          examples:
            - CustomerNotReady
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: CustomerNotReady
    CustomerOrder:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        status:
          $ref: '#/components/schemas/OrderStatus'
          examples:
            - paid
        paid:
          type: boolean
          title: Paid
          description: Whether the order has been paid for.
          examples:
            - true
        subtotal_amount:
          type: integer
          title: Subtotal Amount
          description: Amount in cents, before discounts and taxes.
          examples:
            - 10000
        discount_amount:
          type: integer
          title: Discount Amount
          description: Discount amount in cents.
          examples:
            - 1000
        net_amount:
          type: integer
          title: Net Amount
          description: Amount in cents, after discounts but before taxes.
          examples:
            - 9000
        tax_amount:
          type: integer
          title: Tax Amount
          description: Sales tax amount in cents.
          examples:
            - 720
        total_amount:
          type: integer
          title: Total Amount
          description: Amount in cents, after discounts and taxes.
          examples:
            - 9720
        applied_balance_amount:
          type: integer
          title: Applied Balance Amount
          description: >-
            Customer's balance amount applied to this invoice. Can increase the
            total amount paid, if the customer has a negative balance,  or
            decrease it, if the customer has a positive balance.Amount in cents.
          examples:
            - 0
        due_amount:
          type: integer
          title: Due Amount
          description: Amount in cents that is due for this order.
          examples:
            - 0
        refunded_amount:
          type: integer
          title: Refunded Amount
          description: Amount refunded in cents.
          examples:
            - 0
        refunded_tax_amount:
          type: integer
          title: Refunded Tax Amount
          description: Sales tax refunded in cents.
          examples:
            - 0
        currency:
          type: string
          title: Currency
          examples:
            - usd
        billing_reason:
          $ref: '#/components/schemas/OrderBillingReason'
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: 'The name of the customer that should appear on the invoice. '
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: >-
            The invoice number associated with this order. `null` while the
            order is in `draft` status; assigned at finalize.
        is_invoice_generated:
          type: boolean
          title: Is Invoice Generated
          description: Whether an invoice has been generated for this order.
        receipt_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Receipt Number
          description: >-
            The receipt number for this order. Set once the order is paid for
            organizations with receipts enabled. When set, a downloadable
            receipt PDF can be obtained via the receipt endpoint.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: Number of seats purchased (for seat-based one-time orders).
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
        product:
          anyOf:
            - $ref: '#/components/schemas/CustomerOrderProduct'
            - type: 'null'
        subscription:
          anyOf:
            - $ref: '#/components/schemas/CustomerOrderSubscription'
            - type: 'null'
        items:
          items:
            $ref: '#/components/schemas/OrderItemSchema'
          type: array
          title: Items
          description: Line items composing the order.
        description:
          type: string
          title: Description
          description: A summary description of the order.
          examples:
            - Pro Plan
        next_payment_attempt_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Payment Attempt At
          description: When the next payment retry is scheduled
        refundable_amount:
          type: integer
          title: Refundable Amount
          description: >-
            Amount in cents that can still be refunded (net, before taxes).
            Accounts for any applied customer balance and previous refunds.
          examples:
            - 9000
        refundable_tax_amount:
          type: integer
          title: Refundable Tax Amount
          description: >-
            Sales tax in cents that would be refunded if the full refundable
            amount is refunded.
          examples:
            - 720
      type: object
      required:
        - id
        - created_at
        - modified_at
        - status
        - paid
        - subtotal_amount
        - discount_amount
        - net_amount
        - tax_amount
        - total_amount
        - applied_balance_amount
        - due_amount
        - refunded_amount
        - refunded_tax_amount
        - currency
        - billing_reason
        - billing_name
        - billing_address
        - invoice_number
        - is_invoice_generated
        - receipt_number
        - customer_id
        - product_id
        - discount_id
        - subscription_id
        - checkout_id
        - product
        - subscription
        - items
        - description
        - refundable_amount
        - refundable_tax_amount
      title: CustomerOrder
    CustomerOrderConfirmPayment:
      properties:
        confirmation_token_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Confirmation Token Id
          description: ID of the Stripe confirmation token for new payment methods.
        payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Payment Method Id
          description: ID of an existing saved payment method.
        payment_processor:
          $ref: '#/components/schemas/PaymentProcessor'
          description: Payment processor used.
          default: stripe
      type: object
      title: CustomerOrderConfirmPayment
      description: >-
        Schema to confirm a retry payment using either a saved payment method or
        a new confirmation token.
    CustomerOrderInvoice:
      properties:
        url:
          type: string
          title: Url
          description: The URL to the invoice.
      type: object
      required:
        - url
      title: CustomerOrderInvoice
      description: Order's invoice data.
    CustomerOrderPaymentConfirmation:
      properties:
        status:
          type: string
          title: Status
          description: Payment status after confirmation.
        client_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Secret
          description: Client secret for handling additional actions.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if confirmation failed.
      type: object
      required:
        - status
      title: CustomerOrderPaymentConfirmation
      description: Response after confirming a retry payment.
    CustomerOrderPaymentStatus:
      properties:
        status:
          type: string
          title: Status
          description: Current payment status.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if payment failed.
      type: object
      required:
        - status
      title: CustomerOrderPaymentStatus
      description: Payment status for an order.
    CustomerOrderProduct:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of prices for this product.
        benefits:
          items:
            $ref: '#/components/schemas/BenefitPublic'
          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.
        organization:
          $ref: '#/components/schemas/CustomerOrganization'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
        - prices
        - benefits
        - medias
        - organization
      title: CustomerOrderProduct
    CustomerOrderReceipt:
      properties:
        url:
          type: string
          title: Url
          description: The URL to the receipt PDF.
      type: object
      required:
        - url
      title: CustomerOrderReceipt
      description: Order's receipt data.
    CustomerOrderSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - amount
        - '-amount'
        - net_amount
        - '-net_amount'
        - product
        - '-product'
        - subscription
        - '-subscription'
      title: CustomerOrderSortProperty
    CustomerOrderSubscription:
      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 object.
        amount:
          type: integer
          title: Amount
          description: The amount of the subscription.
          examples:
            - 10000
        currency:
          type: string
          title: Currency
          description: The currency of the subscription.
          examples:
            - usd
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The interval at which the subscription recurs.
          examples:
            - month
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on.
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
          description: The status of the subscription.
          examples:
            - active
        current_period_start:
          type: string
          format: date-time
          title: Current Period Start
          description: The start timestamp of the current billing period.
        current_period_end:
          type: string
          format: date-time
          title: Current Period End
          description: The end timestamp of the current billing period.
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: The start timestamp of the trial period, if any.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: The end timestamp of the trial period, if any.
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Whether the subscription will be canceled at the end of the current
            period.
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: >-
            The timestamp when the subscription was canceled. The subscription
            might still be active if `cancel_at_period_end` is `true`.
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
          description: The timestamp when the subscription started.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: The timestamp when the subscription will end.
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
          description: The timestamp when the subscription ended.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the subscribed customer.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the subscribed product.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: The ID of the applied discount, if any.
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: >-
            The number of seats for seat-based subscriptions. None for non-seat
            subscriptions.
        customer_cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
        customer_cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Cancellation Comment
      type: object
      required:
        - created_at
        - modified_at
        - id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
        - status
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - cancel_at_period_end
        - canceled_at
        - started_at
        - ends_at
        - ended_at
        - customer_id
        - product_id
        - discount_id
        - checkout_id
        - customer_cancellation_reason
        - customer_cancellation_comment
      title: CustomerOrderSubscription
    CustomerOrderUpdate:
      properties:
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: The name of the customer that should appear on the invoice.
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
          description: >-
            The address of the customer that should appear on the invoice.
            Country and state fields cannot be updated.
      type: object
      title: CustomerOrderUpdate
      description: Schema to update an order.
    CustomerOrganization:
      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 object.
        name:
          type: string
          title: Name
          description: Organization name shown in checkout, customer portal, emails etc.
        slug:
          type: string
          title: Slug
          description: >-
            Unique organization slug in checkout, customer portal and credit
            card statements.
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          description: Avatar URL shown in checkout, customer portal, emails etc.
        proration_behavior:
          $ref: '#/components/schemas/SubscriptionProrationBehavior'
          description: >-
            Proration behavior applied when customer updates their subscription
            from the portal.
        allow_customer_updates:
          type: boolean
          title: Allow Customer Updates
          description: >-
            Whether customers can update their subscriptions from the customer
            portal.
        customer_portal_settings:
          $ref: '#/components/schemas/OrganizationCustomerPortalSettings'
          description: Settings related to the customer portal
        organization_features:
          $ref: '#/components/schemas/CustomerOrganizationFeatureSettings'
          description: Feature flags for the customer portal.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
        - slug
        - avatar_url
        - proration_behavior
        - allow_customer_updates
        - customer_portal_settings
      title: CustomerOrganization
    CustomerOrganizationData:
      properties:
        organization:
          $ref: '#/components/schemas/CustomerOrganization'
        products:
          items:
            $ref: '#/components/schemas/CustomerProduct'
          type: array
          title: Products
      type: object
      required:
        - organization
        - products
      title: CustomerOrganizationData
      description: Schema of an organization and related data for customer portal.
    CustomerOrganizationFeatureSettings:
      properties:
        member_model_enabled:
          type: boolean
          title: Member Model Enabled
          description: Whether the member model is enabled for this organization.
          default: false
        checkout_localization_enabled:
          type: boolean
          title: Checkout Localization Enabled
          description: Whether localization is enabled for this organization.
          default: false
      type: object
      title: CustomerOrganizationFeatureSettings
      description: Feature flags exposed to the customer portal.
    CustomerPaymentMethod:
      anyOf:
        - $ref: '#/components/schemas/PaymentMethodCard'
        - $ref: '#/components/schemas/PaymentMethodGeneric'
    CustomerPaymentMethodCard:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        type:
          type: string
          const: card
          title: Type
        method_metadata:
          $ref: '#/components/schemas/PaymentMethodCardMetadata'
        is_default:
          type: boolean
          title: Is Default
          description: >-
            Whether this payment method is the customer's default payment
            method.
          examples:
            - true
      type: object
      required:
        - id
        - created_at
        - modified_at
        - processor
        - customer_id
        - type
        - method_metadata
        - is_default
      title: CustomerPaymentMethodCard
    CustomerPaymentMethodConfirm:
      properties:
        setup_intent_id:
          type: string
          title: Setup Intent Id
        set_default:
          type: boolean
          title: Set Default
      type: object
      required:
        - setup_intent_id
        - set_default
      title: CustomerPaymentMethodConfirm
    CustomerPaymentMethodCreate:
      properties:
        confirmation_token_id:
          type: string
          title: Confirmation Token Id
        set_default:
          type: boolean
          title: Set Default
        return_url:
          type: string
          title: Return Url
      type: object
      required:
        - confirmation_token_id
        - set_default
        - return_url
      title: CustomerPaymentMethodCreate
    CustomerPaymentMethodCreateRequiresActionResponse:
      properties:
        status:
          type: string
          const: requires_action
          title: Status
        client_secret:
          type: string
          title: Client Secret
      type: object
      required:
        - status
        - client_secret
      title: CustomerPaymentMethodCreateRequiresActionResponse
    CustomerPaymentMethodCreateResponse:
      oneOf:
        - $ref: '#/components/schemas/CustomerPaymentMethodCreateSucceededResponse'
        - $ref: >-
            #/components/schemas/CustomerPaymentMethodCreateRequiresActionResponse
      discriminator:
        propertyName: status
        mapping:
          requires_action: >-
            #/components/schemas/CustomerPaymentMethodCreateRequiresActionResponse
          succeeded: '#/components/schemas/CustomerPaymentMethodCreateSucceededResponse'
    CustomerPaymentMethodCreateSucceededResponse:
      properties:
        status:
          type: string
          const: succeeded
          title: Status
        payment_method:
          $ref: '#/components/schemas/CustomerPaymentMethod'
          title: CustomerPaymentMethod
      type: object
      required:
        - status
        - payment_method
      title: CustomerPaymentMethodCreateSucceededResponse
    CustomerPaymentMethodGeneric:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        type:
          type: string
          title: Type
        is_default:
          type: boolean
          title: Is Default
          description: >-
            Whether this payment method is the customer's default payment
            method.
          examples:
            - false
      type: object
      required:
        - id
        - created_at
        - modified_at
        - processor
        - customer_id
        - type
        - is_default
      title: CustomerPaymentMethodGeneric
    CustomerPortalCustomer:
      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 object.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        email_verified:
          type: boolean
          title: Email Verified
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        oauth_accounts:
          additionalProperties:
            $ref: '#/components/schemas/CustomerPortalOAuthAccount'
          type: object
          title: Oauth Accounts
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
        type:
          anyOf:
            - $ref: '#/components/schemas/CustomerType'
            - type: 'null'
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
      type: object
      required:
        - created_at
        - modified_at
        - id
        - email
        - email_verified
        - name
        - billing_name
        - billing_address
        - tax_id
        - oauth_accounts
      title: CustomerPortalCustomer
    CustomerPortalCustomerSettings:
      properties:
        allow_email_change:
          type: boolean
          title: Allow Email Change
      type: object
      title: CustomerPortalCustomerSettings
    CustomerPortalCustomerUpdate:
      properties:
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
      type: object
      title: CustomerPortalCustomerUpdate
    CustomerPortalMember:
      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 object.
        email:
          type: string
          title: Email
          description: The email address of the member.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the member.
        role:
          $ref: '#/components/schemas/MemberRole'
          description: The role of the member within the team.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - email
        - name
        - role
      title: CustomerPortalMember
      description: A member of the customer's team as seen in the customer portal.
    CustomerPortalMemberCreate:
      properties:
        email:
          type: string
          format: email
          title: Email
          description: The email address of the new member.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the new member (optional).
        role:
          $ref: '#/components/schemas/MemberRole'
          description: The role for the new member. Defaults to 'member'.
          default: member
          examples:
            - billing_manager
            - member
      type: object
      required:
        - email
      title: CustomerPortalMemberCreate
      description: Schema for adding a new member to the customer's team.
    CustomerPortalMemberUpdate:
      properties:
        role:
          anyOf:
            - $ref: '#/components/schemas/MemberRole'
            - type: 'null'
          description: The new role for the member.
          examples:
            - billing_manager
            - member
      type: object
      title: CustomerPortalMemberUpdate
      description: Schema for updating a member's role in the customer portal.
    CustomerPortalOAuthAccount:
      properties:
        account_id:
          type: string
          title: Account Id
        account_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Username
      type: object
      required:
        - account_id
        - account_username
      title: CustomerPortalOAuthAccount
    CustomerPortalSubscriptionSettings:
      properties:
        update_seats:
          type: boolean
          title: Update Seats
        update_plan:
          type: boolean
          title: Update Plan
      type: object
      required:
        - update_seats
        - update_plan
      title: CustomerPortalSubscriptionSettings
    CustomerPortalUsageSettings:
      properties:
        show:
          type: boolean
          title: Show
      type: object
      required:
        - show
      title: CustomerPortalUsageSettings
    CustomerProduct:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of available prices for this product.
        benefits:
          items:
            $ref: '#/components/schemas/BenefitPublic'
          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:
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
        - prices
        - benefits
        - medias
      title: CustomerProduct
      description: Schema of a product for customer portal.
    CustomerSeat:
      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: uuid
          title: Id
          description: The seat ID
        subscription_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Subscription Id
          description: The subscription ID (for recurring seats)
        order_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Order Id
          description: The order ID (for one-time purchase seats)
        status:
          $ref: '#/components/schemas/SeatStatus'
          description: Status of the seat
        customer_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Customer Id
          description: >-
            The customer ID. When member_model_enabled is true, this is the
            billing customer (purchaser). When false, this is the seat member
            customer.
        member_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Member Id
          description: The member ID of the seat occupant
        member:
          anyOf:
            - $ref: '#/components/schemas/Member'
            - type: 'null'
          description: The member associated with this seat
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Email of the seat member (set when member_model_enabled is true)
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
          description: The assigned customer email
        invitation_token_expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Invitation Token Expires At
          description: When the invitation token expires
        claimed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Claimed At
          description: When the seat was claimed
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
          description: When the seat was revoked
        seat_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Seat Metadata
          description: Additional metadata for the seat
      type: object
      required:
        - created_at
        - modified_at
        - id
        - status
      title: CustomerSeat
    CustomerSeatAssign:
      properties:
        subscription_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Subscription Id
          description: >-
            Subscription ID. Required if neither order_id nor checkout_id is
            provided.
        order_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Order Id
          description: >-
            Order ID for one-time purchases. Required if subscription_id is not
            provided.
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: Email of the customer to assign the seat to
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: External customer ID for the seat assignment
        customer_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Customer Id
          description: Customer ID for the seat assignment
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            External member ID for the seat assignment. Can be used alone
            (lookup existing member) or with email (create/validate member).
        member_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Member Id
          description: Member ID for the seat assignment.
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Additional metadata for the seat (max 10 keys, 1KB total)
        immediate_claim:
          type: boolean
          title: Immediate Claim
          description: >-
            If true, the seat will be immediately claimed without sending an
            invitation email. API-only feature.
          default: false
        checkout_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Checkout Id
          description: >-
            Checkout ID. Resolves to the subscription or order produced by the
            checkout.
      type: object
      title: CustomerSeatAssign
    CustomerSeatClaimResponse:
      properties:
        seat:
          $ref: '#/components/schemas/CustomerSeat'
          description: The claimed seat
        customer_session_token:
          type: string
          title: Customer Session Token
          description: Session token for immediate customer portal access
      type: object
      required:
        - seat
        - customer_session_token
      title: CustomerSeatClaimResponse
      description: Response after successfully claiming a seat.
    CustomerSession:
      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 object.
        token:
          type: string
          title: Token
        expires_at:
          type: string
          format: date-time
          title: Expires At
        return_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Return Url
        customer_portal_url:
          type: string
          title: Customer Portal Url
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        customer:
          $ref: '#/components/schemas/Customer'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - token
        - expires_at
        - return_url
        - customer_portal_url
        - customer_id
        - customer
      title: CustomerSession
      description: A customer session that can be used to authenticate as a customer.
    CustomerSessionCustomerExternalIDCreate:
      properties:
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member to create a session for. When not provided and the
            organization has `member_model_enabled`, the owner member of the
            customer will be used for individual customers.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            External ID of the member to create a session for. Alternative to
            `member_id`.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the customer portal to
            return to this URL.
          examples:
            - https://example.com/account
        external_customer_id:
          type: string
          title: External Customer Id
          description: External ID of the customer to create a session for.
      type: object
      required:
        - external_customer_id
      title: CustomerSessionCustomerExternalIDCreate
      description: Schema for creating a customer session using an external customer ID.
    CustomerSessionCustomerIDCreate:
      properties:
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member to create a session for. When not provided and the
            organization has `member_model_enabled`, the owner member of the
            customer will be used for individual customers.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            External ID of the member to create a session for. Alternative to
            `member_id`.
        return_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Return Url
          description: >-
            When set, a back button will be shown in the customer portal to
            return to this URL.
          examples:
            - https://example.com/account
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: ID of the customer to create a session for.
      type: object
      required:
        - customer_id
      title: CustomerSessionCustomerIDCreate
      description: Schema for creating a customer session using a customer ID.
    CustomerSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - email
        - '-email'
        - name
        - '-name'
      title: CustomerSortProperty
    CustomerState:
      oneOf:
        - $ref: '#/components/schemas/CustomerStateIndividual'
        - $ref: '#/components/schemas/CustomerStateTeam'
      discriminator:
        propertyName: type
        mapping:
          individual: '#/components/schemas/CustomerStateIndividual'
          team: '#/components/schemas/CustomerStateTeam'
    CustomerStateBenefitGrant:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the grant.
          examples:
            - d322132c-a9d0-4e0d-b8d3-d81ad021a3a9
        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.
        granted_at:
          type: string
          format: date-time
          title: Granted At
          description: The timestamp when the benefit was granted.
          examples:
            - '2025-01-03T13:37:00Z'
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The ID of the benefit concerned by this grant.
          examples:
            - 397a17aa-15cf-4cb4-9333-18040203cf98
        benefit_type:
          $ref: '#/components/schemas/BenefitType'
          description: The type of the benefit concerned by this grant.
          examples:
            - custom
        benefit_metadata:
          $ref: '#/components/schemas/MetadataOutputType'
          description: The metadata of the benefit concerned by this grant.
          examples:
            - key: value
        properties:
          anyOf:
            - $ref: '#/components/schemas/BenefitGrantDiscordProperties'
            - $ref: '#/components/schemas/BenefitGrantGitHubRepositoryProperties'
            - $ref: '#/components/schemas/BenefitGrantDownloadablesProperties'
            - $ref: '#/components/schemas/BenefitGrantLicenseKeysProperties'
            - $ref: '#/components/schemas/BenefitGrantCustomProperties'
            - $ref: '#/components/schemas/BenefitGrantFeatureFlagProperties'
            - $ref: '#/components/schemas/BenefitGrantSlackSharedChannelProperties'
          title: Properties
      type: object
      required:
        - id
        - created_at
        - modified_at
        - granted_at
        - benefit_id
        - benefit_type
        - benefit_metadata
        - properties
      title: CustomerStateBenefitGrant
      description: An active benefit grant for a customer.
    CustomerStateIndividual:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          type: string
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          type: string
          const: individual
          title: Type
          description: The type of customer.
          examples:
            - individual
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        active_subscriptions:
          items:
            $ref: '#/components/schemas/CustomerStateSubscription'
          type: array
          title: Active Subscriptions
          description: The customer's active subscriptions.
        granted_benefits:
          items:
            $ref: '#/components/schemas/CustomerStateBenefitGrant'
          type: array
          title: Granted Benefits
          description: The customer's active benefit grants.
        active_meters:
          items:
            $ref: '#/components/schemas/CustomerStateMeter'
          type: array
          title: Active Meters
          description: The customer's active meters.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - active_subscriptions
        - granted_benefits
        - active_meters
        - avatar_url
      title: CustomerStateIndividual
      description: |-
        A customer along with additional state information:

        * Active subscriptions
        * Granted benefits
        * Active meters
    CustomerStateMeter:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
        consumed_units:
          type: number
          title: Consumed Units
          description: The number of consumed units.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: The number of credited units.
          examples:
            - 100
        balance:
          type: number
          title: Balance
          description: >-
            The balance of the meter, i.e. the difference between credited and
            consumed units.
          examples:
            - 75
      type: object
      required:
        - id
        - created_at
        - modified_at
        - meter_id
        - consumed_units
        - credited_units
        - balance
      title: CustomerStateMeter
      description: An active meter for a customer, with latest consumed and credited units.
    CustomerStateSubscription:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the subscription.
          examples:
            - e5149aae-e521-42b9-b24c-abb3d71eea2e
        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.
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        status:
          type: string
          enum:
            - active
            - trialing
          title: Status
          examples:
            - active
            - trialing
        amount:
          type: integer
          title: Amount
          description: The amount of the subscription.
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          description: The currency of the subscription.
          examples:
            - usd
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The interval at which the subscription recurs.
        current_period_start:
          type: string
          format: date-time
          title: Current Period Start
          description: The start timestamp of the current billing period.
          examples:
            - '2025-02-03T13:37:00Z'
        current_period_end:
          type: string
          format: date-time
          title: Current Period End
          description: The end timestamp of the current billing period.
          examples:
            - '2025-03-03T13:37:00Z'
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: The start timestamp of the trial period, if any.
          examples:
            - '2025-02-03T13:37:00Z'
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: The end timestamp of the trial period, if any.
          examples:
            - '2025-03-03T13:37:00Z'
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Whether the subscription will be canceled at the end of the current
            period.
          examples:
            - false
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: >-
            The timestamp when the subscription was canceled. The subscription
            might still be active if `cancel_at_period_end` is `true`.
          examples:
            - null
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
          description: The timestamp when the subscription started.
          examples:
            - '2025-01-03T13:37:00Z'
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: The timestamp when the subscription will end.
          examples:
            - null
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the subscribed product.
          examples:
            - d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: The ID of the applied discount, if any.
          examples:
            - null
        meters:
          items:
            $ref: '#/components/schemas/CustomerStateSubscriptionMeter'
          type: array
          title: Meters
          description: List of meters associated with the subscription.
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - status
        - amount
        - currency
        - recurring_interval
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - cancel_at_period_end
        - canceled_at
        - started_at
        - ends_at
        - product_id
        - discount_id
        - meters
      title: CustomerStateSubscription
      description: An active customer subscription.
    CustomerStateSubscriptionMeter:
      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 object.
        consumed_units:
          type: number
          title: Consumed Units
          description: The number of consumed units so far in this billing period.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: The number of credited units so far in this billing period.
          examples:
            - 100
        amount:
          type: integer
          title: Amount
          description: The amount due in cents so far in this billing period.
          examples:
            - 0
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
      type: object
      required:
        - created_at
        - modified_at
        - id
        - consumed_units
        - credited_units
        - amount
        - meter_id
      title: CustomerStateSubscriptionMeter
      description: Current consumption and spending for a subscription meter.
    CustomerStateTeam:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          type: string
          const: team
          title: Type
          description: The type of customer. Team customers can have multiple members.
          examples:
            - team
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        active_subscriptions:
          items:
            $ref: '#/components/schemas/CustomerStateSubscription'
          type: array
          title: Active Subscriptions
          description: The customer's active subscriptions.
        granted_benefits:
          items:
            $ref: '#/components/schemas/CustomerStateBenefitGrant'
          type: array
          title: Granted Benefits
          description: The customer's active benefit grants.
        active_meters:
          items:
            $ref: '#/components/schemas/CustomerStateMeter'
          type: array
          title: Active Meters
          description: The customer's active meters.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - active_subscriptions
        - granted_benefits
        - active_meters
        - avatar_url
      title: CustomerStateTeam
      description: |-
        A team customer along with additional state information:

        * Active subscriptions
        * Granted benefits
        * Active meters
    CustomerSubscription:
      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 object.
        amount:
          type: integer
          title: Amount
          description: The amount of the subscription.
          examples:
            - 10000
        currency:
          type: string
          title: Currency
          description: The currency of the subscription.
          examples:
            - usd
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The interval at which the subscription recurs.
          examples:
            - month
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on.
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
          description: The status of the subscription.
          examples:
            - active
        current_period_start:
          type: string
          format: date-time
          title: Current Period Start
          description: The start timestamp of the current billing period.
        current_period_end:
          type: string
          format: date-time
          title: Current Period End
          description: The end timestamp of the current billing period.
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: The start timestamp of the trial period, if any.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: The end timestamp of the trial period, if any.
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Whether the subscription will be canceled at the end of the current
            period.
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: >-
            The timestamp when the subscription was canceled. The subscription
            might still be active if `cancel_at_period_end` is `true`.
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
          description: The timestamp when the subscription started.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: The timestamp when the subscription will end.
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
          description: The timestamp when the subscription ended.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the subscribed customer.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the subscribed product.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: The ID of the applied discount, if any.
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: >-
            The number of seats for seat-based subscriptions. None for non-seat
            subscriptions.
        customer_cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
        customer_cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Cancellation Comment
        product:
          $ref: '#/components/schemas/CustomerSubscriptionProduct'
        prices:
          items:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of enabled prices for the subscription.
        meters:
          items:
            $ref: '#/components/schemas/CustomerSubscriptionMeter'
          type: array
          title: Meters
          description: List of meters associated with the subscription.
        pending_update:
          anyOf:
            - $ref: '#/components/schemas/PendingSubscriptionUpdate'
            - type: 'null'
          description: >-
            Pending subscription update that will be applied at the beginning of
            the next period. If `null`, there is no pending update.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
        - status
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - cancel_at_period_end
        - canceled_at
        - started_at
        - ends_at
        - ended_at
        - customer_id
        - product_id
        - discount_id
        - checkout_id
        - customer_cancellation_reason
        - customer_cancellation_comment
        - product
        - prices
        - meters
        - pending_update
      title: CustomerSubscription
    CustomerSubscriptionCancel:
      properties:
        cancel_at_period_end:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Cancel At Period End
          description: >-
            Cancel an active subscription once the current period ends.


            Or uncancel a subscription currently set to be revoked at period
            end.
        cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
          description: >-
            Customers reason for cancellation.


            * `too_expensive`: Too expensive for the customer.

            * `missing_features`: Customer is missing certain features.

            * `switched_service`: Customer switched to another service.

            * `unused`: Customer is not using it enough.

            * `customer_service`: Customer is not satisfied with the customer
            service.

            * `low_quality`: Customer is unhappy with the quality.

            * `too_complex`: Customer considers the service too complicated.

            * `other`: Other reason(s).
        cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Cancellation Comment
          description: Customer feedback and why they decided to cancel.
      type: object
      title: CustomerSubscriptionCancel
    CustomerSubscriptionMeter:
      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 object.
        consumed_units:
          type: number
          title: Consumed Units
          description: The number of consumed units so far in this billing period.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: The number of credited units so far in this billing period.
          examples:
            - 100
        amount:
          type: integer
          title: Amount
          description: The amount due in cents so far in this billing period.
          examples:
            - 0
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
        meter:
          $ref: '#/components/schemas/CustomerSubscriptionMeterMeter'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - consumed_units
        - credited_units
        - amount
        - meter_id
        - meter
      title: CustomerSubscriptionMeter
    CustomerSubscriptionMeterMeter:
      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 object.
        name:
          type: string
          title: Name
          description: >-
            The name of the meter. Will be shown on customer's invoices and
            usage.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
      title: CustomerSubscriptionMeterMeter
    CustomerSubscriptionProduct:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of prices for this product.
        benefits:
          items:
            $ref: '#/components/schemas/BenefitPublic'
          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.
        organization:
          $ref: '#/components/schemas/CustomerOrganization'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
        - prices
        - benefits
        - medias
        - organization
      title: CustomerSubscriptionProduct
    CustomerSubscriptionSortProperty:
      type: string
      enum:
        - started_at
        - '-started_at'
        - amount
        - '-amount'
        - status
        - '-status'
        - organization
        - '-organization'
        - product
        - '-product'
      title: CustomerSubscriptionSortProperty
    CustomerSubscriptionUpdate:
      anyOf:
        - $ref: '#/components/schemas/CustomerSubscriptionUpdateProduct'
        - $ref: '#/components/schemas/CustomerSubscriptionUpdateSeats'
        - $ref: '#/components/schemas/CustomerSubscriptionCancel'
        - $ref: '#/components/schemas/CustomerSubscriptionUpdateClear'
    CustomerSubscriptionUpdateClear:
      properties:
        pending_update:
          type: 'null'
          title: Pending Update
          description: Clear the pending subscription update.
      type: object
      required:
        - pending_update
      title: CustomerSubscriptionUpdateClear
    CustomerSubscriptionUpdateProduct:
      properties:
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: Update subscription to another product.
      type: object
      required:
        - product_id
      title: CustomerSubscriptionUpdateProduct
    CustomerSubscriptionUpdateSeats:
      properties:
        seats:
          type: integer
          minimum: 1
          title: Seats
          description: Update the number of seats for this subscription.
        proration_behavior:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionProrationBehavior'
            - type: 'null'
          description: >-
            Determine how to handle the proration billing. If not provided, will
            use the default organization setting.
      type: object
      required:
        - seats
      title: CustomerSubscriptionUpdateSeats
    CustomerTeam:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          type: string
          const: team
          title: Type
          description: The type of customer. Team customers can have multiple members.
          examples:
            - team
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
      title: CustomerTeam
      description: A team customer in an organization.
    CustomerTeamCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Name
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the customer. **Required unless
            you use an organization token.**
        owner:
          anyOf:
            - $ref: '#/components/schemas/MemberOwnerCreate'
            - type: 'null'
          description: >-
            Optional owner member to create with the customer. If not provided,
            an owner member will be automatically created using the customer's
            email and name.
        type:
          type: string
          const: team
          title: Type
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: >-
            The email address of the team customer. Optional for team customers
            — if omitted, an owner with an email must be provided.
          examples:
            - customer@example.com
      type: object
      required:
        - type
      title: CustomerTeamCreate
    CustomerType:
      type: string
      enum:
        - individual
        - team
      title: CustomerType
    CustomerUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Name
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        type:
          anyOf:
            - $ref: '#/components/schemas/CustomerType'
            - type: 'null'
          description: >-
            The customer type. Can only be upgraded from 'individual' to 'team',
            never downgraded.
          examples:
            - team
      type: object
      title: CustomerUpdate
    CustomerUpdateExternalID:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the customer.
              examples:
                - John Doe
            - type: 'null'
          title: Name
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-[0-9]{3})?$
              description: >-
                Locale of the customer, given as an IETF BCP 47 language tag.
                Supported: language code (e.g. `en`) or language + region (e.g.
                `en-US`). If `null` or unsupported, the locale will default to
                `en`.
              examples:
                - en
                - en-US
                - fr
                - fr-CA
            - type: 'null'
          title: Locale
      type: object
      title: CustomerUpdateExternalID
    CustomerUpdatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: customer.updated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/CustomerUpdatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: CustomerUpdatedEvent
      description: An event created by Polar when a customer is updated.
    CustomerUpdatedFields:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressDict'
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        metadata:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: boolean
              type: object
            - type: 'null'
          title: Metadata
      type: object
      title: CustomerUpdatedFields
    CustomerUpdatedMetadata:
      properties:
        customer_id:
          type: string
          title: Customer Id
        customer_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Email
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
        customer_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer External Id
        updated_fields:
          $ref: '#/components/schemas/CustomerUpdatedFields'
      type: object
      required:
        - customer_id
        - customer_email
        - customer_name
        - customer_external_id
        - updated_fields
      title: CustomerUpdatedMetadata
    CustomerWallet:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer that owns the wallet.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        balance:
          type: integer
          title: Balance
          description: The current balance of the wallet, in cents.
          examples:
            - 5000
        currency:
          type: string
          title: Currency
          description: The currency of the wallet.
          examples:
            - usd
      type: object
      required:
        - id
        - created_at
        - modified_at
        - customer_id
        - balance
        - currency
      title: CustomerWallet
      description: |-
        A wallet represents your balance with an organization.

        You can top-up your wallet and use the balance to pay for usage.
    CustomerWalletSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - balance
        - '-balance'
      title: CustomerWalletSortProperty
    Discount:
      oneOf:
        - $ref: '#/components/schemas/DiscountFixedOnceForeverDuration'
        - $ref: '#/components/schemas/DiscountFixedRepeatDuration'
        - $ref: '#/components/schemas/DiscountPercentageOnceForeverDuration'
        - $ref: '#/components/schemas/DiscountPercentageRepeatDuration'
    DiscountCreate:
      oneOf:
        - $ref: '#/components/schemas/DiscountFixedCreate'
        - $ref: '#/components/schemas/DiscountPercentageCreate'
      discriminator:
        propertyName: type
        mapping:
          fixed: '#/components/schemas/DiscountFixedCreate'
          percentage: '#/components/schemas/DiscountPercentageCreate'
    DiscountDuration:
      type: string
      enum:
        - once
        - forever
        - repeating
      title: DiscountDuration
    DiscountFixedCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          type: string
          minLength: 1
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Code customers can use to apply the discount during checkout. Must
            be between 3 and 256 characters long and contain only alphanumeric
            characters.If not provided, the discount can only be applied via the
            API.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Optional timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Optional timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Redemptions
          description: Optional maximum number of times the discount can be redeemed.
        products:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
              description: List of product IDs the discount can be applied to.
            - type: 'null'
          title: Products
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the discount. **Required unless
            you use an organization token.**
        type:
          type: string
          const: fixed
          title: Type
          default: fixed
        duration:
          $ref: '#/components/schemas/DiscountDuration'
          description: >-
            For subscriptions, determines if the discount should be applied once
            on the first invoice, forever, or for a certain number of months
            determined by `duration_in_months`.
        duration_in_months:
          anyOf:
            - type: integer
              maximum: 999
              minimum: 1
            - type: 'null'
          title: Duration In Months
          description: |-
            Number of months the discount should be applied.

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

            For this to work on yearly pricing, you should multiply this by 12.
            For example, to apply the discount for 2 years, set this to 24.
        amount:
          anyOf:
            - type: integer
              maximum: 999999999999
              minimum: 0
              description: Fixed amount to discount from the invoice total.
            - type: 'null'
          title: Amount
          deprecated: true
        currency:
          anyOf:
            - $ref: '#/components/schemas/PresentmentCurrency'
              description: The currency of the fixed amount discount.
            - type: 'null'
          default: usd
          deprecated: true
        amounts:
          anyOf:
            - additionalProperties:
                type: integer
                maximum: 999999999999
                minimum: 0
                description: Fixed amount to discount from the invoice total.
              propertyNames:
                $ref: '#/components/schemas/PresentmentCurrency'
              type: object
              minProperties: 1
              description: >-
                Map of currency to fixed amount to discount from the total. This
                allows specifying different discount amounts for different
                currencies.
            - type: 'null'
          title: Amounts
      type: object
      required:
        - name
        - duration
      title: DiscountFixedCreate
      description: Schema to create a fixed amount discount.
    DiscountFixedOnceForeverDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        type:
          $ref: '#/components/schemas/DiscountType'
        amount:
          type: integer
          title: Amount
          deprecated: true
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          deprecated: true
          examples:
            - usd
        amounts:
          additionalProperties:
            type: integer
          type: object
          title: Amounts
          description: Map of currency to fixed amount to discount from the total.
          examples:
            - eur: 900
              usd: 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        products:
          items:
            $ref: '#/components/schemas/DiscountProduct'
          type: array
          title: Products
      type: object
      required:
        - duration
        - type
        - amount
        - currency
        - amounts
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
        - products
      title: DiscountFixedOnceForeverDuration
      description: Schema for a fixed amount discount that is applied once or forever.
    DiscountFixedOnceForeverDurationBase:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        type:
          $ref: '#/components/schemas/DiscountType'
        amount:
          type: integer
          title: Amount
          deprecated: true
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          deprecated: true
          examples:
            - usd
        amounts:
          additionalProperties:
            type: integer
          type: object
          title: Amounts
          description: Map of currency to fixed amount to discount from the total.
          examples:
            - eur: 900
              usd: 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
      type: object
      required:
        - duration
        - type
        - amount
        - currency
        - amounts
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
      title: DiscountFixedOnceForeverDurationBase
    DiscountFixedRepeatDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        duration_in_months:
          type: integer
          title: Duration In Months
        type:
          $ref: '#/components/schemas/DiscountType'
        amount:
          type: integer
          title: Amount
          deprecated: true
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          deprecated: true
          examples:
            - usd
        amounts:
          additionalProperties:
            type: integer
          type: object
          title: Amounts
          description: Map of currency to fixed amount to discount from the total.
          examples:
            - eur: 900
              usd: 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        products:
          items:
            $ref: '#/components/schemas/DiscountProduct'
          type: array
          title: Products
      type: object
      required:
        - duration
        - duration_in_months
        - type
        - amount
        - currency
        - amounts
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
        - products
      title: DiscountFixedRepeatDuration
      description: |-
        Schema for a fixed amount discount that is applied on every invoice
        for a certain number of months.
    DiscountFixedRepeatDurationBase:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        duration_in_months:
          type: integer
          title: Duration In Months
        type:
          $ref: '#/components/schemas/DiscountType'
        amount:
          type: integer
          title: Amount
          deprecated: true
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          deprecated: true
          examples:
            - usd
        amounts:
          additionalProperties:
            type: integer
          type: object
          title: Amounts
          description: Map of currency to fixed amount to discount from the total.
          examples:
            - eur: 900
              usd: 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
      type: object
      required:
        - duration
        - duration_in_months
        - type
        - amount
        - currency
        - amounts
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
      title: DiscountFixedRepeatDurationBase
    DiscountPercentageCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          type: string
          minLength: 1
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Code customers can use to apply the discount during checkout. Must
            be between 3 and 256 characters long and contain only alphanumeric
            characters.If not provided, the discount can only be applied via the
            API.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Optional timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Optional timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Redemptions
          description: Optional maximum number of times the discount can be redeemed.
        products:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
              description: List of product IDs the discount can be applied to.
            - type: 'null'
          title: Products
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the discount. **Required unless
            you use an organization token.**
        type:
          type: string
          const: percentage
          title: Type
          default: percentage
        duration:
          $ref: '#/components/schemas/DiscountDuration'
          description: >-
            For subscriptions, determines if the discount should be applied once
            on the first invoice, forever, or for a certain number of months
            determined by `duration_in_months`.
        duration_in_months:
          anyOf:
            - type: integer
              maximum: 999
              minimum: 1
            - type: 'null'
          title: Duration In Months
          description: |-
            Number of months the discount should be applied.

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

            For this to work on yearly pricing, you should multiply this by 12.
            For example, to apply the discount for 2 years, set this to 24.
        basis_points:
          type: integer
          maximum: 10000
          minimum: 1
          title: Basis Points
          description: |-
            Discount percentage in basis points.

            A basis point is 1/100th of a percent.
            For example, to create a 25.5% discount, set this to 2550.
      type: object
      required:
        - name
        - duration
        - basis_points
      title: DiscountPercentageCreate
      description: Schema to create a percentage discount.
    DiscountPercentageOnceForeverDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        type:
          $ref: '#/components/schemas/DiscountType'
        basis_points:
          type: integer
          title: Basis Points
          description: >-
            Discount percentage in basis points. A basis point is 1/100th of a
            percent. For example, 1000 basis points equals a 10% discount.
          examples:
            - 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        products:
          items:
            $ref: '#/components/schemas/DiscountProduct'
          type: array
          title: Products
      type: object
      required:
        - duration
        - type
        - basis_points
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
        - products
      title: DiscountPercentageOnceForeverDuration
      description: Schema for a percentage discount that is applied once or forever.
    DiscountPercentageOnceForeverDurationBase:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        type:
          $ref: '#/components/schemas/DiscountType'
        basis_points:
          type: integer
          title: Basis Points
          description: >-
            Discount percentage in basis points. A basis point is 1/100th of a
            percent. For example, 1000 basis points equals a 10% discount.
          examples:
            - 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
      type: object
      required:
        - duration
        - type
        - basis_points
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
      title: DiscountPercentageOnceForeverDurationBase
    DiscountPercentageRepeatDuration:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        duration_in_months:
          type: integer
          title: Duration In Months
        type:
          $ref: '#/components/schemas/DiscountType'
        basis_points:
          type: integer
          title: Basis Points
          description: >-
            Discount percentage in basis points. A basis point is 1/100th of a
            percent. For example, 1000 basis points equals a 10% discount.
          examples:
            - 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        products:
          items:
            $ref: '#/components/schemas/DiscountProduct'
          type: array
          title: Products
      type: object
      required:
        - duration
        - duration_in_months
        - type
        - basis_points
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
        - products
      title: DiscountPercentageRepeatDuration
      description: |-
        Schema for a percentage discount that is applied on every invoice
        for a certain number of months.
    DiscountPercentageRepeatDurationBase:
      properties:
        duration:
          $ref: '#/components/schemas/DiscountDuration'
        duration_in_months:
          type: integer
          title: Duration In Months
        type:
          $ref: '#/components/schemas/DiscountType'
        basis_points:
          type: integer
          title: Basis Points
          description: >-
            Discount percentage in basis points. A basis point is 1/100th of a
            percent. For example, 1000 basis points equals a 10% discount.
          examples:
            - 1000
        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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        name:
          type: string
          title: Name
          description: >-
            Name of the discount. Will be displayed to the customer when the
            discount is applied.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: Code customers can use to apply the discount during checkout.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Redemptions
          description: Maximum number of times the discount can be redeemed.
        redemptions_count:
          type: integer
          title: Redemptions Count
          description: Number of times the discount has been redeemed.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
      type: object
      required:
        - duration
        - duration_in_months
        - type
        - basis_points
        - created_at
        - modified_at
        - id
        - metadata
        - name
        - code
        - starts_at
        - ends_at
        - max_redemptions
        - redemptions_count
        - organization_id
      title: DiscountPercentageRepeatDurationBase
    DiscountProduct:
      properties:
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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.
      type: object
      required:
        - metadata
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
      title: DiscountProduct
      description: A product that a discount can be applied to.
    DiscountSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - name
        - '-name'
        - code
        - '-code'
        - redemptions_count
        - '-redemptions_count'
        - ends_at
        - '-ends_at'
      title: DiscountSortProperty
    DiscountType:
      type: string
      enum:
        - fixed
        - percentage
      title: DiscountType
    DiscountUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 1
              description: >-
                Name of the discount. Will be displayed to the customer when the
                discount is applied.
            - type: 'null'
          title: Name
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Code customers can use to apply the discount during checkout. Must
            be between 3 and 256 characters long and contain only alphanumeric
            characters.If not provided, the discount can only be applied via the
            API.
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
          description: Optional timestamp after which the discount is redeemable.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: Optional timestamp after which the discount is no longer redeemable.
        max_redemptions:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Redemptions
          description: Optional maximum number of times the discount can be redeemed.
        duration:
          anyOf:
            - $ref: '#/components/schemas/DiscountDuration'
            - type: 'null'
        duration_in_months:
          anyOf:
            - type: integer
              maximum: 999
              minimum: 1
              description: >-
                Number of months the discount should be applied.


                For this to work on yearly pricing, you should multiply this by
                12.

                For example, to apply the discount for 2 years, set this to 24.
            - type: 'null'
          title: Duration In Months
        type:
          anyOf:
            - $ref: '#/components/schemas/DiscountType'
            - type: 'null'
        amount:
          anyOf:
            - type: integer
              maximum: 999999999999
              minimum: 0
              description: Fixed amount to discount from the invoice total.
            - type: 'null'
          title: Amount
          deprecated: true
        currency:
          anyOf:
            - $ref: '#/components/schemas/PresentmentCurrency'
              description: The currency of the fixed amount discount.
            - type: 'null'
          deprecated: true
        amounts:
          anyOf:
            - additionalProperties:
                type: integer
                maximum: 999999999999
                minimum: 0
                description: Fixed amount to discount from the invoice total.
              propertyNames:
                $ref: '#/components/schemas/PresentmentCurrency'
              type: object
              minProperties: 1
              description: >-
                Map of currency to fixed amount to discount from the total. This
                allows specifying different discount amounts for different
                currencies.
            - type: 'null'
          title: Amounts
        basis_points:
          anyOf:
            - type: integer
              maximum: 10000
              minimum: 1
              description: |-
                Discount percentage in basis points.

                A basis point is 1/100th of a percent.
                For example, to create a 25.5% discount, set this to 2550.
            - type: 'null'
          title: Basis Points
        products:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
              description: List of product IDs the discount can be applied to.
            - type: 'null'
          title: Products
      type: object
      title: DiscountUpdate
      description: Schema to update a discount.
    Dispute:
      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 object.
        status:
          $ref: '#/components/schemas/DisputeStatus'
          description: >-
            Status of the dispute. `prevented` means we issued a refund before
            the dispute was escalated, avoiding any fees.
          examples:
            - needs_response
            - prevented
        resolved:
          type: boolean
          title: Resolved
          description: Whether the dispute has been resolved (won or lost).
          examples:
            - false
        closed:
          type: boolean
          title: Closed
          description: Whether the dispute is closed (prevented, won, or lost).
          examples:
            - false
        amount:
          type: integer
          title: Amount
          description: Amount in cents disputed.
          examples:
            - 1000
        tax_amount:
          type: integer
          title: Tax Amount
          description: Tax amount in cents disputed.
          examples:
            - 200
        currency:
          type: string
          title: Currency
          description: Currency code of the dispute.
          examples:
            - usd
        order_id:
          type: string
          format: uuid4
          title: Order Id
          description: The ID of the order associated with the dispute.
          examples:
            - 57107b74-8400-4d80-a2fc-54c2b4239cb3
        payment_id:
          type: string
          format: uuid4
          title: Payment Id
          description: The ID of the payment associated with the dispute.
          examples:
            - 42b94870-36b9-4573-96b6-b90b1c99a353
      type: object
      required:
        - created_at
        - modified_at
        - id
        - status
        - resolved
        - closed
        - amount
        - tax_amount
        - currency
        - order_id
        - payment_id
      title: Dispute
      description: >-
        Schema representing a dispute.


        A dispute is a challenge raised by a customer or their bank regarding a
        payment.
    DisputeSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - amount
        - '-amount'
      title: DisputeSortProperty
    DisputeStatus:
      type: string
      enum:
        - prevented
        - early_warning
        - needs_response
        - under_review
        - lost
        - won
      title: DisputeStatus
    DownloadableFileCreate:
      properties:
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
        name:
          type: string
          title: Name
        mime_type:
          type: string
          title: Mime Type
        size:
          type: integer
          title: Size
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        upload:
          $ref: '#/components/schemas/S3FileCreateMultipart'
        service:
          type: string
          const: downloadable
          title: Service
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
      type: object
      required:
        - name
        - mime_type
        - size
        - upload
        - service
      title: DownloadableFileCreate
      description: Schema to create a file to be associated with the downloadables benefit.
    DownloadableFileRead:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
        mime_type:
          type: string
          title: Mime Type
        size:
          type: integer
          title: Size
        storage_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Version
        checksum_etag:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Etag
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        checksum_sha256_hex:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Hex
        last_modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Modified At
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        service:
          type: string
          const: downloadable
          title: Service
        is_uploaded:
          type: boolean
          title: Is Uploaded
        created_at:
          type: string
          format: date-time
          title: Created At
        size_readable:
          type: string
          title: Size Readable
      type: object
      required:
        - id
        - organization_id
        - name
        - path
        - mime_type
        - size
        - storage_version
        - checksum_etag
        - checksum_sha256_base64
        - checksum_sha256_hex
        - last_modified_at
        - version
        - service
        - is_uploaded
        - created_at
        - size_readable
      title: DownloadableFileRead
      description: File to be associated with the downloadables benefit.
    DownloadableRead:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
        file:
          $ref: '#/components/schemas/FileDownload'
      type: object
      required:
        - id
        - benefit_id
        - file
      title: DownloadableRead
    Event:
      oneOf:
        - $ref: '#/components/schemas/SystemEvent'
        - $ref: '#/components/schemas/UserEvent'
    EventCreateCustomer:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        name:
          type: string
          maxLength: 128
          title: Name
          description: The name of the event.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the event. **Required unless you
            use an organization token.**
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            Your unique identifier for this event. Useful for deduplication and
            parent-child relationships.
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: >-
            The ID of the parent event. Can be either a Polar event ID (UUID) or
            an external event ID.
        metadata:
          $ref: '#/components/schemas/EventMetadataInput'
          description: >-
            Key-value object allowing you to store additional information about
            the event. Some keys like `_llm` are structured data that are
            handled specially by Polar.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action. Used for member-level attribution in B2B.
      type: object
      required:
        - name
        - customer_id
      title: EventCreateCustomer
    EventCreateExternalCustomer:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        name:
          type: string
          maxLength: 128
          title: Name
          description: The name of the event.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the event. **Required unless you
            use an organization token.**
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            Your unique identifier for this event. Useful for deduplication and
            parent-child relationships.
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: >-
            The ID of the parent event. Can be either a Polar event ID (UUID) or
            an external event ID.
        metadata:
          $ref: '#/components/schemas/EventMetadataInput'
          description: >-
            Key-value object allowing you to store additional information about
            the event. Some keys like `_llm` are structured data that are
            handled specially by Polar.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        external_customer_id:
          type: string
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action. Used for member-level attribution in B2B.
      type: object
      required:
        - name
        - external_customer_id
      title: EventCreateExternalCustomer
    EventMetadataInput:
      additionalProperties:
        anyOf:
          - type: string
            maxLength: 500
            minLength: 1
          - type: integer
          - type: number
          - type: boolean
          - $ref: '#/components/schemas/CostMetadata-Input'
          - $ref: '#/components/schemas/LLMMetadata'
      type: object
      title: EventMetadataInput
    EventMetadataOutput:
      additionalProperties:
        anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
          - $ref: '#/components/schemas/CostMetadata-Output'
          - $ref: '#/components/schemas/LLMMetadata'
      type: object
      title: EventMetadataOutput
    EventName:
      properties:
        name:
          type: string
          title: Name
          description: The name of the event.
        source:
          $ref: '#/components/schemas/EventSource'
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        occurrences:
          type: integer
          title: Occurrences
          description: Number of times the event has occurred.
        first_seen:
          type: string
          format: date-time
          title: First Seen
          description: The first time the event occurred.
        last_seen:
          type: string
          format: date-time
          title: Last Seen
          description: The last time the event occurred.
      type: object
      required:
        - name
        - source
        - occurrences
        - first_seen
        - last_seen
      title: EventName
    EventNamesSortProperty:
      type: string
      enum:
        - name
        - '-name'
        - occurrences
        - '-occurrences'
        - first_seen
        - '-first_seen'
        - last_seen
        - '-last_seen'
      title: EventNamesSortProperty
    EventSortProperty:
      type: string
      enum:
        - timestamp
        - '-timestamp'
      title: EventSortProperty
    EventSource:
      type: string
      enum:
        - system
        - user
      title: EventSource
    EventType:
      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 object.
        name:
          type: string
          title: Name
          description: The name of the event type.
        label:
          type: string
          title: Label
          description: The label for the event type.
        label_property_selector:
          anyOf:
            - type: string
            - type: 'null'
          title: Label Property Selector
          description: Property path to extract dynamic label from event metadata.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event type.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
        - label
        - organization_id
      title: EventType
    EventTypeUpdate:
      properties:
        label:
          type: string
          maxLength: 128
          minLength: 1
          title: Label
          description: The label for the event type.
        label_property_selector:
          anyOf:
            - type: string
              maxLength: 256
              minLength: 1
            - type: 'null'
          title: Label Property Selector
          description: >-
            Property path to extract dynamic label from event metadata (e.g.,
            'subject' or 'metadata.subject').
      type: object
      required:
        - label
      title: EventTypeUpdate
    EventTypeWithStats:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Id
          description: The ID of the event type. Null for system event types.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Creation timestamp of the event type. Null for system event types.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: >-
            Last modification timestamp of the event type. Null for system event
            types.
        name:
          type: string
          title: Name
          description: The name of the event type.
        label:
          type: string
          title: Label
          description: The label for the event type.
        label_property_selector:
          anyOf:
            - type: string
            - type: 'null'
          title: Label Property Selector
          description: Property path to extract dynamic label from event metadata.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event type.
        source:
          $ref: '#/components/schemas/EventSource'
          description: The source of the events (system or user).
        occurrences:
          type: integer
          title: Occurrences
          description: Number of times the event has occurred.
        first_seen:
          type: string
          format: date-time
          title: First Seen
          description: The first time the event occurred.
        last_seen:
          type: string
          format: date-time
          title: Last Seen
          description: The last time the event occurred.
      type: object
      required:
        - name
        - label
        - organization_id
        - source
        - occurrences
        - first_seen
        - last_seen
      title: EventTypeWithStats
    EventTypesSortProperty:
      type: string
      enum:
        - name
        - '-name'
        - label
        - '-label'
        - occurrences
        - '-occurrences'
        - first_seen
        - '-first_seen'
        - last_seen
        - '-last_seen'
      title: EventTypesSortProperty
    EventsIngest:
      properties:
        events:
          items:
            anyOf:
              - $ref: '#/components/schemas/EventCreateCustomer'
              - $ref: '#/components/schemas/EventCreateExternalCustomer'
          type: array
          title: Events
          description: List of events to ingest.
      type: object
      required:
        - events
      title: EventsIngest
    EventsIngestResponse:
      properties:
        inserted:
          type: integer
          title: Inserted
          description: Number of events inserted.
        duplicates:
          type: integer
          title: Duplicates
          description: Number of duplicate events skipped.
          default: 0
      type: object
      required:
        - inserted
      title: EventsIngestResponse
    ExistingProductPrice:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
      type: object
      required:
        - id
      title: ExistingProductPrice
      description: |-
        A price that already exists for this product.

        Useful when updating a product if you want to keep an existing price.
    ExpiredCheckoutError:
      properties:
        error:
          type: string
          const: ExpiredCheckoutError
          title: Error
          examples:
            - ExpiredCheckoutError
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: ExpiredCheckoutError
    FileCreate:
      oneOf:
        - $ref: '#/components/schemas/DownloadableFileCreate'
        - $ref: '#/components/schemas/ProductMediaFileCreate'
        - $ref: '#/components/schemas/OrganizationAvatarFileCreate'
      discriminator:
        propertyName: service
        mapping:
          downloadable: '#/components/schemas/DownloadableFileCreate'
          organization_avatar: '#/components/schemas/OrganizationAvatarFileCreate'
          product_media: '#/components/schemas/ProductMediaFileCreate'
    FileDownload:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
        mime_type:
          type: string
          title: Mime Type
        size:
          type: integer
          title: Size
        storage_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Version
        checksum_etag:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Etag
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        checksum_sha256_hex:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Hex
        last_modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Modified At
        download:
          $ref: '#/components/schemas/S3DownloadURL'
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        is_uploaded:
          type: boolean
          title: Is Uploaded
        service:
          $ref: '#/components/schemas/FileServiceTypes'
        size_readable:
          type: string
          title: Size Readable
      type: object
      required:
        - id
        - organization_id
        - name
        - path
        - mime_type
        - size
        - storage_version
        - checksum_etag
        - checksum_sha256_base64
        - checksum_sha256_hex
        - last_modified_at
        - download
        - version
        - is_uploaded
        - service
        - size_readable
      title: FileDownload
    FilePatch:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
      type: object
      title: FilePatch
    FileServiceTypes:
      type: string
      enum:
        - downloadable
        - product_media
        - organization_avatar
      title: FileServiceTypes
    FileUpload:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
        mime_type:
          type: string
          title: Mime Type
        size:
          type: integer
          title: Size
        storage_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Version
        checksum_etag:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Etag
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        checksum_sha256_hex:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Hex
        last_modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Modified At
        upload:
          $ref: '#/components/schemas/S3FileUploadMultipart'
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        is_uploaded:
          type: boolean
          title: Is Uploaded
          default: false
        service:
          $ref: '#/components/schemas/FileServiceTypes'
        size_readable:
          type: string
          title: Size Readable
      type: object
      required:
        - id
        - organization_id
        - name
        - path
        - mime_type
        - size
        - storage_version
        - checksum_etag
        - checksum_sha256_base64
        - checksum_sha256_hex
        - last_modified_at
        - upload
        - version
        - service
        - size_readable
      title: FileUpload
    FileUploadCompleted:
      properties:
        id:
          type: string
          title: Id
        path:
          type: string
          title: Path
        parts:
          items:
            $ref: '#/components/schemas/S3FileUploadCompletedPart'
          type: array
          title: Parts
      type: object
      required:
        - id
        - path
        - parts
      title: FileUploadCompleted
    Filter:
      properties:
        conjunction:
          $ref: '#/components/schemas/FilterConjunction'
        clauses:
          items:
            anyOf:
              - $ref: '#/components/schemas/FilterClause'
              - $ref: '#/components/schemas/Filter'
          type: array
          title: Clauses
      type: object
      required:
        - conjunction
        - clauses
      title: Filter
    FilterClause:
      properties:
        property:
          type: string
          title: Property
        operator:
          $ref: '#/components/schemas/FilterOperator'
        value:
          anyOf:
            - type: string
              maxLength: 1000
            - type: integer
              maximum: 2147483647
              minimum: -2147483648
            - type: boolean
          title: Value
      type: object
      required:
        - property
        - operator
        - value
      title: FilterClause
    FilterConjunction:
      type: string
      enum:
        - and
        - or
      title: FilterConjunction
    FilterOperator:
      type: string
      enum:
        - eq
        - ne
        - gt
        - gte
        - lt
        - lte
        - like
        - not_like
      title: FilterOperator
    GenericPayment:
      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 object.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
          description: The payment processor.
          examples:
            - stripe
        status:
          $ref: '#/components/schemas/PaymentStatus'
          description: The payment status.
          examples:
            - succeeded
        amount:
          type: integer
          title: Amount
          description: The payment amount in cents.
          examples:
            - 1000
        currency:
          type: string
          title: Currency
          description: The payment currency. Currently, only `usd` is supported.
          examples:
            - usd
        method:
          type: string
          title: Method
          description: The payment method used.
          examples:
            - card
        decline_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Decline Reason
          description: Error code, if the payment was declined.
          examples:
            - insufficient_funds
        decline_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Decline Message
          description: Human-readable error message, if the payment was declined.
          examples:
            - Your card has insufficient funds.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization that owns the payment.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
          description: The ID of the checkout session associated with this payment.
          examples:
            - e4b478fa-cd25-4253-9f1f-8a41e6370ede
        order_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Order Id
          description: The ID of the order associated with this payment.
          examples:
            - e4b478fa-cd25-4253-9f1f-8a41e6370ede
        processor_metadata:
          additionalProperties: true
          type: object
          title: Processor Metadata
          description: Additional metadata from the payment processor for internal use.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - processor
        - status
        - amount
        - currency
        - method
        - decline_reason
        - decline_message
        - organization_id
        - checkout_id
        - order_id
      title: GenericPayment
      description: Schema of a payment with a generic payment method.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    IntrospectTokenResponse:
      properties:
        active:
          type: boolean
          title: Active
        client_id:
          type: string
          title: Client Id
        token_type:
          type: string
          enum:
            - access_token
            - refresh_token
          title: Token Type
        scope:
          type: string
          title: Scope
        sub_type:
          $ref: '#/components/schemas/SubType'
        sub:
          type: string
          title: Sub
        aud:
          type: string
          title: Aud
        iss:
          type: string
          title: Iss
        exp:
          type: integer
          title: Exp
        iat:
          type: integer
          title: Iat
      type: object
      required:
        - active
        - client_id
        - token_type
        - scope
        - sub_type
        - sub
        - aud
        - iss
        - exp
        - iat
      title: IntrospectTokenResponse
    LLMMetadata:
      properties:
        vendor:
          type: string
          title: Vendor
          description: The vendor of the event.
        model:
          type: string
          title: Model
          description: The model used for the event.
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: The LLM prompt used for the event.
        response:
          anyOf:
            - type: string
            - type: 'null'
          title: Response
          description: The LLM response used for the event.
        input_tokens:
          type: integer
          title: Input Tokens
          description: The number of LLM input tokens used for the event.
        cached_input_tokens:
          type: integer
          title: Cached Input Tokens
          description: The number of LLM cached tokens that were used for the event.
        output_tokens:
          type: integer
          title: Output Tokens
          description: The number of LLM output tokens used for the event.
        total_tokens:
          type: integer
          title: Total Tokens
          description: The total number of LLM tokens used for the event.
      type: object
      required:
        - vendor
        - model
        - input_tokens
        - output_tokens
        - total_tokens
      title: LLMMetadata
    LegacyOrganizationStatus:
      type: string
      enum:
        - created
        - under_review
        - denied
        - active
      title: LegacyOrganizationStatus
      description: >-
        Legacy organization status values kept for backward compatibility in
        schemas

        using OrganizationPublicBase.
    LegacyRecurringProductPrice:
      oneOf:
        - $ref: '#/components/schemas/LegacyRecurringProductPriceFixed'
        - $ref: '#/components/schemas/LegacyRecurringProductPriceCustom'
        - $ref: '#/components/schemas/LegacyRecurringProductPriceFree'
      discriminator:
        propertyName: amount_type
        mapping:
          custom: '#/components/schemas/LegacyRecurringProductPriceCustom'
          fixed: '#/components/schemas/LegacyRecurringProductPriceFixed'
          free: '#/components/schemas/LegacyRecurringProductPriceFree'
    LegacyRecurringProductPriceCustom:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: custom
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        type:
          type: string
          const: recurring
          title: Type
          description: The type of the price.
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The recurring interval of the price.
        minimum_amount:
          type: integer
          title: Minimum Amount
          description: >-
            The minimum amount the customer can pay. If 0, the price is 'free or
            pay what you want'.
        maximum_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Maximum Amount
          description: The maximum amount the customer can pay.
        preset_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Preset Amount
          description: The initial amount shown to the customer.
        legacy:
          type: boolean
          const: true
          title: Legacy
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - type
        - recurring_interval
        - minimum_amount
        - maximum_amount
        - preset_amount
        - legacy
      title: LegacyRecurringProductPriceCustom
      description: >-
        A pay-what-you-want recurring price for a product, i.e. a subscription.


        **Deprecated**: The recurring interval should be set on the product
        itself.
    LegacyRecurringProductPriceFixed:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: fixed
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        type:
          type: string
          const: recurring
          title: Type
          description: The type of the price.
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The recurring interval of the price.
        price_amount:
          type: integer
          title: Price Amount
          description: The price in cents.
        legacy:
          type: boolean
          const: true
          title: Legacy
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - type
        - recurring_interval
        - price_amount
        - legacy
      title: LegacyRecurringProductPriceFixed
      description: >-
        A recurring price for a product, i.e. a subscription.


        **Deprecated**: The recurring interval should be set on the product
        itself.
    LegacyRecurringProductPriceFree:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: free
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        type:
          type: string
          const: recurring
          title: Type
          description: The type of the price.
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The recurring interval of the price.
        legacy:
          type: boolean
          const: true
          title: Legacy
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - type
        - recurring_interval
        - legacy
      title: LegacyRecurringProductPriceFree
      description: >-
        A free recurring price for a product, i.e. a subscription.


        **Deprecated**: The recurring interval should be set on the product
        itself.
    LicenseKeyActivate:
      properties:
        key:
          type: string
          title: Key
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        label:
          type: string
          title: Label
        conditions:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Conditions
          description: >-
            Key-value object allowing you to set conditions that must match when
            validating the license key.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
        meta:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Meta
          description: >-
            Key-value object allowing you to store additional information about
            the activation


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
      type: object
      required:
        - key
        - organization_id
        - label
      title: LicenseKeyActivate
    LicenseKeyActivationBase:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        license_key_id:
          type: string
          format: uuid4
          title: License Key Id
        label:
          type: string
          title: Label
        meta:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          type: object
          title: Meta
        created_at:
          type: string
          format: date-time
          title: Created At
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
      type: object
      required:
        - id
        - license_key_id
        - label
        - meta
        - created_at
        - modified_at
      title: LicenseKeyActivationBase
    LicenseKeyActivationRead:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        license_key_id:
          type: string
          format: uuid4
          title: License Key Id
        label:
          type: string
          title: Label
        meta:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          type: object
          title: Meta
        created_at:
          type: string
          format: date-time
          title: Created At
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
        license_key:
          $ref: '#/components/schemas/LicenseKeyRead'
      type: object
      required:
        - id
        - license_key_id
        - label
        - meta
        - created_at
        - modified_at
        - license_key
      title: LicenseKeyActivationRead
    LicenseKeyCustomer:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          $ref: '#/components/schemas/CustomerType'
          description: >-
            The type of customer: 'individual' for single users, 'team' for
            customers with multiple members.
          examples:
            - individual
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
      title: LicenseKeyCustomer
    LicenseKeyDeactivate:
      properties:
        key:
          type: string
          title: Key
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        activation_id:
          type: string
          format: uuid4
          title: Activation Id
      type: object
      required:
        - key
        - organization_id
        - activation_id
      title: LicenseKeyDeactivate
    LicenseKeyRead:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        customer:
          $ref: '#/components/schemas/LicenseKeyCustomer'
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The benefit ID.
          x-polar-selector-widget:
            displayProperty: description
            resourceName: Benefit
            resourceRoot: /v1/benefits
        key:
          type: string
          title: Key
        display_key:
          type: string
          title: Display Key
        status:
          $ref: '#/components/schemas/LicenseKeyStatus'
        limit_activations:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Activations
        usage:
          type: integer
          title: Usage
        limit_usage:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Usage
        validations:
          type: integer
          title: Validations
        last_validated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Validated At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - id
        - created_at
        - modified_at
        - organization_id
        - customer_id
        - customer
        - benefit_id
        - key
        - display_key
        - status
        - limit_activations
        - usage
        - limit_usage
        - validations
        - last_validated_at
        - expires_at
      title: LicenseKeyRead
    LicenseKeyStatus:
      type: string
      enum:
        - granted
        - revoked
        - disabled
      title: LicenseKeyStatus
    LicenseKeyUpdate:
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/LicenseKeyStatus'
            - type: 'null'
        usage:
          type: integer
          title: Usage
          default: 0
        limit_activations:
          anyOf:
            - type: integer
              maximum: 1000
              exclusiveMinimum: 0
            - type: 'null'
          title: Limit Activations
        limit_usage:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Limit Usage
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      title: LicenseKeyUpdate
    LicenseKeyUser:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        public_name:
          type: string
          title: Public Name
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
      type: object
      required:
        - id
        - public_name
      title: LicenseKeyUser
    LicenseKeyValidate:
      properties:
        key:
          type: string
          title: Key
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        activation_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Activation Id
        benefit_id:
          anyOf:
            - type: string
              format: uuid4
              description: The benefit ID.
              x-polar-selector-widget:
                displayProperty: description
                resourceName: Benefit
                resourceRoot: /v1/benefits
            - type: 'null'
          title: Benefit Id
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
        increment_usage:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Increment Usage
        conditions:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Conditions
          description: >-
            Key-value object allowing you to set conditions that must match when
            validating the license key.


            The key must be a string with a maximum length of **40 characters**.

            The value must be either:


            * A string with a maximum length of **500 characters**

            * An integer

            * A floating-point number

            * A boolean


            You can store up to **50 key-value pairs**.
      type: object
      required:
        - key
        - organization_id
      title: LicenseKeyValidate
    LicenseKeyWithActivations:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        customer:
          $ref: '#/components/schemas/LicenseKeyCustomer'
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The benefit ID.
          x-polar-selector-widget:
            displayProperty: description
            resourceName: Benefit
            resourceRoot: /v1/benefits
        key:
          type: string
          title: Key
        display_key:
          type: string
          title: Display Key
        status:
          $ref: '#/components/schemas/LicenseKeyStatus'
        limit_activations:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Activations
        usage:
          type: integer
          title: Usage
        limit_usage:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Usage
        validations:
          type: integer
          title: Validations
        last_validated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Validated At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        activations:
          items:
            $ref: '#/components/schemas/LicenseKeyActivationBase'
          type: array
          title: Activations
      type: object
      required:
        - id
        - created_at
        - modified_at
        - organization_id
        - customer_id
        - customer
        - benefit_id
        - key
        - display_key
        - status
        - limit_activations
        - usage
        - limit_usage
        - validations
        - last_validated_at
        - expires_at
        - activations
      title: LicenseKeyWithActivations
    ListResourceWithCursorPagination_Event_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Event'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/CursorPagination'
      type: object
      required:
        - items
        - pagination
      title: ListResourceWithCursorPagination[Event]
    ListResource_BenefitGrant_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/BenefitGrant'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[BenefitGrant]
    ListResource_Benefit_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Benefit'
            title: Benefit
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Benefit]
    ListResource_CheckoutLink_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CheckoutLink'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CheckoutLink]
    ListResource_Checkout_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Checkout'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Checkout]
    ListResource_CustomField_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomField'
            title: CustomField
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomField]
    ListResource_CustomerBenefitGrant_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerBenefitGrant'
            title: CustomerBenefitGrant
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerBenefitGrant]
    ListResource_CustomerCustomerMeter_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerCustomerMeter'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerCustomerMeter]
    ListResource_CustomerMeter_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerMeter'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerMeter]
    ListResource_CustomerOrder_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerOrder'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerOrder]
    ListResource_CustomerPaymentMethod_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerPaymentMethod'
            title: CustomerPaymentMethod
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerPaymentMethod]
    ListResource_CustomerPortalMember_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerPortalMember'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerPortalMember]
    ListResource_CustomerSubscription_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerSubscription'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerSubscription]
    ListResource_CustomerWallet_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CustomerWallet'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[CustomerWallet]
    ListResource_Customer_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Customer'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Customer]
    ListResource_Discount_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Discount'
            title: Discount
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Discount]
    ListResource_Dispute_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Dispute'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Dispute]
    ListResource_DownloadableRead_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DownloadableRead'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[DownloadableRead]
    ListResource_EventName_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventName'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[EventName]
    ListResource_EventTypeWithStats_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventTypeWithStats'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[EventTypeWithStats]
    ListResource_Event_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Event'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Event]
    ListResource_FileRead_:
      properties:
        items:
          items:
            oneOf:
              - $ref: '#/components/schemas/DownloadableFileRead'
              - $ref: '#/components/schemas/ProductMediaFileRead'
              - $ref: '#/components/schemas/OrganizationAvatarFileRead'
            title: FileRead
            discriminator:
              propertyName: service
              mapping:
                downloadable: '#/components/schemas/DownloadableFileRead'
                organization_avatar: '#/components/schemas/OrganizationAvatarFileRead'
                product_media: '#/components/schemas/ProductMediaFileRead'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[FileRead]
    ListResource_LicenseKeyRead_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/LicenseKeyRead'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[LicenseKeyRead]
    ListResource_Member_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Member'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Member]
    ListResource_Meter_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Meter'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Meter]
    ListResource_Order_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Order'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Order]
    ListResource_OrganizationAccessToken_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/OrganizationAccessToken'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[OrganizationAccessToken]
    ListResource_Organization_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Organization'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Organization]
    ListResource_PaymentMethod_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PaymentMethod'
            title: PaymentMethod
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[PaymentMethod]
    ListResource_Payment_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Payment'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Payment]
    ListResource_Product_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Product'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Product]
    ListResource_Refund_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Refund'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Refund]
    ListResource_Subscription_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Subscription'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[Subscription]
    ListResource_WebhookDelivery_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/WebhookDelivery'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[WebhookDelivery]
    ListResource_WebhookEndpoint_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/WebhookEndpoint'
          type: array
          title: Items
        pagination:
          $ref: '#/components/schemas/Pagination'
      type: object
      required:
        - items
        - pagination
      title: ListResource[WebhookEndpoint]
    ManualRetryLimitExceeded:
      properties:
        error:
          type: string
          const: ManualRetryLimitExceeded
          title: Error
          examples:
            - ManualRetryLimitExceeded
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: ManualRetryLimitExceeded
    Member:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the member.
        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.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer this member belongs to.
        email:
          type: string
          title: Email
          description: The email address of the member.
          examples:
            - member@example.com
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the member.
          examples:
            - Jane Doe
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the member in your system. This must be unique within the
            customer. 
          examples:
            - usr_1337
        role:
          $ref: '#/components/schemas/MemberRole'
          description: The role of the member within the customer.
          examples:
            - owner
      type: object
      required:
        - id
        - created_at
        - modified_at
        - customer_id
        - email
        - name
        - external_id
        - role
      title: Member
      description: A member of a customer.
    MemberCreate:
      properties:
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer this member belongs to.
        email:
          type: string
          format: email
          title: Email
          description: The email address of the member.
          examples:
            - member@example.com
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the member.
              examples:
                - Jane Doe
            - type: 'null'
          title: Name
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the member in your system. This must be unique within the
            customer. 
          examples:
            - usr_1337
        role:
          type: string
          enum:
            - member
            - billing_manager
          title: Role
          description: >-
            The role of the member within the customer. To assign or transfer
            ownership, use the member update endpoint.
          default: member
          examples:
            - member
      type: object
      required:
        - customer_id
        - email
      title: MemberCreate
      description: Schema for creating a new member.
    MemberOwnerCreate:
      properties:
        email:
          type: string
          format: email
          title: Email
          description: The email address of the member.
          examples:
            - member@example.com
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the member.
              examples:
                - Jane Doe
            - type: 'null'
          title: Name
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the member in your system. This must be unique within the
            customer. 
          examples:
            - usr_1337
      type: object
      required:
        - email
      title: MemberOwnerCreate
      description: Schema for creating an owner member during customer creation.
    MemberRole:
      type: string
      enum:
        - owner
        - billing_manager
        - member
      title: MemberRole
    MemberSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
      title: MemberSortProperty
    MemberUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 256
              description: The name of the member.
              examples:
                - Jane Doe
            - type: 'null'
          title: Name
        role:
          anyOf:
            - $ref: '#/components/schemas/MemberRole'
            - type: 'null'
          description: The role of the member within the customer.
          examples:
            - member
      type: object
      title: MemberUpdate
      description: Schema for updating a member.
    MetadataOutputType:
      additionalProperties:
        anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
      type: object
    Meter:
      properties:
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        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 object.
        name:
          type: string
          title: Name
          description: >-
            The name of the meter. Will be shown on customer's invoices and
            usage.
        unit:
          $ref: '#/components/schemas/MeterUnit'
          description: The unit of the meter.
        custom_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Label
          description: The label for the custom unit.
        custom_multiplier:
          anyOf:
            - type: integer
            - type: 'null'
          title: Custom Multiplier
          description: The multiplier to convert from base unit to display scale.
        filter:
          $ref: '#/components/schemas/Filter'
          description: >-
            The filter to apply on events that'll be used to calculate the
            meter.
        aggregation:
          oneOf:
            - $ref: '#/components/schemas/CountAggregation'
            - $ref: '#/components/schemas/PropertyAggregation'
            - $ref: '#/components/schemas/UniqueAggregation'
          title: Aggregation
          description: >-
            The aggregation to apply on the filtered events to calculate the
            meter.
          discriminator:
            propertyName: func
            mapping:
              avg: '#/components/schemas/PropertyAggregation'
              count: '#/components/schemas/CountAggregation'
              max: '#/components/schemas/PropertyAggregation'
              min: '#/components/schemas/PropertyAggregation'
              sum: '#/components/schemas/PropertyAggregation'
              unique: '#/components/schemas/UniqueAggregation'
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the meter.
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Archived At
          description: Whether the meter is archived and the time it was archived.
      type: object
      required:
        - metadata
        - created_at
        - modified_at
        - id
        - name
        - unit
        - filter
        - aggregation
        - organization_id
      title: Meter
    MeterCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          type: string
          minLength: 3
          title: Name
          description: >-
            The name of the meter. Will be shown on customer's invoices and
            usage.
        unit:
          $ref: '#/components/schemas/MeterUnit'
          description: The unit of the meter.
          default: scalar
        custom_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Label
          description: >-
            The label for the custom unit, e.g. 'request'. Required when unit is
            'custom'.
        custom_multiplier:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Custom Multiplier
          description: >-
            The multiplier to convert from the base unit to display scale, e.g.
            1000 to display per 1000 units. Defaults to 1 when not provided.
        filter:
          $ref: '#/components/schemas/Filter'
          description: >-
            The filter to apply on events that'll be used to calculate the
            meter.
        aggregation:
          oneOf:
            - $ref: '#/components/schemas/CountAggregation'
            - $ref: '#/components/schemas/PropertyAggregation'
            - $ref: '#/components/schemas/UniqueAggregation'
          title: Aggregation
          description: >-
            The aggregation to apply on the filtered events to calculate the
            meter.
          discriminator:
            propertyName: func
            mapping:
              avg: '#/components/schemas/PropertyAggregation'
              count: '#/components/schemas/CountAggregation'
              max: '#/components/schemas/PropertyAggregation'
              min: '#/components/schemas/PropertyAggregation'
              sum: '#/components/schemas/PropertyAggregation'
              unique: '#/components/schemas/UniqueAggregation'
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the meter. **Required unless you
            use an organization token.**
      type: object
      required:
        - name
        - filter
        - aggregation
      title: MeterCreate
    MeterCreditEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: meter.credited
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/MeterCreditedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: MeterCreditEvent
      description: An event created by Polar when credits are added to a customer meter.
    MeterCreditedMetadata:
      properties:
        meter_id:
          type: string
          title: Meter Id
        units:
          type: integer
          title: Units
        rollover:
          type: boolean
          title: Rollover
      type: object
      required:
        - meter_id
        - units
        - rollover
      title: MeterCreditedMetadata
    MeterQuantities:
      properties:
        quantities:
          items:
            $ref: '#/components/schemas/MeterQuantity'
          type: array
          title: Quantities
        total:
          type: number
          title: Total
          description: The total quantity for the period.
          examples:
            - 100
      type: object
      required:
        - quantities
        - total
      title: MeterQuantities
    MeterQuantity:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp for the current period.
        quantity:
          type: number
          title: Quantity
          description: The quantity for the current period.
          examples:
            - 10
      type: object
      required:
        - timestamp
        - quantity
      title: MeterQuantity
    MeterResetEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: meter.reset
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/MeterResetMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: MeterResetEvent
      description: An event created by Polar when a customer meter is reset.
    MeterResetMetadata:
      properties:
        meter_id:
          type: string
          title: Meter Id
      type: object
      required:
        - meter_id
      title: MeterResetMetadata
    MeterSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - name
        - '-name'
      title: MeterSortProperty
    MeterUnit:
      type: string
      enum:
        - scalar
        - token
        - custom
      title: MeterUnit
    MeterUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          anyOf:
            - type: string
              minLength: 3
            - type: 'null'
          title: Name
          description: >-
            The name of the meter. Will be shown on customer's invoices and
            usage.
        unit:
          anyOf:
            - $ref: '#/components/schemas/MeterUnit'
            - type: 'null'
          description: The unit of the meter.
        custom_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Label
          description: The label for the custom unit. Required when unit is 'custom'.
        custom_multiplier:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Custom Multiplier
          description: >-
            The multiplier to convert from base unit to display scale. Required
            when unit is 'custom'.
        filter:
          anyOf:
            - $ref: '#/components/schemas/Filter'
              description: >-
                The filter to apply on events that'll be used to calculate the
                meter.
            - type: 'null'
          description: >-
            The filter to apply on events that'll be used to calculate the
            meter.
        aggregation:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/CountAggregation'
                - $ref: '#/components/schemas/PropertyAggregation'
                - $ref: '#/components/schemas/UniqueAggregation'
              discriminator:
                propertyName: func
                mapping:
                  avg: '#/components/schemas/PropertyAggregation'
                  count: '#/components/schemas/CountAggregation'
                  max: '#/components/schemas/PropertyAggregation'
                  min: '#/components/schemas/PropertyAggregation'
                  sum: '#/components/schemas/PropertyAggregation'
                  unique: '#/components/schemas/UniqueAggregation'
            - type: 'null'
          title: Aggregation
          description: >-
            The aggregation to apply on the filtered events to calculate the
            meter.
        is_archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Archived
          description: >-
            Whether the meter is archived. Archived meters are no longer used
            for billing.
      type: object
      title: MeterUpdate
    Metric:
      properties:
        slug:
          type: string
          title: Slug
          description: Unique identifier for the metric.
        display_name:
          type: string
          title: Display Name
          description: Human-readable name for the metric.
        type:
          $ref: '#/components/schemas/MetricType'
          description: Type of the metric, useful to know the unit or format of the value.
      type: object
      required:
        - slug
        - display_name
        - type
      title: Metric
      description: Information about a metric.
    MetricDashboardCreate:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
          description: Display name for the dashboard.
        metrics:
          items:
            type: string
          type: array
          maxItems: 10
          title: Metrics
          description: List of metric slugs to display in this dashboard.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning this dashboard. **Required unless
            you use an organization token.**
      type: object
      required:
        - name
      title: MetricDashboardCreate
      description: Schema for creating a metrics dashboard.
    MetricDashboardSchema:
      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 object.
        name:
          type: string
          title: Name
          description: Display name for the dashboard.
        metrics:
          items:
            type: string
          type: array
          title: Metrics
          description: List of metric slugs displayed in this dashboard.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning this dashboard.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
        - metrics
        - organization_id
      title: MetricDashboardSchema
      description: A user-defined metrics dashboard.
    MetricDashboardUpdate:
      properties:
        name:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Name
          description: Display name for the dashboard.
        metrics:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 10
            - type: 'null'
          title: Metrics
          description: List of metric slugs to display in this dashboard.
      type: object
      title: MetricDashboardUpdate
      description: Schema for updating a metrics dashboard.
    MetricPeriod:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: Timestamp of this period data.
        active_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Active Subscriptions
        committed_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Committed Subscriptions
        monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Monthly Recurring Revenue
        trial_monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Trial Monthly Recurring Revenue
        committed_monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Committed Monthly Recurring Revenue
        trial_committed_monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Trial Committed Monthly Recurring Revenue
        average_revenue_per_user:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Average Revenue Per User
        checkouts:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Checkouts
        succeeded_checkouts:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Succeeded Checkouts
        churned_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Churned Subscriptions
        churn_rate:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Churn Rate
        seats_total:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seats Total
        seats_claimed:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seats Claimed
        seats_pending:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seats Pending
        seat_customers:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seat Customers
        new_seat_customers:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Seat Customers
        churned_seat_customers:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Churned Seat Customers
        orders:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Orders
        revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Revenue
        net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Net Revenue
        cumulative_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cumulative Revenue
        net_cumulative_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Net Cumulative Revenue
        costs:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Costs
        cumulative_costs:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cumulative Costs
        average_order_value:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Average Order Value
        net_average_order_value:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Net Average Order Value
        cost_per_user:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cost Per User
        active_user_by_event:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Active User By Event
        one_time_products:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: One Time Products
        one_time_products_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: One Time Products Revenue
        one_time_products_net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: One Time Products Net Revenue
        new_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Subscriptions
        new_subscriptions_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Subscriptions Revenue
        new_subscriptions_net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Subscriptions Net Revenue
        renewed_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Renewed Subscriptions
        renewed_subscriptions_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Renewed Subscriptions Revenue
        renewed_subscriptions_net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Renewed Subscriptions Net Revenue
        canceled_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions
        canceled_subscriptions_customer_service:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Customer Service
        canceled_subscriptions_low_quality:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Low Quality
        canceled_subscriptions_missing_features:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Missing Features
        canceled_subscriptions_switched_service:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Switched Service
        canceled_subscriptions_too_complex:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Too Complex
        canceled_subscriptions_too_expensive:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Too Expensive
        canceled_subscriptions_unused:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Unused
        canceled_subscriptions_other:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Other
        annual_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Annual Recurring Revenue
        committed_annual_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Committed Annual Recurring Revenue
        checkouts_conversion:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Checkouts Conversion
        ltv:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Ltv
        gross_margin:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Gross Margin
        gross_margin_percentage:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Gross Margin Percentage
        cashflow:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cashflow
        average_seats_per_customer:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Average Seats Per Customer
        seat_utilization_rate:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seat Utilization Rate
      type: object
      required:
        - timestamp
      title: MetricPeriod
    MetricType:
      type: string
      enum:
        - scalar
        - currency
        - currency_sub_cent
        - percentage
      title: MetricType
    Metrics:
      properties:
        active_subscriptions:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        committed_subscriptions:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        monthly_recurring_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        trial_monthly_recurring_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        committed_monthly_recurring_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        trial_committed_monthly_recurring_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        average_revenue_per_user:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        checkouts:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        succeeded_checkouts:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        churned_subscriptions:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        churn_rate:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        seats_total:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        seats_claimed:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        seats_pending:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        seat_customers:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        new_seat_customers:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        churned_seat_customers:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        orders:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        net_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        cumulative_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        net_cumulative_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        costs:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        cumulative_costs:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        average_order_value:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        net_average_order_value:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        cost_per_user:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        active_user_by_event:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        one_time_products:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        one_time_products_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        one_time_products_net_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        new_subscriptions:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        new_subscriptions_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        new_subscriptions_net_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        renewed_subscriptions:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        renewed_subscriptions_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        renewed_subscriptions_net_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_customer_service:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_low_quality:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_missing_features:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_switched_service:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_too_complex:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_too_expensive:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_unused:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        canceled_subscriptions_other:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        annual_recurring_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        committed_annual_recurring_revenue:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        checkouts_conversion:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        ltv:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        gross_margin:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        gross_margin_percentage:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        cashflow:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        average_seats_per_customer:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
        seat_utilization_rate:
          anyOf:
            - $ref: '#/components/schemas/Metric'
            - type: 'null'
      type: object
      title: Metrics
    MetricsIntervalLimit:
      properties:
        min_days:
          type: integer
          title: Min Days
          description: Minimum number of days for this interval.
        max_days:
          type: integer
          title: Max Days
          description: Maximum number of days for this interval.
      type: object
      required:
        - min_days
        - max_days
      title: MetricsIntervalLimit
      description: Date interval limit to get metrics for a given interval.
    MetricsIntervalsLimits:
      properties:
        hour:
          $ref: '#/components/schemas/MetricsIntervalLimit'
          description: Limits for the hour interval.
        day:
          $ref: '#/components/schemas/MetricsIntervalLimit'
          description: Limits for the day interval.
        week:
          $ref: '#/components/schemas/MetricsIntervalLimit'
          description: Limits for the week interval.
        month:
          $ref: '#/components/schemas/MetricsIntervalLimit'
          description: Limits for the month interval.
        year:
          $ref: '#/components/schemas/MetricsIntervalLimit'
          description: Limits for the year interval.
      type: object
      required:
        - hour
        - day
        - week
        - month
        - year
      title: MetricsIntervalsLimits
      description: Date interval limits to get metrics for each interval.
    MetricsLimits:
      properties:
        min_date:
          type: string
          format: date
          title: Min Date
          description: Minimum date to get metrics.
        intervals:
          $ref: '#/components/schemas/MetricsIntervalsLimits'
          description: Limits for each interval.
      type: object
      required:
        - min_date
        - intervals
      title: MetricsLimits
      description: Date limits to get metrics.
    MetricsResponse:
      properties:
        periods:
          items:
            $ref: '#/components/schemas/MetricPeriod'
          type: array
          title: Periods
          description: List of data for each timestamp.
        totals:
          $ref: '#/components/schemas/MetricsTotals'
          description: Totals for the whole selected period.
        metrics:
          $ref: '#/components/schemas/Metrics'
          description: Information about the returned metrics.
      type: object
      required:
        - periods
        - totals
        - metrics
      title: MetricsResponse
      description: Metrics response schema.
    MetricsTotals:
      properties:
        active_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Active Subscriptions
        committed_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Committed Subscriptions
        monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Monthly Recurring Revenue
        trial_monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Trial Monthly Recurring Revenue
        committed_monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Committed Monthly Recurring Revenue
        trial_committed_monthly_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Trial Committed Monthly Recurring Revenue
        average_revenue_per_user:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Average Revenue Per User
        checkouts:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Checkouts
        succeeded_checkouts:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Succeeded Checkouts
        churned_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Churned Subscriptions
        churn_rate:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Churn Rate
        seats_total:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seats Total
        seats_claimed:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seats Claimed
        seats_pending:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seats Pending
        seat_customers:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seat Customers
        new_seat_customers:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Seat Customers
        churned_seat_customers:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Churned Seat Customers
        orders:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Orders
        revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Revenue
        net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Net Revenue
        cumulative_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cumulative Revenue
        net_cumulative_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Net Cumulative Revenue
        costs:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Costs
        cumulative_costs:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cumulative Costs
        average_order_value:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Average Order Value
        net_average_order_value:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Net Average Order Value
        cost_per_user:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cost Per User
        active_user_by_event:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Active User By Event
        one_time_products:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: One Time Products
        one_time_products_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: One Time Products Revenue
        one_time_products_net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: One Time Products Net Revenue
        new_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Subscriptions
        new_subscriptions_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Subscriptions Revenue
        new_subscriptions_net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: New Subscriptions Net Revenue
        renewed_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Renewed Subscriptions
        renewed_subscriptions_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Renewed Subscriptions Revenue
        renewed_subscriptions_net_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Renewed Subscriptions Net Revenue
        canceled_subscriptions:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions
        canceled_subscriptions_customer_service:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Customer Service
        canceled_subscriptions_low_quality:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Low Quality
        canceled_subscriptions_missing_features:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Missing Features
        canceled_subscriptions_switched_service:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Switched Service
        canceled_subscriptions_too_complex:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Too Complex
        canceled_subscriptions_too_expensive:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Too Expensive
        canceled_subscriptions_unused:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Unused
        canceled_subscriptions_other:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Canceled Subscriptions Other
        annual_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Annual Recurring Revenue
        committed_annual_recurring_revenue:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Committed Annual Recurring Revenue
        checkouts_conversion:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Checkouts Conversion
        ltv:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Ltv
        gross_margin:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Gross Margin
        gross_margin_percentage:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Gross Margin Percentage
        cashflow:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Cashflow
        average_seats_per_customer:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Average Seats Per Customer
        seat_utilization_rate:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Seat Utilization Rate
      type: object
      title: MetricsTotals
    MissingInvoiceBillingDetails:
      properties:
        error:
          type: string
          const: MissingInvoiceBillingDetails
          title: Error
          examples:
            - MissingInvoiceBillingDetails
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: MissingInvoiceBillingDetails
    NotOpenCheckout:
      properties:
        error:
          type: string
          const: NotOpenCheckout
          title: Error
          examples:
            - NotOpenCheckout
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: NotOpenCheckout
    NotPaidOrder:
      properties:
        error:
          type: string
          const: NotPaidOrder
          title: Error
          examples:
            - NotPaidOrder
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: NotPaidOrder
    NotPermitted:
      properties:
        error:
          type: string
          const: NotPermitted
          title: Error
          examples:
            - NotPermitted
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: NotPermitted
    OAuth2ClientConfiguration:
      properties:
        redirect_uris:
          items:
            type: string
            minLength: 1
            format: uri
          type: array
          title: Redirect Uris
        token_endpoint_auth_method:
          type: string
          enum:
            - client_secret_basic
            - client_secret_post
            - none
          title: Token Endpoint Auth Method
          default: client_secret_post
        grant_types:
          items:
            type: string
            enum:
              - authorization_code
              - refresh_token
          type: array
          title: Grant Types
          default:
            - authorization_code
            - refresh_token
        response_types:
          items:
            type: string
            const: code
          type: array
          title: Response Types
          default:
            - code
        scope:
          type: string
          title: Scope
          default: >-
            openid profile email user:read user:write organizations:read
            organizations:write custom_fields:read custom_fields:write
            discounts:read discounts:write checkout_links:read
            checkout_links:write checkouts:read checkouts:write
            transactions:read transactions:write payouts:read payouts:write
            products:read products:write benefits:read benefits:write
            events:read events:write meters:read meters:write files:read
            files:write subscriptions:read subscriptions:write customers:read
            customers:write members:read members:write wallets:read
            wallets:write disputes:read customer_meters:read
            customer_sessions:write member_sessions:write customer_seats:read
            customer_seats:write orders:read orders:write refunds:read
            refunds:write payments:read metrics:read metrics:write webhooks:read
            webhooks:write license_keys:read license_keys:write
            customer_portal:read customer_portal:write notifications:read
            notifications:write notification_recipients:read
            notification_recipients:write organization_access_tokens:read
            organization_access_tokens:write
        client_name:
          type: string
          title: Client Name
        client_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Uri
        logo_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Logo Uri
        tos_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Tos Uri
        policy_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Policy Uri
        default_sub_type:
          $ref: '#/components/schemas/SubType'
          default: organization
      type: object
      required:
        - redirect_uris
        - client_name
      title: OAuth2ClientConfiguration
    OAuth2ClientConfigurationUpdate:
      properties:
        redirect_uris:
          items:
            type: string
            minLength: 1
            format: uri
          type: array
          title: Redirect Uris
        token_endpoint_auth_method:
          type: string
          enum:
            - client_secret_basic
            - client_secret_post
            - none
          title: Token Endpoint Auth Method
          default: client_secret_post
        grant_types:
          items:
            type: string
            enum:
              - authorization_code
              - refresh_token
          type: array
          title: Grant Types
          default:
            - authorization_code
            - refresh_token
        response_types:
          items:
            type: string
            const: code
          type: array
          title: Response Types
          default:
            - code
        scope:
          type: string
          title: Scope
          default: >-
            openid profile email user:read user:write organizations:read
            organizations:write custom_fields:read custom_fields:write
            discounts:read discounts:write checkout_links:read
            checkout_links:write checkouts:read checkouts:write
            transactions:read transactions:write payouts:read payouts:write
            products:read products:write benefits:read benefits:write
            events:read events:write meters:read meters:write files:read
            files:write subscriptions:read subscriptions:write customers:read
            customers:write members:read members:write wallets:read
            wallets:write disputes:read customer_meters:read
            customer_sessions:write member_sessions:write customer_seats:read
            customer_seats:write orders:read orders:write refunds:read
            refunds:write payments:read metrics:read metrics:write webhooks:read
            webhooks:write license_keys:read license_keys:write
            customer_portal:read customer_portal:write notifications:read
            notifications:write notification_recipients:read
            notification_recipients:write organization_access_tokens:read
            organization_access_tokens:write
        client_name:
          type: string
          title: Client Name
        client_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Uri
        logo_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Logo Uri
        tos_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Tos Uri
        policy_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Policy Uri
        default_sub_type:
          $ref: '#/components/schemas/SubType'
          default: organization
        client_id:
          type: string
          title: Client Id
      type: object
      required:
        - redirect_uris
        - client_name
        - client_id
      title: OAuth2ClientConfigurationUpdate
    OAuth2ClientPublic:
      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.
        client_id:
          type: string
          title: Client Id
        client_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Name
        client_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Uri
        logo_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Logo Uri
        tos_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Tos Uri
        policy_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Policy Uri
      type: object
      required:
        - created_at
        - modified_at
        - client_id
        - client_name
        - client_uri
        - logo_uri
        - tos_uri
        - policy_uri
      title: OAuth2ClientPublic
    OffSessionChargesNotEnabled:
      properties:
        error:
          type: string
          const: OffSessionChargesNotEnabled
          title: Error
          examples:
            - OffSessionChargesNotEnabled
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: OffSessionChargesNotEnabled
    Order:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        status:
          $ref: '#/components/schemas/OrderStatus'
          examples:
            - paid
        paid:
          type: boolean
          title: Paid
          description: Whether the order has been paid for.
          examples:
            - true
        subtotal_amount:
          type: integer
          title: Subtotal Amount
          description: Amount in cents, before discounts and taxes.
          examples:
            - 10000
        discount_amount:
          type: integer
          title: Discount Amount
          description: Discount amount in cents.
          examples:
            - 1000
        net_amount:
          type: integer
          title: Net Amount
          description: Amount in cents, after discounts but before taxes.
          examples:
            - 9000
        tax_amount:
          type: integer
          title: Tax Amount
          description: Sales tax amount in cents.
          examples:
            - 720
        total_amount:
          type: integer
          title: Total Amount
          description: Amount in cents, after discounts and taxes.
          examples:
            - 9720
        applied_balance_amount:
          type: integer
          title: Applied Balance Amount
          description: >-
            Customer's balance amount applied to this invoice. Can increase the
            total amount paid, if the customer has a negative balance,  or
            decrease it, if the customer has a positive balance.Amount in cents.
          examples:
            - 0
        due_amount:
          type: integer
          title: Due Amount
          description: Amount in cents that is due for this order.
          examples:
            - 0
        refunded_amount:
          type: integer
          title: Refunded Amount
          description: Amount refunded in cents.
          examples:
            - 0
        refunded_tax_amount:
          type: integer
          title: Refunded Tax Amount
          description: Sales tax refunded in cents.
          examples:
            - 0
        currency:
          type: string
          title: Currency
          examples:
            - usd
        billing_reason:
          $ref: '#/components/schemas/OrderBillingReason'
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: 'The name of the customer that should appear on the invoice. '
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: >-
            The invoice number associated with this order. `null` while the
            order is in `draft` status; assigned at finalize.
        is_invoice_generated:
          type: boolean
          title: Is Invoice Generated
          description: Whether an invoice has been generated for this order.
        receipt_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Receipt Number
          description: >-
            The receipt number for this order. Set once the order is paid for
            organizations with receipts enabled. When set, a downloadable
            receipt PDF can be obtained via the receipt endpoint.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: Number of seats purchased (for seat-based one-time orders).
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        platform_fee_amount:
          type: integer
          title: Platform Fee Amount
          description: Platform fee amount in cents.
          examples:
            - 500
        platform_fee_currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform Fee Currency
          description: Currency of the platform fee.
          examples:
            - usd
        customer:
          $ref: '#/components/schemas/OrderCustomer'
        product:
          anyOf:
            - $ref: '#/components/schemas/OrderProduct'
            - type: 'null'
        discount:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/DiscountFixedOnceForeverDurationBase'
                - $ref: '#/components/schemas/DiscountFixedRepeatDurationBase'
                - $ref: >-
                    #/components/schemas/DiscountPercentageOnceForeverDurationBase
                - $ref: '#/components/schemas/DiscountPercentageRepeatDurationBase'
              title: OrderDiscount
            - type: 'null'
          title: Discount
        subscription:
          anyOf:
            - $ref: '#/components/schemas/OrderSubscription'
            - type: 'null'
        items:
          items:
            $ref: '#/components/schemas/OrderItemSchema'
          type: array
          title: Items
          description: Line items composing the order.
        description:
          type: string
          title: Description
          description: A summary description of the order.
          examples:
            - Pro Plan
        refundable_amount:
          type: integer
          title: Refundable Amount
          description: >-
            Amount in cents that can still be refunded (net, before taxes).
            Accounts for any applied customer balance and previous refunds.
          examples:
            - 9000
        refundable_tax_amount:
          type: integer
          title: Refundable Tax Amount
          description: >-
            Sales tax in cents that would be refunded if the full refundable
            amount is refunded.
          examples:
            - 720
      type: object
      required:
        - id
        - created_at
        - modified_at
        - status
        - paid
        - subtotal_amount
        - discount_amount
        - net_amount
        - tax_amount
        - total_amount
        - applied_balance_amount
        - due_amount
        - refunded_amount
        - refunded_tax_amount
        - currency
        - billing_reason
        - billing_name
        - billing_address
        - invoice_number
        - is_invoice_generated
        - receipt_number
        - customer_id
        - product_id
        - discount_id
        - subscription_id
        - checkout_id
        - metadata
        - platform_fee_amount
        - platform_fee_currency
        - customer
        - product
        - discount
        - subscription
        - items
        - description
        - refundable_amount
        - refundable_tax_amount
      title: Order
    OrderBillingReason:
      type: string
      enum:
        - purchase
        - subscription_create
        - subscription_cycle
        - subscription_update
      title: OrderBillingReason
    OrderBillingReasonInternal:
      type: string
      enum:
        - purchase
        - subscription_create
        - subscription_cycle
        - subscription_cycle_after_trial
        - subscription_cancel
        - subscription_update
      title: OrderBillingReasonInternal
      description: Internal billing reasons with additional granularity.
    OrderCreate:
      properties:
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization the order belongs to. **Required unless
            you use an organization token.** The customer and product must
            belong to this organization.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: >-
            The ID of the customer the order is for. Must belong to the order's
            organization.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: >-
            The ID of the one-time product to charge for. Must belong to the
            order's organization. Only fixed-price and free products are
            supported.
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: >-
            The currency to charge in (ISO 4217, lowercase, e.g. `usd`).
            Defaults to the organization's default currency; specify it to force
            a different one, or when the product isn't priced in the
            organization's default currency.
        amount:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Amount
          description: >-
            A custom amount to charge, in the smallest currency unit. Overrides
            the product's price; defaults to the product's configured price (0
            for free products). A positive amount must be at least the
            currency's minimum.
        description:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Description
          description: >-
            A custom description for the order's line item, shown on the invoice
            and receipt (e.g. `5,000 tokens`). Defaults to the product name.
      type: object
      required:
        - customer_id
        - product_id
      title: OrderCreate
      description: Schema to create a draft order for an off-session charge.
    OrderCustomer:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          $ref: '#/components/schemas/CustomerType'
          description: >-
            The type of customer: 'individual' for single users, 'team' for
            customers with multiple members.
          examples:
            - individual
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
      title: OrderCustomer
    OrderFinalize:
      properties:
        payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Payment Method Id
          description: >-
            ID of the payment method to charge. Must belong to the order's
            customer. Falls back to the customer's default payment method when
            unset.
      type: object
      title: OrderFinalize
      description: Schema to finalize a draft order and trigger an off-session charge.
    OrderInvoice:
      properties:
        url:
          type: string
          title: Url
          description: The URL to the invoice.
      type: object
      required:
        - url
      title: OrderInvoice
      description: Order's invoice data.
    OrderItemSchema:
      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 object.
        label:
          type: string
          title: Label
          description: Description of the line item charge.
          examples:
            - Pro Plan
        amount:
          type: integer
          title: Amount
          description: Amount in cents, before discounts and taxes.
          examples:
            - 10000
        tax_amount:
          type: integer
          title: Tax Amount
          description: Sales tax amount in cents.
          examples:
            - 720
        proration:
          type: boolean
          title: Proration
          description: Whether this charge is due to a proration.
          examples:
            - false
        product_price_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Price Id
          description: Associated price ID, if any.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - label
        - amount
        - tax_amount
        - proration
        - product_price_id
      title: OrderItemSchema
      description: An order line item.
    OrderNotDraft:
      properties:
        error:
          type: string
          const: OrderNotDraft
          title: Error
          examples:
            - OrderNotDraft
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: OrderNotDraft
    OrderNotEligibleForRetry:
      properties:
        error:
          type: string
          const: OrderNotEligibleForRetry
          title: Error
          examples:
            - OrderNotEligibleForRetry
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: OrderNotEligibleForRetry
    OrderPaidEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: order.paid
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/OrderPaidMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: OrderPaidEvent
      description: An event created by Polar when an order is paid.
    OrderPaidMetadata:
      properties:
        order_id:
          type: string
          title: Order Id
        product_id:
          type: string
          title: Product Id
        billing_type:
          type: string
          title: Billing Type
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        net_amount:
          type: integer
          title: Net Amount
        tax_amount:
          type: integer
          title: Tax Amount
        applied_balance_amount:
          type: integer
          title: Applied Balance Amount
        discount_amount:
          type: integer
          title: Discount Amount
        discount_id:
          type: string
          title: Discount Id
        platform_fee:
          type: integer
          title: Platform Fee
        subscription_id:
          type: string
          title: Subscription Id
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
      type: object
      required:
        - order_id
        - amount
      title: OrderPaidMetadata
    OrderProduct:
      properties:
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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.
      type: object
      required:
        - metadata
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
      title: OrderProduct
    OrderReceipt:
      properties:
        url:
          type: string
          title: Url
          description: The URL to the receipt PDF.
      type: object
      required:
        - url
      title: OrderReceipt
      description: Order's receipt data.
    OrderRefundedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: order.refunded
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/OrderRefundedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: OrderRefundedEvent
      description: An event created by Polar when an order is refunded.
    OrderRefundedMetadata:
      properties:
        order_id:
          type: string
          title: Order Id
        refunded_amount:
          type: integer
          title: Refunded Amount
        currency:
          type: string
          title: Currency
      type: object
      required:
        - order_id
        - refunded_amount
        - currency
      title: OrderRefundedMetadata
    OrderSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - status
        - '-status'
        - invoice_number
        - '-invoice_number'
        - amount
        - '-amount'
        - net_amount
        - '-net_amount'
        - customer
        - '-customer'
        - product
        - '-product'
        - discount
        - '-discount'
        - subscription
        - '-subscription'
      title: OrderSortProperty
    OrderStatus:
      type: string
      enum:
        - draft
        - pending
        - paid
        - refunded
        - partially_refunded
        - void
      title: OrderStatus
    OrderSubscription:
      properties:
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        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 object.
        amount:
          type: integer
          title: Amount
          description: The amount of the subscription.
          examples:
            - 10000
        currency:
          type: string
          title: Currency
          description: The currency of the subscription.
          examples:
            - usd
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The interval at which the subscription recurs.
          examples:
            - month
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on.
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
          description: The status of the subscription.
          examples:
            - active
        current_period_start:
          type: string
          format: date-time
          title: Current Period Start
          description: The start timestamp of the current billing period.
        current_period_end:
          type: string
          format: date-time
          title: Current Period End
          description: The end timestamp of the current billing period.
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: The start timestamp of the trial period, if any.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: The end timestamp of the trial period, if any.
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Whether the subscription will be canceled at the end of the current
            period.
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: >-
            The timestamp when the subscription was canceled. The subscription
            might still be active if `cancel_at_period_end` is `true`.
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
          description: The timestamp when the subscription started.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: The timestamp when the subscription will end.
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
          description: The timestamp when the subscription ended.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the subscribed customer.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the subscribed product.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: The ID of the applied discount, if any.
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: >-
            The number of seats for seat-based subscriptions. None for non-seat
            subscriptions.
        customer_cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
        customer_cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Cancellation Comment
      type: object
      required:
        - metadata
        - created_at
        - modified_at
        - id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
        - status
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - cancel_at_period_end
        - canceled_at
        - started_at
        - ends_at
        - ended_at
        - customer_id
        - product_id
        - discount_id
        - checkout_id
        - customer_cancellation_reason
        - customer_cancellation_comment
      title: OrderSubscription
    OrderUpdate:
      properties:
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: The name of the customer that should appear on the invoice.
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/AddressInput'
            - type: 'null'
          description: >-
            The address of the customer that should appear on the invoice.
            Country and state fields cannot be updated.
      type: object
      title: OrderUpdate
      description: Schema to update an order.
    OrderUser:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        public_name:
          type: string
          title: Public Name
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
        github_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Github Username
      type: object
      required:
        - id
        - public_name
      title: OrderUser
    OrderVoidedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: order.voided
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/OrderVoidedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: OrderVoidedEvent
      description: An event created by Polar when an order is voided.
    OrderVoidedMetadata:
      properties:
        order_id:
          type: string
          title: Order Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
      type: object
      required:
        - order_id
        - amount
        - currency
      title: OrderVoidedMetadata
    Organization:
      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 object.
        name:
          type: string
          title: Name
          description: Organization name shown in checkout, customer portal, emails etc.
        slug:
          type: string
          title: Slug
          description: >-
            Unique organization slug in checkout, customer portal and credit
            card statements.
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          description: Avatar URL shown in checkout, customer portal, emails etc.
        proration_behavior:
          $ref: '#/components/schemas/SubscriptionProrationBehavior'
          description: >-
            Proration behavior applied when customer updates their subscription
            from the portal.
        allow_customer_updates:
          type: boolean
          title: Allow Customer Updates
          description: >-
            Whether customers can update their subscriptions from the customer
            portal.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Public support email.
        website:
          anyOf:
            - type: string
            - type: 'null'
          title: Website
          description: Official website of the organization.
        socials:
          items:
            $ref: '#/components/schemas/OrganizationSocialLink'
          type: array
          title: Socials
          description: Links to social profiles.
        status:
          $ref: '#/components/schemas/OrganizationStatus'
          description: Current organization status
        details_submitted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Details Submitted At
          description: When the business details were submitted for review.
        default_presentment_currency:
          type: string
          title: Default Presentment Currency
          description: >-
            Default presentment currency. Used as fallback in checkout and
            customer portal, if the customer's local currency is not available.
        default_tax_behavior:
          $ref: '#/components/schemas/TaxBehaviorOption'
          description: Default tax behavior applied on products.
        feature_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationFeatureSettings'
            - type: 'null'
          description: Organization feature settings
        subscription_settings:
          $ref: '#/components/schemas/OrganizationSubscriptionSettings'
          description: Settings related to subscriptions management
        notification_settings:
          $ref: '#/components/schemas/OrganizationNotificationSettings'
          description: Settings related to notifications
        customer_email_settings:
          $ref: '#/components/schemas/OrganizationCustomerEmailSettings'
          description: Settings related to customer emails
        customer_portal_settings:
          $ref: '#/components/schemas/OrganizationCustomerPortalSettings'
          description: Settings related to the customer portal
        country:
          anyOf:
            - type: string
              enum:
                - AD
                - AE
                - AF
                - AG
                - AI
                - AL
                - AM
                - AO
                - AQ
                - AR
                - AS
                - AT
                - AU
                - AW
                - AX
                - AZ
                - BA
                - BB
                - BD
                - BE
                - BF
                - BG
                - BH
                - BI
                - BJ
                - BL
                - BM
                - BN
                - BO
                - BQ
                - BR
                - BS
                - BT
                - BV
                - BW
                - BY
                - BZ
                - CA
                - CC
                - CD
                - CF
                - CG
                - CH
                - CI
                - CK
                - CL
                - CM
                - CN
                - CO
                - CR
                - CU
                - CV
                - CW
                - CX
                - CY
                - CZ
                - DE
                - DJ
                - DK
                - DM
                - DO
                - DZ
                - EC
                - EE
                - EG
                - EH
                - ER
                - ES
                - ET
                - FI
                - FJ
                - FK
                - FM
                - FO
                - FR
                - GA
                - GB
                - GD
                - GE
                - GF
                - GG
                - GH
                - GI
                - GL
                - GM
                - GN
                - GP
                - GQ
                - GR
                - GS
                - GT
                - GU
                - GW
                - GY
                - HK
                - HM
                - HN
                - HR
                - HT
                - HU
                - ID
                - IE
                - IL
                - IM
                - IN
                - IO
                - IQ
                - IR
                - IS
                - IT
                - JE
                - JM
                - JO
                - JP
                - KE
                - KG
                - KH
                - KI
                - KM
                - KN
                - KP
                - KR
                - KW
                - KY
                - KZ
                - LA
                - LB
                - LC
                - LI
                - LK
                - LR
                - LS
                - LT
                - LU
                - LV
                - LY
                - MA
                - MC
                - MD
                - ME
                - MF
                - MG
                - MH
                - MK
                - ML
                - MM
                - MN
                - MO
                - MP
                - MQ
                - MR
                - MS
                - MT
                - MU
                - MV
                - MW
                - MX
                - MY
                - MZ
                - NA
                - NC
                - NE
                - NF
                - NG
                - NI
                - NL
                - 'NO'
                - NP
                - NR
                - NU
                - NZ
                - OM
                - PA
                - PE
                - PF
                - PG
                - PH
                - PK
                - PL
                - PM
                - PN
                - PR
                - PS
                - PT
                - PW
                - PY
                - QA
                - RE
                - RO
                - RS
                - RU
                - RW
                - SA
                - SB
                - SC
                - SD
                - SE
                - SG
                - SH
                - SI
                - SJ
                - SK
                - SL
                - SM
                - SN
                - SO
                - SR
                - SS
                - ST
                - SV
                - SX
                - SY
                - SZ
                - TC
                - TD
                - TF
                - TG
                - TH
                - TJ
                - TK
                - TL
                - TM
                - TN
                - TO
                - TR
                - TT
                - TV
                - TW
                - TZ
                - UA
                - UG
                - UM
                - US
                - UY
                - UZ
                - VA
                - VC
                - VE
                - VG
                - VI
                - VN
                - VU
                - WF
                - WS
                - YE
                - YT
                - ZA
                - ZM
                - ZW
              title: CountryAlpha2
              x-speakeasy-enums:
                - AD
                - AE
                - AF
                - AG
                - AI
                - AL
                - AM
                - AO
                - AQ
                - AR
                - AS
                - AT
                - AU
                - AW
                - AX
                - AZ
                - BA
                - BB
                - BD
                - BE
                - BF
                - BG
                - BH
                - BI
                - BJ
                - BL
                - BM
                - BN
                - BO
                - BQ
                - BR
                - BS
                - BT
                - BV
                - BW
                - BY
                - BZ
                - CA
                - CC
                - CD
                - CF
                - CG
                - CH
                - CI
                - CK
                - CL
                - CM
                - CN
                - CO
                - CR
                - CU
                - CV
                - CW
                - CX
                - CY
                - CZ
                - DE
                - DJ
                - DK
                - DM
                - DO
                - DZ
                - EC
                - EE
                - EG
                - EH
                - ER
                - ES
                - ET
                - FI
                - FJ
                - FK
                - FM
                - FO
                - FR
                - GA
                - GB
                - GD
                - GE
                - GF
                - GG
                - GH
                - GI
                - GL
                - GM
                - GN
                - GP
                - GQ
                - GR
                - GS
                - GT
                - GU
                - GW
                - GY
                - HK
                - HM
                - HN
                - HR
                - HT
                - HU
                - ID
                - IE
                - IL
                - IM
                - IN
                - IO
                - IQ
                - IR
                - IS
                - IT
                - JE
                - JM
                - JO
                - JP
                - KE
                - KG
                - KH
                - KI
                - KM
                - KN
                - KP
                - KR
                - KW
                - KY
                - KZ
                - LA
                - LB
                - LC
                - LI
                - LK
                - LR
                - LS
                - LT
                - LU
                - LV
                - LY
                - MA
                - MC
                - MD
                - ME
                - MF
                - MG
                - MH
                - MK
                - ML
                - MM
                - MN
                - MO
                - MP
                - MQ
                - MR
                - MS
                - MT
                - MU
                - MV
                - MW
                - MX
                - MY
                - MZ
                - NA
                - NC
                - NE
                - NF
                - NG
                - NI
                - NL
                - 'NO'
                - NP
                - NR
                - NU
                - NZ
                - OM
                - PA
                - PE
                - PF
                - PG
                - PH
                - PK
                - PL
                - PM
                - PN
                - PR
                - PS
                - PT
                - PW
                - PY
                - QA
                - RE
                - RO
                - RS
                - RU
                - RW
                - SA
                - SB
                - SC
                - SD
                - SE
                - SG
                - SH
                - SI
                - SJ
                - SK
                - SL
                - SM
                - SN
                - SO
                - SR
                - SS
                - ST
                - SV
                - SX
                - SY
                - SZ
                - TC
                - TD
                - TF
                - TG
                - TH
                - TJ
                - TK
                - TL
                - TM
                - TN
                - TO
                - TR
                - TT
                - TV
                - TW
                - TZ
                - UA
                - UG
                - UM
                - US
                - UY
                - UZ
                - VA
                - VC
                - VE
                - VG
                - VI
                - VN
                - VU
                - WF
                - WS
                - YE
                - YT
                - ZA
                - ZM
                - ZW
            - type: 'null'
          description: Two-letter country code (ISO 3166-1 alpha-2).
        account_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Account Id
          description: ID of the transactions account.
        payout_account_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Payout Account Id
          description: ID of the payout account.
        capabilities:
          $ref: '#/components/schemas/OrganizationCapabilities'
          description: Capabilities currently granted to the organization.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - name
        - slug
        - avatar_url
        - proration_behavior
        - allow_customer_updates
        - email
        - website
        - socials
        - status
        - details_submitted_at
        - default_presentment_currency
        - default_tax_behavior
        - feature_settings
        - subscription_settings
        - notification_settings
        - customer_email_settings
        - customer_portal_settings
        - account_id
        - payout_account_id
        - capabilities
      title: Organization
    OrganizationAccessToken:
      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
        scopes:
          items:
            $ref: '#/components/schemas/Scope'
          type: array
          title: Scopes
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        comment:
          type: string
          title: Comment
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
      type: object
      required:
        - created_at
        - modified_at
        - id
        - scopes
        - expires_at
        - comment
        - last_used_at
        - organization_id
      title: OrganizationAccessToken
    OrganizationAccessTokenCreate:
      properties:
        organization_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Organization Id
        comment:
          type: string
          title: Comment
        expires_in:
          anyOf:
            - type: string
              format: duration
            - type: 'null'
          title: Expires In
        scopes:
          items:
            $ref: '#/components/schemas/AvailableScope'
          type: array
          title: Scopes
      type: object
      required:
        - comment
        - scopes
      title: OrganizationAccessTokenCreate
    OrganizationAccessTokenCreateResponse:
      properties:
        organization_access_token:
          $ref: '#/components/schemas/OrganizationAccessToken'
        token:
          type: string
          title: Token
      type: object
      required:
        - organization_access_token
        - token
      title: OrganizationAccessTokenCreateResponse
    OrganizationAccessTokenSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - comment
        - '-comment'
        - last_used_at
        - '-last_used_at'
        - organization_id
        - '-organization_id'
      title: OrganizationAccessTokenSortProperty
    OrganizationAccessTokenUpdate:
      properties:
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        scopes:
          anyOf:
            - items:
                $ref: '#/components/schemas/AvailableScope'
              type: array
            - type: 'null'
          title: Scopes
      type: object
      title: OrganizationAccessTokenUpdate
    OrganizationAvatarFileCreate:
      properties:
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
        name:
          type: string
          title: Name
        mime_type:
          type: string
          pattern: ^image\/(jpeg|png|gif|webp|svg\+xml)$
          title: Mime Type
          description: >-
            MIME type of the file. Only images are supported for this type of
            file.
        size:
          type: integer
          maximum: 1048576
          title: Size
          description: >-
            Size of the file. A maximum of 1 MB is allowed for this type of
            file.
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        upload:
          $ref: '#/components/schemas/S3FileCreateMultipart'
        service:
          type: string
          const: organization_avatar
          title: Service
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
      type: object
      required:
        - name
        - mime_type
        - size
        - upload
        - service
      title: OrganizationAvatarFileCreate
      description: Schema to create a file to be used as an organization avatar.
    OrganizationAvatarFileRead:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
        mime_type:
          type: string
          title: Mime Type
        size:
          type: integer
          title: Size
        storage_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Version
        checksum_etag:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Etag
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        checksum_sha256_hex:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Hex
        last_modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Modified At
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        service:
          type: string
          const: organization_avatar
          title: Service
        is_uploaded:
          type: boolean
          title: Is Uploaded
        created_at:
          type: string
          format: date-time
          title: Created At
        size_readable:
          type: string
          title: Size Readable
        public_url:
          type: string
          title: Public Url
      type: object
      required:
        - id
        - organization_id
        - name
        - path
        - mime_type
        - size
        - storage_version
        - checksum_etag
        - checksum_sha256_base64
        - checksum_sha256_hex
        - last_modified_at
        - version
        - service
        - is_uploaded
        - created_at
        - size_readable
        - public_url
      title: OrganizationAvatarFileRead
      description: File to be used as an organization avatar.
    OrganizationCapabilities:
      properties:
        checkout_payments:
          type: boolean
          title: Checkout Payments
          description: Whether the organization can accept new checkout payments.
        subscription_renewals:
          type: boolean
          title: Subscription Renewals
          description: Whether the organization can process subscription renewals.
        payouts:
          type: boolean
          title: Payouts
          description: Whether the organization can withdraw its balance.
        refunds:
          type: boolean
          title: Refunds
          description: Whether the organization can issue refunds.
        api_access:
          type: boolean
          title: Api Access
          description: Whether the organization can access the API.
        dashboard_access:
          type: boolean
          title: Dashboard Access
          description: Whether the organization can access the dashboard.
      type: object
      required:
        - checkout_payments
        - subscription_renewals
        - payouts
        - refunds
        - api_access
        - dashboard_access
      title: OrganizationCapabilities
    OrganizationCompanyLegalEntitySchema:
      properties:
        type:
          type: string
          const: company
          title: Type
        registered_name:
          type: string
          title: Registered Name
      type: object
      required:
        - type
        - registered_name
      title: OrganizationCompanyLegalEntitySchema
    OrganizationCreate:
      properties:
        name:
          type: string
          minLength: 3
          title: Name
        slug:
          type: string
          maxLength: 64
          minLength: 3
          title: Slug
        avatar_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Avatar Url
        legal_entity:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/OrganizationIndividualLegalEntitySchema'
                - $ref: '#/components/schemas/OrganizationCompanyLegalEntitySchema'
              discriminator:
                propertyName: type
                mapping:
                  company: '#/components/schemas/OrganizationCompanyLegalEntitySchema'
                  individual: '#/components/schemas/OrganizationIndividualLegalEntitySchema'
            - type: 'null'
          title: Legal Entity
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: Public support email.
        website:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Website
          description: Official website of the organization.
        socials:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrganizationSocialLink'
              type: array
            - type: 'null'
          title: Socials
          description: Link to social profiles.
        details:
          anyOf:
            - $ref: '#/components/schemas/OrganizationDetails'
            - type: 'null'
          description: >-
            Additional, private, business details Polar needs about active
            organizations for compliance (KYC).
        country:
          anyOf:
            - type: string
              enum:
                - AD
                - AE
                - AF
                - AG
                - AI
                - AL
                - AM
                - AO
                - AQ
                - AR
                - AS
                - AT
                - AU
                - AW
                - AX
                - AZ
                - BA
                - BB
                - BD
                - BE
                - BF
                - BG
                - BH
                - BI
                - BJ
                - BL
                - BM
                - BN
                - BO
                - BQ
                - BR
                - BS
                - BT
                - BV
                - BW
                - BY
                - BZ
                - CA
                - CC
                - CD
                - CF
                - CG
                - CH
                - CI
                - CK
                - CL
                - CM
                - CN
                - CO
                - CR
                - CV
                - CW
                - CX
                - CY
                - CZ
                - DE
                - DJ
                - DK
                - DM
                - DO
                - DZ
                - EC
                - EE
                - EG
                - EH
                - ER
                - ES
                - ET
                - FI
                - FJ
                - FK
                - FM
                - FO
                - FR
                - GA
                - GB
                - GD
                - GE
                - GF
                - GG
                - GH
                - GI
                - GL
                - GM
                - GN
                - GP
                - GQ
                - GR
                - GS
                - GT
                - GU
                - GW
                - GY
                - HK
                - HM
                - HN
                - HR
                - HT
                - HU
                - ID
                - IE
                - IL
                - IM
                - IN
                - IO
                - IQ
                - IS
                - IT
                - JE
                - JM
                - JO
                - JP
                - KE
                - KG
                - KH
                - KI
                - KM
                - KN
                - KR
                - KW
                - KY
                - KZ
                - LA
                - LB
                - LC
                - LI
                - LK
                - LR
                - LS
                - LT
                - LU
                - LV
                - LY
                - MA
                - MC
                - MD
                - ME
                - MF
                - MG
                - MH
                - MK
                - ML
                - MM
                - MN
                - MO
                - MP
                - MQ
                - MR
                - MS
                - MT
                - MU
                - MV
                - MW
                - MX
                - MY
                - MZ
                - NA
                - NC
                - NE
                - NF
                - NG
                - NI
                - NL
                - 'NO'
                - NP
                - NR
                - NU
                - NZ
                - OM
                - PA
                - PE
                - PF
                - PG
                - PH
                - PK
                - PL
                - PM
                - PN
                - PR
                - PS
                - PT
                - PW
                - PY
                - QA
                - RE
                - RO
                - RS
                - RW
                - SA
                - SB
                - SC
                - SD
                - SE
                - SG
                - SH
                - SI
                - SJ
                - SK
                - SL
                - SM
                - SN
                - SO
                - SR
                - SS
                - ST
                - SV
                - SX
                - SZ
                - TC
                - TD
                - TF
                - TG
                - TH
                - TJ
                - TK
                - TL
                - TM
                - TN
                - TO
                - TR
                - TT
                - TV
                - TW
                - TZ
                - UA
                - UG
                - UM
                - US
                - UY
                - UZ
                - VA
                - VC
                - VE
                - VG
                - VI
                - VN
                - VU
                - WF
                - WS
                - YE
                - YT
                - ZA
                - ZM
                - ZW
              title: CountryAlpha2Input
              x-speakeasy-enums:
                - AD
                - AE
                - AF
                - AG
                - AI
                - AL
                - AM
                - AO
                - AQ
                - AR
                - AS
                - AT
                - AU
                - AW
                - AX
                - AZ
                - BA
                - BB
                - BD
                - BE
                - BF
                - BG
                - BH
                - BI
                - BJ
                - BL
                - BM
                - BN
                - BO
                - BQ
                - BR
                - BS
                - BT
                - BV
                - BW
                - BY
                - BZ
                - CA
                - CC
                - CD
                - CF
                - CG
                - CH
                - CI
                - CK
                - CL
                - CM
                - CN
                - CO
                - CR
                - CV
                - CW
                - CX
                - CY
                - CZ
                - DE
                - DJ
                - DK
                - DM
                - DO
                - DZ
                - EC
                - EE
                - EG
                - EH
                - ER
                - ES
                - ET
                - FI
                - FJ
                - FK
                - FM
                - FO
                - FR
                - GA
                - GB
                - GD
                - GE
                - GF
                - GG
                - GH
                - GI
                - GL
                - GM
                - GN
                - GP
                - GQ
                - GR
                - GS
                - GT
                - GU
                - GW
                - GY
                - HK
                - HM
                - HN
                - HR
                - HT
                - HU
                - ID
                - IE
                - IL
                - IM
                - IN
                - IO
                - IQ
                - IS
                - IT
                - JE
                - JM
                - JO
                - JP
                - KE
                - KG
                - KH
                - KI
                - KM
                - KN
                - KR
                - KW
                - KY
                - KZ
                - LA
                - LB
                - LC
                - LI
                - LK
                - LR
                - LS
                - LT
                - LU
                - LV
                - LY
                - MA
                - MC
                - MD
                - ME
                - MF
                - MG
                - MH
                - MK
                - ML
                - MM
                - MN
                - MO
                - MP
                - MQ
                - MR
                - MS
                - MT
                - MU
                - MV
                - MW
                - MX
                - MY
                - MZ
                - NA
                - NC
                - NE
                - NF
                - NG
                - NI
                - NL
                - 'NO'
                - NP
                - NR
                - NU
                - NZ
                - OM
                - PA
                - PE
                - PF
                - PG
                - PH
                - PK
                - PL
                - PM
                - PN
                - PR
                - PS
                - PT
                - PW
                - PY
                - QA
                - RE
                - RO
                - RS
                - RW
                - SA
                - SB
                - SC
                - SD
                - SE
                - SG
                - SH
                - SI
                - SJ
                - SK
                - SL
                - SM
                - SN
                - SO
                - SR
                - SS
                - ST
                - SV
                - SX
                - SZ
                - TC
                - TD
                - TF
                - TG
                - TH
                - TJ
                - TK
                - TL
                - TM
                - TN
                - TO
                - TR
                - TT
                - TV
                - TW
                - TZ
                - UA
                - UG
                - UM
                - US
                - UY
                - UZ
                - VA
                - VC
                - VE
                - VG
                - VI
                - VN
                - VU
                - WF
                - WS
                - YE
                - YT
                - ZA
                - ZM
                - ZW
            - type: 'null'
          description: Two-letter country code (ISO 3166-1 alpha-2).
        feature_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationFeatureSettingsUpdate'
            - type: 'null'
        subscription_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationSubscriptionSettings'
            - type: 'null'
        notification_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationNotificationSettings'
            - type: 'null'
        customer_email_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationCustomerEmailSettings'
            - type: 'null'
        customer_portal_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationCustomerPortalSettings'
            - type: 'null'
        default_presentment_currency:
          $ref: '#/components/schemas/PresentmentCurrency'
          description: Default presentment currency for the organization
          default: usd
        default_tax_behavior:
          $ref: '#/components/schemas/TaxBehaviorOption'
          description: Default tax behavior applied on products.
          default: location
      type: object
      required:
        - name
        - slug
      title: OrganizationCreate
    OrganizationCustomerEmailSettings:
      properties:
        order_confirmation:
          type: boolean
          title: Order Confirmation
        subscription_cancellation:
          type: boolean
          title: Subscription Cancellation
        subscription_confirmation:
          type: boolean
          title: Subscription Confirmation
        subscription_cycled:
          type: boolean
          title: Subscription Cycled
        subscription_cycled_after_trial:
          type: boolean
          title: Subscription Cycled After Trial
        subscription_past_due:
          type: boolean
          title: Subscription Past Due
        subscription_renewal_reminder:
          type: boolean
          title: Subscription Renewal Reminder
        subscription_revoked:
          type: boolean
          title: Subscription Revoked
        subscription_trial_conversion_reminder:
          type: boolean
          title: Subscription Trial Conversion Reminder
        subscription_uncanceled:
          type: boolean
          title: Subscription Uncanceled
        subscription_updated:
          type: boolean
          title: Subscription Updated
      type: object
      required:
        - order_confirmation
        - subscription_cancellation
        - subscription_confirmation
        - subscription_cycled
        - subscription_cycled_after_trial
        - subscription_past_due
        - subscription_renewal_reminder
        - subscription_revoked
        - subscription_trial_conversion_reminder
        - subscription_uncanceled
        - subscription_updated
      title: OrganizationCustomerEmailSettings
    OrganizationCustomerPortalSettings:
      properties:
        usage:
          $ref: '#/components/schemas/CustomerPortalUsageSettings'
        subscription:
          $ref: '#/components/schemas/CustomerPortalSubscriptionSettings'
        customer:
          $ref: '#/components/schemas/CustomerPortalCustomerSettings'
      type: object
      required:
        - usage
        - subscription
      title: OrganizationCustomerPortalSettings
    OrganizationDetails:
      properties:
        about:
          anyOf:
            - type: string
            - type: 'null'
          title: About
          description: Brief information about you and your business.
          deprecated: true
        product_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Description
          description: Description of digital products being sold.
        selling_categories:
          items:
            type: string
          type: array
          title: Selling Categories
          description: Categories of products being sold.
        pricing_models:
          items:
            type: string
          type: array
          title: Pricing Models
          description: Pricing models used by the organization.
        intended_use:
          anyOf:
            - type: string
            - type: 'null'
          title: Intended Use
          description: How the organization will integrate and use Polar.
          deprecated: true
        customer_acquisition:
          items:
            type: string
          type: array
          title: Customer Acquisition
          description: Main customer acquisition channels.
          deprecated: true
        future_annual_revenue:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Future Annual Revenue
          description: Estimated revenue in the next 12 months
          deprecated: true
        switching:
          type: boolean
          title: Switching
          description: Switching from another platform?
          default: false
        switching_from:
          anyOf:
            - type: string
              enum:
                - paddle
                - lemon_squeezy
                - gumroad
                - stripe
                - other
            - type: 'null'
          title: Switching From
          description: Which platform the organization is migrating from.
        previous_annual_revenue:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Previous Annual Revenue
          description: Revenue from last year if applicable.
          deprecated: true
      type: object
      title: OrganizationDetails
    OrganizationFeatureSettings:
      properties:
        issue_funding_enabled:
          type: boolean
          title: Issue Funding Enabled
          description: If this organization has issue funding enabled
          default: false
        seat_based_pricing_enabled:
          type: boolean
          title: Seat Based Pricing Enabled
          description: If this organization has seat-based pricing enabled
          default: false
        wallets_enabled:
          type: boolean
          title: Wallets Enabled
          description: If this organization has Wallets enabled
          default: false
        member_model_enabled:
          type: boolean
          title: Member Model Enabled
          description: If this organization has the Member model enabled
          default: false
        checkout_localization_enabled:
          type: boolean
          title: Checkout Localization Enabled
          description: If this organization has checkout localization enabled
          default: false
        overview_metrics:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Overview Metrics
          description: Ordered list of metric slugs shown on the dashboard overview.
        reset_proration_behavior_enabled:
          type: boolean
          title: Reset Proration Behavior Enabled
          description: If this organization has access to reset proration behavior.
          default: false
        off_session_charges_enabled:
          type: boolean
          title: Off Session Charges Enabled
          description: >-
            If this organization can create and finalize draft orders via the
            API (off-session charges against a saved payment method).
          default: false
        billing_enabled:
          type: boolean
          title: Billing Enabled
          description: If this organization has billing enabled
          default: false
        slack_benefit_enabled:
          type: boolean
          title: Slack Benefit Enabled
          description: Enables the slack shared channel benefit
          default: false
      type: object
      title: OrganizationFeatureSettings
    OrganizationFeatureSettingsUpdate:
      properties:
        seat_based_pricing_enabled:
          type: boolean
          title: Seat Based Pricing Enabled
          description: If this organization has seat-based pricing enabled
          default: false
        member_model_enabled:
          type: boolean
          title: Member Model Enabled
          description: If this organization has the Member model enabled
          default: false
        checkout_localization_enabled:
          type: boolean
          title: Checkout Localization Enabled
          description: If this organization has checkout localization enabled
          default: false
        overview_metrics:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Overview Metrics
          description: Ordered list of metric slugs shown on the dashboard overview.
      type: object
      title: OrganizationFeatureSettingsUpdate
      description: |-
        Feature settings that organizations can update themselves.

        Other feature settings are managed by Polar staff: they're ignored if
        provided and keep their current value.
    OrganizationIndividualLegalEntitySchema:
      properties:
        type:
          type: string
          const: individual
          title: Type
      type: object
      required:
        - type
      title: OrganizationIndividualLegalEntitySchema
    OrganizationNotReadyForPayments:
      properties:
        error:
          type: string
          const: OrganizationNotReadyForPayments
          title: Error
          examples:
            - OrganizationNotReadyForPayments
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: OrganizationNotReadyForPayments
    OrganizationNotificationSettings:
      properties:
        new_order:
          type: boolean
          title: New Order
        new_subscription:
          type: boolean
          title: New Subscription
        chargeback_prevention:
          type: boolean
          title: Chargeback Prevention
      type: object
      required:
        - new_order
        - new_subscription
      title: OrganizationNotificationSettings
    OrganizationSocialLink:
      properties:
        platform:
          $ref: '#/components/schemas/OrganizationSocialPlatforms'
          description: The social platform of the URL
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: The URL to the organization profile
      type: object
      required:
        - platform
        - url
      title: OrganizationSocialLink
    OrganizationSocialPlatforms:
      type: string
      enum:
        - x
        - github
        - facebook
        - instagram
        - youtube
        - tiktok
        - linkedin
        - threads
        - discord
        - other
      title: OrganizationSocialPlatforms
    OrganizationSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - slug
        - '-slug'
        - name
        - '-name'
        - next_review_threshold
        - '-next_review_threshold'
        - days_in_status
        - '-days_in_status'
      title: OrganizationSortProperty
    OrganizationStatus:
      type: string
      enum:
        - created
        - review
        - snoozed
        - denied
        - active
        - blocked
        - offboarding
      title: OrganizationStatus
    OrganizationSubscriptionSettings:
      properties:
        allow_multiple_subscriptions:
          type: boolean
          title: Allow Multiple Subscriptions
        proration_behavior:
          type: string
          enum:
            - invoice
            - prorate
            - next_period
          title: PublicSubscriptionProrationBehavior
        benefit_revocation_grace_period:
          type: integer
          title: Benefit Revocation Grace Period
        prevent_trial_abuse:
          type: boolean
          title: Prevent Trial Abuse
        allow_customer_updates:
          type: boolean
          title: Allow Customer Updates
      type: object
      required:
        - allow_multiple_subscriptions
        - proration_behavior
        - benefit_revocation_grace_period
        - prevent_trial_abuse
        - allow_customer_updates
      title: OrganizationSubscriptionSettings
    OrganizationUpdate:
      properties:
        name:
          anyOf:
            - type: string
              minLength: 3
            - type: 'null'
          title: Name
        avatar_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Avatar Url
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: Public support email.
        website:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Website
          description: Official website of the organization.
        socials:
          anyOf:
            - items:
                $ref: '#/components/schemas/OrganizationSocialLink'
              type: array
            - type: 'null'
          title: Socials
          description: Links to social profiles.
        details:
          anyOf:
            - $ref: '#/components/schemas/OrganizationDetails'
            - type: 'null'
          description: >-
            Additional, private, business details Polar needs about active
            organizations for compliance (KYC).
        country:
          anyOf:
            - type: string
              enum:
                - AD
                - AE
                - AF
                - AG
                - AI
                - AL
                - AM
                - AO
                - AQ
                - AR
                - AS
                - AT
                - AU
                - AW
                - AX
                - AZ
                - BA
                - BB
                - BD
                - BE
                - BF
                - BG
                - BH
                - BI
                - BJ
                - BL
                - BM
                - BN
                - BO
                - BQ
                - BR
                - BS
                - BT
                - BV
                - BW
                - BY
                - BZ
                - CA
                - CC
                - CD
                - CF
                - CG
                - CH
                - CI
                - CK
                - CL
                - CM
                - CN
                - CO
                - CR
                - CV
                - CW
                - CX
                - CY
                - CZ
                - DE
                - DJ
                - DK
                - DM
                - DO
                - DZ
                - EC
                - EE
                - EG
                - EH
                - ER
                - ES
                - ET
                - FI
                - FJ
                - FK
                - FM
                - FO
                - FR
                - GA
                - GB
                - GD
                - GE
                - GF
                - GG
                - GH
                - GI
                - GL
                - GM
                - GN
                - GP
                - GQ
                - GR
                - GS
                - GT
                - GU
                - GW
                - GY
                - HK
                - HM
                - HN
                - HR
                - HT
                - HU
                - ID
                - IE
                - IL
                - IM
                - IN
                - IO
                - IQ
                - IS
                - IT
                - JE
                - JM
                - JO
                - JP
                - KE
                - KG
                - KH
                - KI
                - KM
                - KN
                - KR
                - KW
                - KY
                - KZ
                - LA
                - LB
                - LC
                - LI
                - LK
                - LR
                - LS
                - LT
                - LU
                - LV
                - LY
                - MA
                - MC
                - MD
                - ME
                - MF
                - MG
                - MH
                - MK
                - ML
                - MM
                - MN
                - MO
                - MP
                - MQ
                - MR
                - MS
                - MT
                - MU
                - MV
                - MW
                - MX
                - MY
                - MZ
                - NA
                - NC
                - NE
                - NF
                - NG
                - NI
                - NL
                - 'NO'
                - NP
                - NR
                - NU
                - NZ
                - OM
                - PA
                - PE
                - PF
                - PG
                - PH
                - PK
                - PL
                - PM
                - PN
                - PR
                - PS
                - PT
                - PW
                - PY
                - QA
                - RE
                - RO
                - RS
                - RW
                - SA
                - SB
                - SC
                - SD
                - SE
                - SG
                - SH
                - SI
                - SJ
                - SK
                - SL
                - SM
                - SN
                - SO
                - SR
                - SS
                - ST
                - SV
                - SX
                - SZ
                - TC
                - TD
                - TF
                - TG
                - TH
                - TJ
                - TK
                - TL
                - TM
                - TN
                - TO
                - TR
                - TT
                - TV
                - TW
                - TZ
                - UA
                - UG
                - UM
                - US
                - UY
                - UZ
                - VA
                - VC
                - VE
                - VG
                - VI
                - VN
                - VU
                - WF
                - WS
                - YE
                - YT
                - ZA
                - ZM
                - ZW
              title: CountryAlpha2Input
              x-speakeasy-enums:
                - AD
                - AE
                - AF
                - AG
                - AI
                - AL
                - AM
                - AO
                - AQ
                - AR
                - AS
                - AT
                - AU
                - AW
                - AX
                - AZ
                - BA
                - BB
                - BD
                - BE
                - BF
                - BG
                - BH
                - BI
                - BJ
                - BL
                - BM
                - BN
                - BO
                - BQ
                - BR
                - BS
                - BT
                - BV
                - BW
                - BY
                - BZ
                - CA
                - CC
                - CD
                - CF
                - CG
                - CH
                - CI
                - CK
                - CL
                - CM
                - CN
                - CO
                - CR
                - CV
                - CW
                - CX
                - CY
                - CZ
                - DE
                - DJ
                - DK
                - DM
                - DO
                - DZ
                - EC
                - EE
                - EG
                - EH
                - ER
                - ES
                - ET
                - FI
                - FJ
                - FK
                - FM
                - FO
                - FR
                - GA
                - GB
                - GD
                - GE
                - GF
                - GG
                - GH
                - GI
                - GL
                - GM
                - GN
                - GP
                - GQ
                - GR
                - GS
                - GT
                - GU
                - GW
                - GY
                - HK
                - HM
                - HN
                - HR
                - HT
                - HU
                - ID
                - IE
                - IL
                - IM
                - IN
                - IO
                - IQ
                - IS
                - IT
                - JE
                - JM
                - JO
                - JP
                - KE
                - KG
                - KH
                - KI
                - KM
                - KN
                - KR
                - KW
                - KY
                - KZ
                - LA
                - LB
                - LC
                - LI
                - LK
                - LR
                - LS
                - LT
                - LU
                - LV
                - LY
                - MA
                - MC
                - MD
                - ME
                - MF
                - MG
                - MH
                - MK
                - ML
                - MM
                - MN
                - MO
                - MP
                - MQ
                - MR
                - MS
                - MT
                - MU
                - MV
                - MW
                - MX
                - MY
                - MZ
                - NA
                - NC
                - NE
                - NF
                - NG
                - NI
                - NL
                - 'NO'
                - NP
                - NR
                - NU
                - NZ
                - OM
                - PA
                - PE
                - PF
                - PG
                - PH
                - PK
                - PL
                - PM
                - PN
                - PR
                - PS
                - PT
                - PW
                - PY
                - QA
                - RE
                - RO
                - RS
                - RW
                - SA
                - SB
                - SC
                - SD
                - SE
                - SG
                - SH
                - SI
                - SJ
                - SK
                - SL
                - SM
                - SN
                - SO
                - SR
                - SS
                - ST
                - SV
                - SX
                - SZ
                - TC
                - TD
                - TF
                - TG
                - TH
                - TJ
                - TK
                - TL
                - TM
                - TN
                - TO
                - TR
                - TT
                - TV
                - TW
                - TZ
                - UA
                - UG
                - UM
                - US
                - UY
                - UZ
                - VA
                - VC
                - VE
                - VG
                - VI
                - VN
                - VU
                - WF
                - WS
                - YE
                - YT
                - ZA
                - ZM
                - ZW
            - type: 'null'
          description: Two-letter country code (ISO 3166-1 alpha-2).
        feature_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationFeatureSettingsUpdate'
            - type: 'null'
        subscription_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationSubscriptionSettings'
            - type: 'null'
        notification_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationNotificationSettings'
            - type: 'null'
        customer_email_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationCustomerEmailSettings'
            - type: 'null'
        customer_portal_settings:
          anyOf:
            - $ref: '#/components/schemas/OrganizationCustomerPortalSettings'
            - type: 'null'
        default_presentment_currency:
          anyOf:
            - $ref: '#/components/schemas/PresentmentCurrency'
            - type: 'null'
          description: Default presentment currency for the organization
        default_tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: Default tax behavior applied on products.
      type: object
      title: OrganizationUpdate
    Pagination:
      properties:
        total_count:
          type: integer
          title: Total Count
        max_page:
          type: integer
          title: Max Page
      type: object
      required:
        - total_count
        - max_page
      title: Pagination
    Payment:
      anyOf:
        - $ref: '#/components/schemas/CardPayment'
        - $ref: '#/components/schemas/GenericPayment'
    PaymentActionRequired:
      properties:
        error:
          type: string
          const: PaymentActionRequired
          title: Error
          examples:
            - PaymentActionRequired
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentActionRequired
    PaymentAlreadyInProgress:
      properties:
        error:
          type: string
          const: PaymentAlreadyInProgress
          title: Error
          examples:
            - PaymentAlreadyInProgress
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentAlreadyInProgress
    PaymentError:
      properties:
        error:
          type: string
          const: PaymentError
          title: Error
          examples:
            - PaymentError
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentError
    PaymentFailed:
      properties:
        error:
          type: string
          const: PaymentFailed
          title: Error
          examples:
            - PaymentFailed
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentFailed
    PaymentMethod:
      anyOf:
        - $ref: '#/components/schemas/CustomerPaymentMethodCard'
        - $ref: '#/components/schemas/CustomerPaymentMethodGeneric'
    PaymentMethodCard:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        type:
          type: string
          const: card
          title: Type
        method_metadata:
          $ref: '#/components/schemas/PaymentMethodCardMetadata'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - processor
        - customer_id
        - type
        - method_metadata
      title: PaymentMethodCard
    PaymentMethodCardMetadata:
      properties:
        brand:
          type: string
          title: Brand
        last4:
          type: string
          title: Last4
        exp_month:
          type: integer
          title: Exp Month
        exp_year:
          type: integer
          title: Exp Year
        wallet:
          anyOf:
            - type: string
            - type: 'null'
          title: Wallet
      type: object
      required:
        - brand
        - last4
        - exp_month
        - exp_year
      title: PaymentMethodCardMetadata
    PaymentMethodGeneric:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        processor:
          $ref: '#/components/schemas/PaymentProcessor'
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        type:
          type: string
          title: Type
      type: object
      required:
        - id
        - created_at
        - modified_at
        - processor
        - customer_id
        - type
      title: PaymentMethodGeneric
    PaymentMethodInUseByActiveSubscription:
      properties:
        error:
          type: string
          const: PaymentMethodInUseByActiveSubscription
          title: Error
          examples:
            - PaymentMethodInUseByActiveSubscription
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentMethodInUseByActiveSubscription
    PaymentMethodSetupFailed:
      properties:
        error:
          type: string
          const: PaymentMethodSetupFailed
          title: Error
          examples:
            - PaymentMethodSetupFailed
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentMethodSetupFailed
    PaymentNotReady:
      properties:
        error:
          type: string
          const: PaymentNotReady
          title: Error
          examples:
            - PaymentNotReady
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: PaymentNotReady
    PaymentProcessor:
      type: string
      enum:
        - stripe
      title: PaymentProcessor
    PaymentSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - status
        - '-status'
        - amount
        - '-amount'
        - method
        - '-method'
      title: PaymentSortProperty
    PaymentStatus:
      type: string
      enum:
        - pending
        - succeeded
        - failed
      title: PaymentStatus
    PendingSubscriptionUpdate:
      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 object.
        applies_at:
          type: string
          format: date-time
          title: Applies At
          description: The date and time when the subscription update will be applied.
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: >-
            ID of the new product to apply to the subscription. If `null`, the
            product won't be changed.
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: >-
            Number of seats to apply to the subscription. If `null`, the number
            of seats won't be changed.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - applies_at
        - product_id
        - seats
      title: PendingSubscriptionUpdate
      description: >-
        Pending update to be applied to a subscription at the beginning of the
        next period.
    PortalAuthenticatedUser:
      properties:
        type:
          type: string
          title: Type
          description: 'Type of authenticated user: ''customer'' or ''member'''
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: User's name, if available.
        email:
          type: string
          title: Email
          description: User's email address.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: Associated customer ID.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: Member ID. Only set for members.
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          description: Member role (owner, billing_manager, member). Only set for members.
      type: object
      required:
        - type
        - name
        - email
        - customer_id
      title: PortalAuthenticatedUser
      description: Information about the authenticated portal user.
    PresentmentCurrency:
      type: string
      enum:
        - aed
        - all
        - amd
        - aoa
        - ars
        - aud
        - awg
        - azn
        - bam
        - bbd
        - bdt
        - bif
        - bmd
        - bnd
        - bob
        - brl
        - bsd
        - bwp
        - bzd
        - cad
        - cdf
        - chf
        - clp
        - cny
        - cop
        - crc
        - cve
        - czk
        - djf
        - dkk
        - dop
        - dzd
        - egp
        - etb
        - eur
        - fjd
        - fkp
        - gbp
        - gel
        - gip
        - gmd
        - gnf
        - gtq
        - gyd
        - hkd
        - hnl
        - htg
        - huf
        - idr
        - ils
        - inr
        - isk
        - jmd
        - jpy
        - kes
        - kgs
        - khr
        - kmf
        - krw
        - kyd
        - kzt
        - lak
        - lkr
        - lrd
        - lsl
        - mad
        - mdl
        - mga
        - mkd
        - mnt
        - mop
        - mur
        - mvr
        - mwk
        - mxn
        - myr
        - mzn
        - nad
        - ngn
        - nio
        - nok
        - npr
        - nzd
        - pab
        - pen
        - pgk
        - php
        - pkr
        - pln
        - pyg
        - qar
        - ron
        - rsd
        - rwf
        - sar
        - sbd
        - scr
        - sek
        - sgd
        - shp
        - sos
        - srd
        - szl
        - thb
        - tjs
        - top
        - try
        - ttd
        - twd
        - tzs
        - uah
        - ugx
        - usd
        - uyu
        - uzs
        - vnd
        - vuv
        - wst
        - xaf
        - xcd
        - xcg
        - xof
        - xpf
        - yer
        - zar
        - zmw
      title: PresentmentCurrency
    Product:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        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.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase.
        recurring_interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. None for one-time
            products.
        is_recurring:
          type: boolean
          title: Is Recurring
          description: Whether the product is a subscription.
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        prices:
          items:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of prices for this product.
        benefits:
          items:
            $ref: '#/components/schemas/Benefit'
            title: Benefit
          type: array
          title: Benefits
          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.
        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
      required:
        - id
        - created_at
        - modified_at
        - trial_interval
        - trial_interval_count
        - name
        - description
        - visibility
        - recurring_interval
        - recurring_interval_count
        - is_recurring
        - is_archived
        - organization_id
        - metadata
        - prices
        - benefits
        - medias
        - attached_custom_fields
      title: Product
      description: A product.
    ProductBenefitsUpdate:
      properties:
        benefits:
          items:
            type: string
            format: uuid4
            description: The benefit ID.
            x-polar-selector-widget:
              displayProperty: description
              resourceName: Benefit
              resourceRoot: /v1/benefits
          type: array
          title: Benefits
          description: >-
            List of benefit IDs. Each one must be on the same organization as
            the product.
      type: object
      required:
        - benefits
      title: ProductBenefitsUpdate
      description: Schema to update the benefits granted by a product.
    ProductBillingType:
      type: string
      enum:
        - one_time
        - recurring
      title: ProductBillingType
    ProductCreate:
      oneOf:
        - $ref: '#/components/schemas/ProductCreateRecurring'
        - $ref: '#/components/schemas/ProductCreateOneTime'
    ProductCreateOneTime:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          type: string
          maxLength: 64
          minLength: 3
          title: Name
          description: The name of the product.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description of the product.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
          default: public
        prices:
          items:
            oneOf:
              - $ref: '#/components/schemas/ProductPriceFixedCreate'
              - $ref: '#/components/schemas/ProductPriceCustomCreate'
              - $ref: '#/components/schemas/ProductPriceFreeCreate'
              - $ref: '#/components/schemas/ProductPriceSeatBasedCreate'
              - $ref: '#/components/schemas/ProductPriceMeteredUnitCreate'
            discriminator:
              propertyName: amount_type
              mapping:
                custom: '#/components/schemas/ProductPriceCustomCreate'
                fixed: '#/components/schemas/ProductPriceFixedCreate'
                free: '#/components/schemas/ProductPriceFreeCreate'
                metered_unit: '#/components/schemas/ProductPriceMeteredUnitCreate'
                seat_based: '#/components/schemas/ProductPriceSeatBasedCreate'
          type: array
          minItems: 1
          title: ProductPriceCreateList
          description: >-
            List of available prices for this product. It may combine at most
            one fixed price with one seat-based price (billed as `fixed +
            seat_charge`), or contain a single custom or free price, plus any
            number of metered prices. A free price cannot be combined with other
            prices, and a custom price cannot be combined with a fixed or
            seat-based price. Metered prices are not supported on one-time
            purchase products.
        medias:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
            - type: 'null'
          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:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the product. **Required unless you
            use an organization token.**
        recurring_interval:
          type: 'null'
          title: Recurring Interval
          description: States that the product is a one-time purchase.
        recurring_interval_count:
          type: 'null'
          title: Recurring Interval Count
          description: One-time products don't have a recurring interval count.
      type: object
      required:
        - name
        - prices
      title: ProductCreateOneTime
    ProductCreateRecurring:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        name:
          type: string
          maxLength: 64
          minLength: 3
          title: Name
          description: The name of the product.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description of the product.
        visibility:
          $ref: '#/components/schemas/ProductVisibility'
          description: The visibility of the product.
          default: public
        prices:
          items:
            oneOf:
              - $ref: '#/components/schemas/ProductPriceFixedCreate'
              - $ref: '#/components/schemas/ProductPriceCustomCreate'
              - $ref: '#/components/schemas/ProductPriceFreeCreate'
              - $ref: '#/components/schemas/ProductPriceSeatBasedCreate'
              - $ref: '#/components/schemas/ProductPriceMeteredUnitCreate'
            discriminator:
              propertyName: amount_type
              mapping:
                custom: '#/components/schemas/ProductPriceCustomCreate'
                fixed: '#/components/schemas/ProductPriceFixedCreate'
                free: '#/components/schemas/ProductPriceFreeCreate'
                metered_unit: '#/components/schemas/ProductPriceMeteredUnitCreate'
                seat_based: '#/components/schemas/ProductPriceSeatBasedCreate'
          type: array
          minItems: 1
          title: ProductPriceCreateList
          description: >-
            List of available prices for this product. It may combine at most
            one fixed price with one seat-based price (billed as `fixed +
            seat_charge`), or contain a single custom or free price, plus any
            number of metered prices. A free price cannot be combined with other
            prices, and a custom price cannot be combined with a fixed or
            seat-based price. Metered prices are not supported on one-time
            purchase products.
        medias:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
            - type: 'null'
          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:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The ID of the organization owning the product. **Required unless you
            use an organization token.**
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The recurring interval of the product.
        recurring_interval_count:
          type: integer
          maximum: 999
          minimum: 1
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on.
          default: 1
      type: object
      required:
        - name
        - prices
        - recurring_interval
      title: ProductCreateRecurring
    ProductMediaFileCreate:
      properties:
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
        name:
          type: string
          title: Name
        mime_type:
          type: string
          pattern: ^image\/(jpeg|png|gif|webp|svg\+xml)$
          title: Mime Type
          description: >-
            MIME type of the file. Only images are supported for this type of
            file.
        size:
          type: integer
          maximum: 10485760
          title: Size
          description: >-
            Size of the file. A maximum of 10 MB is allowed for this type of
            file.
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        upload:
          $ref: '#/components/schemas/S3FileCreateMultipart'
        service:
          type: string
          const: product_media
          title: Service
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
      type: object
      required:
        - name
        - mime_type
        - size
        - upload
        - service
      title: ProductMediaFileCreate
      description: Schema to create a file to be used as a product media file.
    ProductMediaFileRead:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
        mime_type:
          type: string
          title: Mime Type
        size:
          type: integer
          title: Size
        storage_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Storage Version
        checksum_etag:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Etag
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        checksum_sha256_hex:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Hex
        last_modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Modified At
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        service:
          type: string
          const: product_media
          title: Service
        is_uploaded:
          type: boolean
          title: Is Uploaded
        created_at:
          type: string
          format: date-time
          title: Created At
        size_readable:
          type: string
          title: Size Readable
        public_url:
          type: string
          title: Public Url
      type: object
      required:
        - id
        - organization_id
        - name
        - path
        - mime_type
        - size
        - storage_version
        - checksum_etag
        - checksum_sha256_base64
        - checksum_sha256_hex
        - last_modified_at
        - version
        - service
        - is_uploaded
        - created_at
        - size_readable
        - public_url
      title: ProductMediaFileRead
      description: File to be used as a product media file.
    ProductPrice:
      oneOf:
        - $ref: '#/components/schemas/ProductPriceFixed'
        - $ref: '#/components/schemas/ProductPriceCustom'
        - $ref: '#/components/schemas/ProductPriceFree'
        - $ref: '#/components/schemas/ProductPriceSeatBased'
        - $ref: '#/components/schemas/ProductPriceMeteredUnit'
      discriminator:
        propertyName: amount_type
        mapping:
          custom: '#/components/schemas/ProductPriceCustom'
          fixed: '#/components/schemas/ProductPriceFixed'
          free: '#/components/schemas/ProductPriceFree'
          metered_unit: '#/components/schemas/ProductPriceMeteredUnit'
          seat_based: '#/components/schemas/ProductPriceSeatBased'
    ProductPriceCustom:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: custom
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        minimum_amount:
          type: integer
          title: Minimum Amount
          description: >-
            The minimum amount the customer can pay. If 0, the price is 'free or
            pay what you want'.
        maximum_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Maximum Amount
          description: The maximum amount the customer can pay.
        preset_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Preset Amount
          description: The initial amount shown to the customer.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - minimum_amount
        - maximum_amount
        - preset_amount
      title: ProductPriceCustom
      description: A pay-what-you-want price for a product.
    ProductPriceCustomCreate:
      properties:
        amount_type:
          type: string
          const: custom
          title: Amount Type
        price_currency:
          $ref: '#/components/schemas/PresentmentCurrency'
          description: The currency in which the customer will be charged.
          default: usd
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If not set, it will default to the
            organization's default tax behavior.
        minimum_amount:
          type: integer
          minimum: 0
          title: Minimum Amount
          description: >-
            The minimum amount the customer can pay. If set to 0, the price is
            'free or pay what you want' and $0 is accepted. If set to a value
            below the minimum price amount for the currency, it will be
            rejected. Defaults to the minimum price amount for the currency.
            Minimum per currency:

            - USD: 0.5

            - AED: 2

            - ALL: 50

            - AMD: 200

            - AOA: 500

            - ARS: 750

            - AUD: 0.7

            - AWG: 1

            - AZN: 1

            - BAM: 1

            - BBD: 2

            - BDT: 70

            - BIF: 2,000

            - BMD: 1

            - BND: 1

            - BOB: 5

            - BRL: 2.5

            - BSD: 1

            - BWP: 10

            - BZD: 2

            - CAD: 0.7

            - CDF: 2,000

            - CHF: 0.5

            - CLP: 500

            - CNY: 5

            - COP: 2,000

            - CRC: 300

            - CVE: 50

            - CZK: 15

            - DJF: 100

            - DKK: 3.2

            - DOP: 40

            - DZD: 70

            - EGP: 30

            - ETB: 80

            - EUR: 0.5

            - FJD: 2

            - FKP: 1

            - GBP: 0.4

            - GEL: 2

            - GNF: 5,000

            - GIP: 1

            - GMD: 40

            - GTQ: 5

            - GYD: 200

            - HKD: 4

            - HNL: 20

            - HTG: 70

            - HUF: 175

            - IDR: 9,000

            - ILS: 1.5

            - INR: 60

            - ISK: 70

            - JMD: 80

            - JPY: 80

            - KES: 70

            - KGS: 50

            - KHR: 3,000

            - KMF: 500

            - KRW: 800

            - KYD: 1

            - KZT: 300

            - LAK: 20,000

            - LKR: 200

            - LRD: 100

            - LSL: 10

            - MAD: 5

            - MDL: 10

            - MGA: 3,000

            - MKD: 50

            - MNT: 2,000

            - MOP: 5

            - MUR: 50

            - MVR: 8

            - MXN: 9

            - MWK: 1,000

            - MYR: 2

            - MZN: 50

            - NAD: 10

            - NGN: 700

            - NIO: 20

            - NOK: 5

            - NPR: 80

            - NZD: 0.9

            - PAB: 1

            - PEN: 2

            - PGK: 3

            - PHP: 35

            - PKR: 200

            - PLN: 2

            - PYG: 4,000

            - QAR: 2

            - RON: 2.5

            - RSD: 60

            - RWF: 1,000

            - SAR: 2

            - SBD: 4

            - SCR: 8

            - SEK: 5

            - SGD: 0.7

            - SHP: 1

            - SOS: 500

            - SRD: 20

            - SZL: 10

            - THB: 20

            - TJS: 5

            - TOP: 2

            - TRY: 30

            - TTD: 4

            - TWD: 20

            - TZS: 2,000

            - UAH: 30

            - UGX: 2,000

            - UYU: 20

            - UZS: 7,000

            - VND: 20,000

            - VUV: 100

            - WST: 2

            - XAF: 500

            - XCD: 2

            - XCG: 1

            - XOF: 500

            - XPF: 100

            - YER: 200

            - ZAR: 9

            - ZMW: 10

            - Other currencies: 50 minor units
          default: 50
        maximum_amount:
          anyOf:
            - type: integer
              minimum: 1
              description: |-
                The price in cents.
                Minimum amounts per currency:
                - USD: 0.5
                - AED: 2
                - ALL: 50
                - AMD: 200
                - AOA: 500
                - ARS: 750
                - AUD: 0.7
                - AWG: 1
                - AZN: 1
                - BAM: 1
                - BBD: 2
                - BDT: 70
                - BIF: 2,000
                - BMD: 1
                - BND: 1
                - BOB: 5
                - BRL: 2.5
                - BSD: 1
                - BWP: 10
                - BZD: 2
                - CAD: 0.7
                - CDF: 2,000
                - CHF: 0.5
                - CLP: 500
                - CNY: 5
                - COP: 2,000
                - CRC: 300
                - CVE: 50
                - CZK: 15
                - DJF: 100
                - DKK: 3.2
                - DOP: 40
                - DZD: 70
                - EGP: 30
                - ETB: 80
                - EUR: 0.5
                - FJD: 2
                - FKP: 1
                - GBP: 0.4
                - GEL: 2
                - GNF: 5,000
                - GIP: 1
                - GMD: 40
                - GTQ: 5
                - GYD: 200
                - HKD: 4
                - HNL: 20
                - HTG: 70
                - HUF: 175
                - IDR: 9,000
                - ILS: 1.5
                - INR: 60
                - ISK: 70
                - JMD: 80
                - JPY: 80
                - KES: 70
                - KGS: 50
                - KHR: 3,000
                - KMF: 500
                - KRW: 800
                - KYD: 1
                - KZT: 300
                - LAK: 20,000
                - LKR: 200
                - LRD: 100
                - LSL: 10
                - MAD: 5
                - MDL: 10
                - MGA: 3,000
                - MKD: 50
                - MNT: 2,000
                - MOP: 5
                - MUR: 50
                - MVR: 8
                - MXN: 9
                - MWK: 1,000
                - MYR: 2
                - MZN: 50
                - NAD: 10
                - NGN: 700
                - NIO: 20
                - NOK: 5
                - NPR: 80
                - NZD: 0.9
                - PAB: 1
                - PEN: 2
                - PGK: 3
                - PHP: 35
                - PKR: 200
                - PLN: 2
                - PYG: 4,000
                - QAR: 2
                - RON: 2.5
                - RSD: 60
                - RWF: 1,000
                - SAR: 2
                - SBD: 4
                - SCR: 8
                - SEK: 5
                - SGD: 0.7
                - SHP: 1
                - SOS: 500
                - SRD: 20
                - SZL: 10
                - THB: 20
                - TJS: 5
                - TOP: 2
                - TRY: 30
                - TTD: 4
                - TWD: 20
                - TZS: 2,000
                - UAH: 30
                - UGX: 2,000
                - UYU: 20
                - UZS: 7,000
                - VND: 20,000
                - VUV: 100
                - WST: 2
                - XAF: 500
                - XCD: 2
                - XCG: 1
                - XOF: 500
                - XPF: 100
                - YER: 200
                - ZAR: 9
                - ZMW: 10
                - Other currencies: 50 minor units
            - type: 'null'
          title: Maximum Amount
          description: |-
            The maximum amount the customer can pay. Maximum per currency:
            - USD: 999,999.99
            - EUR: 999,999.99
            - GBP: 999,999.99
            - ARS: 1,400,000
            - CDF: 2,800,000
            - COP: 4,000,000
            - IDR: 16,000,000
            - KHR: 4,000,000
            - LAK: 21,000,000
            - MNT: 3,500,000
            - MWK: 1,750,000
            - NGN: 1,550,000
            - TZS: 2,500,000
            - UGX: 3,700,000
            - UZS: 12,500,000
            - Other currencies: 99,999,999 minor units
        preset_amount:
          anyOf:
            - type: integer
              minimum: 0
              description: |-
                The price in cents.
                Minimum amounts per currency:
                - USD: 0.5
                - AED: 2
                - ALL: 50
                - AMD: 200
                - AOA: 500
                - ARS: 750
                - AUD: 0.7
                - AWG: 1
                - AZN: 1
                - BAM: 1
                - BBD: 2
                - BDT: 70
                - BIF: 2,000
                - BMD: 1
                - BND: 1
                - BOB: 5
                - BRL: 2.5
                - BSD: 1
                - BWP: 10
                - BZD: 2
                - CAD: 0.7
                - CDF: 2,000
                - CHF: 0.5
                - CLP: 500
                - CNY: 5
                - COP: 2,000
                - CRC: 300
                - CVE: 50
                - CZK: 15
                - DJF: 100
                - DKK: 3.2
                - DOP: 40
                - DZD: 70
                - EGP: 30
                - ETB: 80
                - EUR: 0.5
                - FJD: 2
                - FKP: 1
                - GBP: 0.4
                - GEL: 2
                - GNF: 5,000
                - GIP: 1
                - GMD: 40
                - GTQ: 5
                - GYD: 200
                - HKD: 4
                - HNL: 20
                - HTG: 70
                - HUF: 175
                - IDR: 9,000
                - ILS: 1.5
                - INR: 60
                - ISK: 70
                - JMD: 80
                - JPY: 80
                - KES: 70
                - KGS: 50
                - KHR: 3,000
                - KMF: 500
                - KRW: 800
                - KYD: 1
                - KZT: 300
                - LAK: 20,000
                - LKR: 200
                - LRD: 100
                - LSL: 10
                - MAD: 5
                - MDL: 10
                - MGA: 3,000
                - MKD: 50
                - MNT: 2,000
                - MOP: 5
                - MUR: 50
                - MVR: 8
                - MXN: 9
                - MWK: 1,000
                - MYR: 2
                - MZN: 50
                - NAD: 10
                - NGN: 700
                - NIO: 20
                - NOK: 5
                - NPR: 80
                - NZD: 0.9
                - PAB: 1
                - PEN: 2
                - PGK: 3
                - PHP: 35
                - PKR: 200
                - PLN: 2
                - PYG: 4,000
                - QAR: 2
                - RON: 2.5
                - RSD: 60
                - RWF: 1,000
                - SAR: 2
                - SBD: 4
                - SCR: 8
                - SEK: 5
                - SGD: 0.7
                - SHP: 1
                - SOS: 500
                - SRD: 20
                - SZL: 10
                - THB: 20
                - TJS: 5
                - TOP: 2
                - TRY: 30
                - TTD: 4
                - TWD: 20
                - TZS: 2,000
                - UAH: 30
                - UGX: 2,000
                - UYU: 20
                - UZS: 7,000
                - VND: 20,000
                - VUV: 100
                - WST: 2
                - XAF: 500
                - XCD: 2
                - XCG: 1
                - XOF: 500
                - XPF: 100
                - YER: 200
                - ZAR: 9
                - ZMW: 10
                - Other currencies: 50 minor units
            - type: 'null'
          title: Preset Amount
          description: >-
            The initial amount shown to the customer. If 0, the customer will
            see $0 as the default. If set to a value below the minimum price
            amount for the currency, it will be rejected.Minimum per currency:

            - USD: 0.5

            - AED: 2

            - ALL: 50

            - AMD: 200

            - AOA: 500

            - ARS: 750

            - AUD: 0.7

            - AWG: 1

            - AZN: 1

            - BAM: 1

            - BBD: 2

            - BDT: 70

            - BIF: 2,000

            - BMD: 1

            - BND: 1

            - BOB: 5

            - BRL: 2.5

            - BSD: 1

            - BWP: 10

            - BZD: 2

            - CAD: 0.7

            - CDF: 2,000

            - CHF: 0.5

            - CLP: 500

            - CNY: 5

            - COP: 2,000

            - CRC: 300

            - CVE: 50

            - CZK: 15

            - DJF: 100

            - DKK: 3.2

            - DOP: 40

            - DZD: 70

            - EGP: 30

            - ETB: 80

            - EUR: 0.5

            - FJD: 2

            - FKP: 1

            - GBP: 0.4

            - GEL: 2

            - GNF: 5,000

            - GIP: 1

            - GMD: 40

            - GTQ: 5

            - GYD: 200

            - HKD: 4

            - HNL: 20

            - HTG: 70

            - HUF: 175

            - IDR: 9,000

            - ILS: 1.5

            - INR: 60

            - ISK: 70

            - JMD: 80

            - JPY: 80

            - KES: 70

            - KGS: 50

            - KHR: 3,000

            - KMF: 500

            - KRW: 800

            - KYD: 1

            - KZT: 300

            - LAK: 20,000

            - LKR: 200

            - LRD: 100

            - LSL: 10

            - MAD: 5

            - MDL: 10

            - MGA: 3,000

            - MKD: 50

            - MNT: 2,000

            - MOP: 5

            - MUR: 50

            - MVR: 8

            - MXN: 9

            - MWK: 1,000

            - MYR: 2

            - MZN: 50

            - NAD: 10

            - NGN: 700

            - NIO: 20

            - NOK: 5

            - NPR: 80

            - NZD: 0.9

            - PAB: 1

            - PEN: 2

            - PGK: 3

            - PHP: 35

            - PKR: 200

            - PLN: 2

            - PYG: 4,000

            - QAR: 2

            - RON: 2.5

            - RSD: 60

            - RWF: 1,000

            - SAR: 2

            - SBD: 4

            - SCR: 8

            - SEK: 5

            - SGD: 0.7

            - SHP: 1

            - SOS: 500

            - SRD: 20

            - SZL: 10

            - THB: 20

            - TJS: 5

            - TOP: 2

            - TRY: 30

            - TTD: 4

            - TWD: 20

            - TZS: 2,000

            - UAH: 30

            - UGX: 2,000

            - UYU: 20

            - UZS: 7,000

            - VND: 20,000

            - VUV: 100

            - WST: 2

            - XAF: 500

            - XCD: 2

            - XCG: 1

            - XOF: 500

            - XPF: 100

            - YER: 200

            - ZAR: 9

            - ZMW: 10

            - Other currencies: 50 minor units
      type: object
      required:
        - amount_type
      title: ProductPriceCustomCreate
      description: Schema to create a pay-what-you-want price.
    ProductPriceFixed:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: fixed
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        price_amount:
          type: integer
          title: Price Amount
          description: The price in cents.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - price_amount
      title: ProductPriceFixed
      description: A fixed price for a product.
    ProductPriceFixedCreate:
      properties:
        amount_type:
          type: string
          const: fixed
          title: Amount Type
        price_currency:
          $ref: '#/components/schemas/PresentmentCurrency'
          description: The currency in which the customer will be charged.
          default: usd
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If not set, it will default to the
            organization's default tax behavior.
        price_amount:
          type: integer
          minimum: 0
          title: Price Amount
          description: |-
            The price in cents. Set to `0` for a free price.
            Minimum amounts per currency:
            - USD: 0.5
            - AED: 2
            - ALL: 50
            - AMD: 200
            - AOA: 500
            - ARS: 750
            - AUD: 0.7
            - AWG: 1
            - AZN: 1
            - BAM: 1
            - BBD: 2
            - BDT: 70
            - BIF: 2,000
            - BMD: 1
            - BND: 1
            - BOB: 5
            - BRL: 2.5
            - BSD: 1
            - BWP: 10
            - BZD: 2
            - CAD: 0.7
            - CDF: 2,000
            - CHF: 0.5
            - CLP: 500
            - CNY: 5
            - COP: 2,000
            - CRC: 300
            - CVE: 50
            - CZK: 15
            - DJF: 100
            - DKK: 3.2
            - DOP: 40
            - DZD: 70
            - EGP: 30
            - ETB: 80
            - EUR: 0.5
            - FJD: 2
            - FKP: 1
            - GBP: 0.4
            - GEL: 2
            - GNF: 5,000
            - GIP: 1
            - GMD: 40
            - GTQ: 5
            - GYD: 200
            - HKD: 4
            - HNL: 20
            - HTG: 70
            - HUF: 175
            - IDR: 9,000
            - ILS: 1.5
            - INR: 60
            - ISK: 70
            - JMD: 80
            - JPY: 80
            - KES: 70
            - KGS: 50
            - KHR: 3,000
            - KMF: 500
            - KRW: 800
            - KYD: 1
            - KZT: 300
            - LAK: 20,000
            - LKR: 200
            - LRD: 100
            - LSL: 10
            - MAD: 5
            - MDL: 10
            - MGA: 3,000
            - MKD: 50
            - MNT: 2,000
            - MOP: 5
            - MUR: 50
            - MVR: 8
            - MXN: 9
            - MWK: 1,000
            - MYR: 2
            - MZN: 50
            - NAD: 10
            - NGN: 700
            - NIO: 20
            - NOK: 5
            - NPR: 80
            - NZD: 0.9
            - PAB: 1
            - PEN: 2
            - PGK: 3
            - PHP: 35
            - PKR: 200
            - PLN: 2
            - PYG: 4,000
            - QAR: 2
            - RON: 2.5
            - RSD: 60
            - RWF: 1,000
            - SAR: 2
            - SBD: 4
            - SCR: 8
            - SEK: 5
            - SGD: 0.7
            - SHP: 1
            - SOS: 500
            - SRD: 20
            - SZL: 10
            - THB: 20
            - TJS: 5
            - TOP: 2
            - TRY: 30
            - TTD: 4
            - TWD: 20
            - TZS: 2,000
            - UAH: 30
            - UGX: 2,000
            - UYU: 20
            - UZS: 7,000
            - VND: 20,000
            - VUV: 100
            - WST: 2
            - XAF: 500
            - XCD: 2
            - XCG: 1
            - XOF: 500
            - XPF: 100
            - YER: 200
            - ZAR: 9
            - ZMW: 10
            - Other currencies: 50 minor units
      type: object
      required:
        - amount_type
        - price_amount
      title: ProductPriceFixedCreate
      description: Schema to create a fixed price.
    ProductPriceFree:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: free
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
      title: ProductPriceFree
      description: A free price for a product.
    ProductPriceFreeCreate:
      properties:
        amount_type:
          type: string
          const: free
          title: Amount Type
        price_currency:
          $ref: '#/components/schemas/PresentmentCurrency'
          description: The currency in which the customer will be charged.
          default: usd
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If not set, it will default to the
            organization's default tax behavior.
      type: object
      required:
        - amount_type
      title: ProductPriceFreeCreate
      description: Schema to create a free price.
    ProductPriceMeter:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        name:
          type: string
          title: Name
          description: The name of the meter.
        unit:
          $ref: '#/components/schemas/MeterUnit'
          description: The unit of the meter.
        custom_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Label
          description: The label for the custom unit.
        custom_multiplier:
          anyOf:
            - type: integer
            - type: 'null'
          title: Custom Multiplier
          description: The multiplier to convert from base unit to display scale.
      type: object
      required:
        - id
        - name
        - unit
      title: ProductPriceMeter
      description: A meter associated to a metered price.
    ProductPriceMeteredUnit:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: metered_unit
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        unit_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Unit Amount
          description: The price per unit in cents.
        cap_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cap Amount
          description: >-
            The maximum amount in cents that can be charged, regardless of the
            number of units consumed.
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter associated to the price.
        meter:
          $ref: '#/components/schemas/ProductPriceMeter'
          description: The meter associated to the price.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - unit_amount
        - cap_amount
        - meter_id
        - meter
      title: ProductPriceMeteredUnit
      description: A metered, usage-based, price for a product, with a fixed unit price.
    ProductPriceMeteredUnitCreate:
      properties:
        amount_type:
          type: string
          const: metered_unit
          title: Amount Type
        price_currency:
          $ref: '#/components/schemas/PresentmentCurrency'
          description: The currency in which the customer will be charged.
          default: usd
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If not set, it will default to the
            organization's default tax behavior.
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter associated to the price.
        unit_amount:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: >-
                ^(?!^[-+.]*$)[+-]?0*(?:\d{0,5}|(?=[\d.]{1,18}0*$)\d{0,5}\.\d{0,12}0*$)
          title: Unit Amount
          description: The price per unit in cents. Supports up to 12 decimal places.
        cap_amount:
          anyOf:
            - type: integer
              maximum: 2147483647
              minimum: 0
            - type: 'null'
          title: Cap Amount
          description: >-
            Optional maximum amount in cents that can be charged, regardless of
            the number of units consumed.
      type: object
      required:
        - amount_type
        - meter_id
        - unit_amount
      title: ProductPriceMeteredUnitCreate
      description: Schema to create a metered price with a fixed unit price.
    ProductPriceSeatBased:
      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 price.
        source:
          $ref: '#/components/schemas/ProductPriceSource'
          description: >-
            The source of the price . `catalog` is a predefined price, while
            `ad_hoc` is a price created dynamically on a Checkout session.
        amount_type:
          type: string
          const: seat_based
          title: Amount Type
        price_currency:
          type: string
          title: Price Currency
          description: The currency in which the customer will be charged.
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If null, it defaults to the
            organization's default tax behavior.
        is_archived:
          type: boolean
          title: Is Archived
          description: Whether the price is archived and no longer available.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the product owning the price.
        seat_tiers:
          $ref: '#/components/schemas/ProductPriceSeatTiers-Output'
          description: Tiered pricing based on seat quantity
      type: object
      required:
        - created_at
        - modified_at
        - id
        - source
        - amount_type
        - price_currency
        - tax_behavior
        - is_archived
        - product_id
        - seat_tiers
      title: ProductPriceSeatBased
      description: A seat-based price for a product.
    ProductPriceSeatBasedCreate:
      properties:
        amount_type:
          type: string
          const: seat_based
          title: Amount Type
        price_currency:
          $ref: '#/components/schemas/PresentmentCurrency'
          description: The currency in which the customer will be charged.
          default: usd
        tax_behavior:
          anyOf:
            - $ref: '#/components/schemas/TaxBehaviorOption'
            - type: 'null'
          description: >-
            The tax behavior of the price. If not set, it will default to the
            organization's default tax behavior.
        seat_tiers:
          $ref: '#/components/schemas/ProductPriceSeatTiers-Input'
          description: Tiered pricing based on seat quantity
      type: object
      required:
        - amount_type
        - seat_tiers
      title: ProductPriceSeatBasedCreate
      description: Schema to create a seat-based price with volume-based tiers.
    ProductPriceSeatTier:
      properties:
        min_seats:
          type: integer
          minimum: 1
          title: Min Seats
          description: Minimum number of seats (inclusive)
        max_seats:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Seats
          description: Maximum number of seats (inclusive). None for unlimited.
        price_per_seat:
          type: integer
          minimum: 0
          title: Price Per Seat
          description: Price per seat in cents for this tier
      type: object
      required:
        - min_seats
        - price_per_seat
      title: ProductPriceSeatTier
      description: A pricing tier for seat-based pricing.
    ProductPriceSeatTiers-Input:
      properties:
        seat_tier_type:
          $ref: '#/components/schemas/SeatTierType'
          description: >-
            How tiers are applied. 'volume' prices all seats at the matching
            tier's rate. 'graduated' prices each tier's range independently.
          default: volume
        tiers:
          items:
            $ref: '#/components/schemas/ProductPriceSeatTier'
          type: array
          minItems: 1
          title: Tiers
          description: List of pricing tiers
      type: object
      required:
        - tiers
      title: ProductPriceSeatTiers
      description: |-
        List of pricing tiers for seat-based pricing.

        The minimum and maximum seat limits are derived from the tiers:
        - minimum_seats = first tier's min_seats
        - maximum_seats = last tier's max_seats (None for unlimited)
    ProductPriceSeatTiers-Output:
      properties:
        seat_tier_type:
          $ref: '#/components/schemas/SeatTierType'
          description: >-
            How tiers are applied. 'volume' prices all seats at the matching
            tier's rate. 'graduated' prices each tier's range independently.
          default: volume
        tiers:
          items:
            $ref: '#/components/schemas/ProductPriceSeatTier'
          type: array
          minItems: 1
          title: Tiers
          description: List of pricing tiers
        minimum_seats:
          type: integer
          title: Minimum Seats
          description: >-
            Minimum number of seats required for purchase, derived from first
            tier.
        maximum_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Maximum Seats
          description: >-
            Maximum number of seats allowed for purchase, derived from last
            tier. None for unlimited.
      type: object
      required:
        - tiers
        - minimum_seats
        - maximum_seats
      title: ProductPriceSeatTiers
      description: |-
        List of pricing tiers for seat-based pricing.

        The minimum and maximum seat limits are derived from the tiers:
        - minimum_seats = first tier's min_seats
        - maximum_seats = last tier's max_seats (None for unlimited)
    ProductPriceSource:
      type: string
      enum:
        - catalog
        - ad_hoc
      title: ProductPriceSource
    ProductPriceType:
      type: string
      enum:
        - one_time
        - recurring
      title: ProductPriceType
    ProductSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - name
        - '-name'
        - price_amount_type
        - '-price_amount_type'
        - price_amount
        - '-price_amount'
      title: ProductSortProperty
    ProductUpdate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        trial_interval:
          anyOf:
            - $ref: '#/components/schemas/TrialInterval'
            - type: 'null'
          description: The interval unit for the trial period.
        trial_interval_count:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Trial Interval Count
          description: The number of interval units for the trial period.
        name:
          anyOf:
            - type: string
              maxLength: 64
              minLength: 3
              description: The name of the product.
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description of the product.
        recurring_interval:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionRecurringInterval'
            - type: 'null'
          description: >-
            The recurring interval of the product. If `None`, the product is a
            one-time purchase. **Can only be set on legacy recurring products.
            Once set, it can't be changed.**
        recurring_interval_count:
          anyOf:
            - type: integer
              maximum: 999
              minimum: 1
            - type: 'null'
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on. Once set, it can't be
            changed.**
        is_archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Archived
          description: >-
            Whether the product is archived. If `true`, the product won't be
            available for purchase anymore. Existing customers will still have
            access to their benefits, and subscriptions will continue normally.
        visibility:
          anyOf:
            - $ref: '#/components/schemas/ProductVisibility'
            - type: 'null'
          description: The visibility of the product.
        prices:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ExistingProductPrice'
                  - oneOf:
                      - $ref: '#/components/schemas/ProductPriceFixedCreate'
                      - $ref: '#/components/schemas/ProductPriceCustomCreate'
                      - $ref: '#/components/schemas/ProductPriceFreeCreate'
                      - $ref: '#/components/schemas/ProductPriceSeatBasedCreate'
                      - $ref: '#/components/schemas/ProductPriceMeteredUnitCreate'
                    discriminator:
                      propertyName: amount_type
                      mapping:
                        custom: '#/components/schemas/ProductPriceCustomCreate'
                        fixed: '#/components/schemas/ProductPriceFixedCreate'
                        free: '#/components/schemas/ProductPriceFreeCreate'
                        metered_unit: '#/components/schemas/ProductPriceMeteredUnitCreate'
                        seat_based: '#/components/schemas/ProductPriceSeatBasedCreate'
              type: array
            - type: 'null'
          title: Prices
          description: >-
            List of available prices for this product. If you want to keep
            existing prices, include them in the list as an
            `ExistingProductPrice` object.
        medias:
          anyOf:
            - items:
                type: string
                format: uuid4
              type: array
            - type: 'null'
          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
      title: ProductUpdate
      description: Schema to update a product.
    ProductVisibility:
      type: string
      enum:
        - draft
        - private
        - public
      title: Visibility
    PropertyAggregation:
      properties:
        func:
          type: string
          enum:
            - sum
            - max
            - min
            - avg
          title: Func
        property:
          type: string
          title: Property
      type: object
      required:
        - func
        - property
      title: PropertyAggregation
    Refund:
      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 object.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        status:
          $ref: '#/components/schemas/RefundStatus'
        reason:
          $ref: '#/components/schemas/RefundReason'
        amount:
          type: integer
          title: Amount
        tax_amount:
          type: integer
          title: Tax Amount
        currency:
          type: string
          title: Currency
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        order_id:
          type: string
          format: uuid4
          title: Order Id
        subscription_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Subscription Id
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        revoke_benefits:
          type: boolean
          title: Revoke Benefits
        dispute:
          anyOf:
            - $ref: '#/components/schemas/RefundDispute'
            - type: 'null'
      type: object
      required:
        - created_at
        - modified_at
        - id
        - metadata
        - status
        - reason
        - amount
        - tax_amount
        - currency
        - organization_id
        - order_id
        - subscription_id
        - customer_id
        - revoke_benefits
        - dispute
      title: Refund
    RefundCreate:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        order_id:
          type: string
          format: uuid4
          title: Order Id
        reason:
          $ref: '#/components/schemas/RefundReason'
        amount:
          type: integer
          exclusiveMinimum: 0
          title: Amount
          description: Amount to refund in cents. Minimum is 1.
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: An internal comment about the refund.
        revoke_benefits:
          type: boolean
          title: Revoke Benefits
          description: >-
            Should this refund trigger the associated customer benefits to be
            revoked?


            **Note:**

            Only allowed in case the `order` is a one-time purchase.

            Subscriptions automatically revoke customer benefits once the

            subscription itself is revoked, i.e fully canceled.
          default: false
      type: object
      required:
        - order_id
        - reason
        - amount
      title: RefundCreate
    RefundDispute:
      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 object.
        status:
          $ref: '#/components/schemas/DisputeStatus'
          description: >-
            Status of the dispute. `prevented` means we issued a refund before
            the dispute was escalated, avoiding any fees.
          examples:
            - needs_response
            - prevented
        resolved:
          type: boolean
          title: Resolved
          description: Whether the dispute has been resolved (won or lost).
          examples:
            - false
        closed:
          type: boolean
          title: Closed
          description: Whether the dispute is closed (prevented, won, or lost).
          examples:
            - false
        amount:
          type: integer
          title: Amount
          description: Amount in cents disputed.
          examples:
            - 1000
        tax_amount:
          type: integer
          title: Tax Amount
          description: Tax amount in cents disputed.
          examples:
            - 200
        currency:
          type: string
          title: Currency
          description: Currency code of the dispute.
          examples:
            - usd
        order_id:
          type: string
          format: uuid4
          title: Order Id
          description: The ID of the order associated with the dispute.
          examples:
            - 57107b74-8400-4d80-a2fc-54c2b4239cb3
        payment_id:
          type: string
          format: uuid4
          title: Payment Id
          description: The ID of the payment associated with the dispute.
          examples:
            - 42b94870-36b9-4573-96b6-b90b1c99a353
      type: object
      required:
        - created_at
        - modified_at
        - id
        - status
        - resolved
        - closed
        - amount
        - tax_amount
        - currency
        - order_id
        - payment_id
      title: RefundDispute
      description: |-
        Dispute associated with a refund,
        in case we prevented a dispute by issuing a refund.
    RefundReason:
      type: string
      enum:
        - duplicate
        - fraudulent
        - customer_request
        - service_disruption
        - satisfaction_guarantee
        - dispute_prevention
        - other
      title: RefundReason
    RefundSortProperty:
      type: string
      enum:
        - created_at
        - '-created_at'
        - amount
        - '-amount'
      title: RefundSortProperty
    RefundStatus:
      type: string
      enum:
        - pending
        - succeeded
        - failed
        - canceled
      title: RefundStatus
    RefundedAlready:
      properties:
        error:
          type: string
          const: RefundedAlready
          title: Error
          examples:
            - RefundedAlready
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: RefundedAlready
    ResourceNotFound:
      properties:
        error:
          type: string
          const: ResourceNotFound
          title: Error
          examples:
            - ResourceNotFound
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: ResourceNotFound
    RevokeTokenResponse:
      properties: {}
      type: object
      title: RevokeTokenResponse
    S3DownloadURL:
      properties:
        url:
          type: string
          title: Url
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          default: {}
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - url
        - expires_at
      title: S3DownloadURL
    S3FileCreateMultipart:
      properties:
        parts:
          items:
            $ref: '#/components/schemas/S3FileCreatePart'
          type: array
          title: Parts
      type: object
      required:
        - parts
      title: S3FileCreateMultipart
    S3FileCreatePart:
      properties:
        number:
          type: integer
          title: Number
        chunk_start:
          type: integer
          title: Chunk Start
        chunk_end:
          type: integer
          title: Chunk End
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
      type: object
      required:
        - number
        - chunk_start
        - chunk_end
      title: S3FileCreatePart
    S3FileUploadCompletedPart:
      properties:
        number:
          type: integer
          title: Number
        checksum_etag:
          type: string
          title: Checksum Etag
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
      type: object
      required:
        - number
        - checksum_etag
        - checksum_sha256_base64
      title: S3FileUploadCompletedPart
    S3FileUploadMultipart:
      properties:
        id:
          type: string
          title: Id
        path:
          type: string
          title: Path
        parts:
          items:
            $ref: '#/components/schemas/S3FileUploadPart'
          type: array
          title: Parts
      type: object
      required:
        - id
        - path
        - parts
      title: S3FileUploadMultipart
    S3FileUploadPart:
      properties:
        number:
          type: integer
          title: Number
        chunk_start:
          type: integer
          title: Chunk Start
        chunk_end:
          type: integer
          title: Chunk End
        checksum_sha256_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum Sha256 Base64
        url:
          type: string
          title: Url
        expires_at:
          type: string
          format: date-time
          title: Expires At
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          default: {}
      type: object
      required:
        - number
        - chunk_start
        - chunk_end
        - url
        - expires_at
      title: S3FileUploadPart
    Scope:
      type: string
      enum:
        - openid
        - profile
        - email
        - user:read
        - user:write
        - organizations:read
        - organizations:write
        - custom_fields:read
        - custom_fields:write
        - discounts:read
        - discounts:write
        - checkout_links:read
        - checkout_links:write
        - checkouts:read
        - checkouts:write
        - transactions:read
        - transactions:write
        - payouts:read
        - payouts:write
        - products:read
        - products:write
        - benefits:read
        - benefits:write
        - events:read
        - events:write
        - meters:read
        - meters:write
        - files:read
        - files:write
        - subscriptions:read
        - subscriptions:write
        - customers:read
        - customers:write
        - members:read
        - members:write
        - wallets:read
        - wallets:write
        - disputes:read
        - customer_meters:read
        - customer_sessions:write
        - member_sessions:write
        - customer_seats:read
        - customer_seats:write
        - orders:read
        - orders:write
        - refunds:read
        - refunds:write
        - payments:read
        - metrics:read
        - metrics:write
        - webhooks:read
        - webhooks:write
        - license_keys:read
        - license_keys:write
        - customer_portal:read
        - customer_portal:write
        - notifications:read
        - notifications:write
        - notification_recipients:read
        - notification_recipients:write
        - organization_access_tokens:read
        - organization_access_tokens:write
      title: Scope
      enumNames:
        benefits:read: Read benefits
        benefits:write: Create or modify benefits
        checkout_links:read: Read checkout links
        checkout_links:write: Create or modify checkout links
        checkouts:read: Read checkout sessions
        checkouts:write: Create or modify checkout sessions
        custom_fields:read: Read custom fields
        custom_fields:write: Create or modify custom fields
        customer_meters:read: Read customer meters
        customer_portal:read: Read your orders, subscriptions and benefits
        customer_portal:write: Create or modify your orders, subscriptions and benefits
        customer_seats:read: Read customer seats
        customer_seats:write: Create or modify customer seats
        customer_sessions:write: Create or modify customer sessions
        customers:read: Read customers
        customers:write: Create or modify customers
        discounts:read: Read discounts
        discounts:write: Create or modify discounts
        disputes:read: Read disputes
        email: Read your email address
        events:read: Read events
        events:write: Create events
        files:read: Read file uploads
        files:write: Create or modify file uploads
        license_keys:read: Read license keys
        license_keys:write: Modify license keys
        member_sessions:write: Create or modify member sessions
        members:read: Read members
        members:write: Create or modify members
        meters:read: Read meters
        meters:write: Create or modify meters
        metrics:read: Read metrics
        metrics:write: Create or modify metric definitions
        notification_recipients:read: Read notification recipients
        notification_recipients:write: Create or modify notification recipients
        notifications:read: Read notifications
        notifications:write: Mark notifications as read
        openid: OpenID
        orders:read: Read orders made on your organizations
        orders:write: Modify orders made on your organizations
        organization_access_tokens:read: Read organization access tokens
        organization_access_tokens:write: Create or modify organization access tokens
        organizations:read: Read your organizations
        organizations:write: Create or modify organizations
        payments:read: Read payments made on your organizations
        payouts:read: Read payouts
        payouts:write: Create or modify payouts
        products:read: Read products
        products:write: Create or modify products
        profile: Read your profile
        refunds:read: Read refunds made on your organizations
        refunds:write: Create or modify refunds
        subscriptions:read: Read subscriptions made on your organizations
        subscriptions:write: Create or modify subscriptions made on your organizations
        transactions:read: Read transactions
        transactions:write: Create or modify transactions
        user:read: Read your user account
        user:write: Manage your user account
        wallets:read: Read wallets
        wallets:write: Create or modify wallets
        webhooks:read: Read webhooks
        webhooks:write: Create or modify webhooks
    SeatAssign:
      properties:
        subscription_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Subscription Id
          description: >-
            Subscription ID. Required if neither order_id nor checkout_id is
            provided.
        order_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Order Id
          description: >-
            Order ID for one-time purchases. Required if subscription_id is not
            provided.
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: Email of the customer to assign the seat to
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: External customer ID for the seat assignment
        customer_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Customer Id
          description: Customer ID for the seat assignment
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            External member ID for the seat assignment. Can be used alone
            (lookup existing member) or with email (create/validate member).
        member_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Member Id
          description: Member ID for the seat assignment.
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Additional metadata for the seat (max 10 keys, 1KB total)
        immediate_claim:
          type: boolean
          title: Immediate Claim
          description: >-
            If true, the seat will be immediately claimed without sending an
            invitation email. API-only feature.
          default: false
      type: object
      title: SeatAssign
    SeatClaim:
      properties:
        invitation_token:
          type: string
          title: Invitation Token
          description: Invitation token to claim the seat
      type: object
      required:
        - invitation_token
      title: SeatClaim
    SeatClaimInfo:
      properties:
        product_name:
          type: string
          title: Product Name
          description: Name of the product
        product_id:
          type: string
          format: uuid
          title: Product Id
          description: ID of the product
        organization_name:
          type: string
          title: Organization Name
          description: Name of the organization
        organization_slug:
          type: string
          title: Organization Slug
          description: Slug of the organization
        customer_email:
          type: string
          title: Customer Email
          description: Email of the customer assigned to this seat
        can_claim:
          type: boolean
          title: Can Claim
          description: Whether the seat can be claimed
      type: object
      required:
        - product_name
        - product_id
        - organization_name
        - organization_slug
        - customer_email
        - can_claim
      title: SeatClaimInfo
      description: |-
        Read-only information about a seat claim invitation.
        Safe for email scanners - no side effects when fetched.
    SeatStatus:
      type: string
      enum:
        - pending
        - claimed
        - revoked
      title: SeatStatus
    SeatTierType:
      type: string
      enum:
        - volume
        - graduated
      title: SeatTierType
    SeatsList:
      properties:
        seats:
          items:
            $ref: '#/components/schemas/CustomerSeat'
          type: array
          title: Seats
          description: List of seats
        available_seats:
          type: integer
          title: Available Seats
          description: Number of available seats
        total_seats:
          type: integer
          title: Total Seats
          description: Total number of seats for the subscription
      type: object
      required:
        - seats
        - available_seats
        - total_seats
      title: SeatsList
    SubType:
      type: string
      enum:
        - user
        - organization
      title: SubType
    Subscription:
      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 object.
        amount:
          type: integer
          title: Amount
          description: The amount of the subscription.
          examples:
            - 10000
        currency:
          type: string
          title: Currency
          description: The currency of the subscription.
          examples:
            - usd
        recurring_interval:
          $ref: '#/components/schemas/SubscriptionRecurringInterval'
          description: The interval at which the subscription recurs.
          examples:
            - month
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
          description: >-
            Number of interval units of the subscription. If this is set to 1
            the charge will happen every interval (e.g. every month), if set to
            2 it will be every other month, and so on.
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
          description: The status of the subscription.
          examples:
            - active
        current_period_start:
          type: string
          format: date-time
          title: Current Period Start
          description: The start timestamp of the current billing period.
        current_period_end:
          type: string
          format: date-time
          title: Current Period End
          description: The end timestamp of the current billing period.
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: The start timestamp of the trial period, if any.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: The end timestamp of the trial period, if any.
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Whether the subscription will be canceled at the end of the current
            period.
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: >-
            The timestamp when the subscription was canceled. The subscription
            might still be active if `cancel_at_period_end` is `true`.
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
          description: The timestamp when the subscription started.
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
          description: The timestamp when the subscription will end.
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
          description: The timestamp when the subscription ended.
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the subscribed customer.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: The ID of the subscribed product.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: The ID of the applied discount, if any.
        checkout_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Checkout Id
        seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seats
          description: >-
            The number of seats for seat-based subscriptions. None for non-seat
            subscriptions.
        customer_cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
        customer_cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Cancellation Comment
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        custom_field_data:
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: string
                format: date-time
              - type: 'null'
          type: object
          title: Custom Field Data
          description: Key-value object storing custom field values.
        customer:
          $ref: '#/components/schemas/SubscriptionCustomer'
        product:
          $ref: '#/components/schemas/Product'
        discount:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/DiscountFixedOnceForeverDurationBase'
                - $ref: '#/components/schemas/DiscountFixedRepeatDurationBase'
                - $ref: >-
                    #/components/schemas/DiscountPercentageOnceForeverDurationBase
                - $ref: '#/components/schemas/DiscountPercentageRepeatDurationBase'
              title: SubscriptionDiscount
            - type: 'null'
          title: Discount
        prices:
          items:
            oneOf:
              - $ref: '#/components/schemas/LegacyRecurringProductPrice'
              - $ref: '#/components/schemas/ProductPrice'
          type: array
          title: Prices
          description: List of enabled prices for the subscription.
        meters:
          items:
            $ref: '#/components/schemas/SubscriptionMeter'
          type: array
          title: Meters
          description: List of meters associated with the subscription.
        pending_update:
          anyOf:
            - $ref: '#/components/schemas/PendingSubscriptionUpdate'
            - type: 'null'
          description: >-
            Pending subscription update that will be applied at the beginning of
            the next period. If `null`, there is no pending update.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
        - status
        - current_period_start
        - current_period_end
        - trial_start
        - trial_end
        - cancel_at_period_end
        - canceled_at
        - started_at
        - ends_at
        - ended_at
        - customer_id
        - product_id
        - discount_id
        - checkout_id
        - customer_cancellation_reason
        - customer_cancellation_comment
        - metadata
        - customer
        - product
        - discount
        - prices
        - meters
        - pending_update
      title: Subscription
    SubscriptionBillingPeriodUpdatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.billing_period_updated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionBillingPeriodUpdatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionBillingPeriodUpdatedEvent
      description: An event created by Polar when a subscription billing period is updated.
    SubscriptionBillingPeriodUpdatedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        old_period_end:
          type: string
          title: Old Period End
        new_period_end:
          type: string
          title: New Period End
      type: object
      required:
        - subscription_id
        - old_period_end
        - new_period_end
      title: SubscriptionBillingPeriodUpdatedMetadata
    SubscriptionCancel:
      properties:
        customer_cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
          description: >-
            Customer reason for cancellation.


            Helpful to monitor reasons behind churn for future improvements.


            Only set this in case your own service is requesting the reason from
            the

            customer. Or you know based on direct conversations, i.e support,
            with

            the customer.


            * `too_expensive`: Too expensive for the customer.

            * `missing_features`: Customer is missing certain features.

            * `switched_service`: Customer switched to another service.

            * `unused`: Customer is not using it enough.

            * `customer_service`: Customer is not satisfied with the customer
            service.

            * `low_quality`: Customer is unhappy with the quality.

            * `too_complex`: Customer considers the service too complicated.

            * `other`: Other reason(s).
        customer_cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Cancellation Comment
          description: >-
            Customer feedback and why they decided to cancel.


            **IMPORTANT:**

            Do not use this to store internal notes! It's intended to be input

            from the customer and is therefore also available in their Polar

            purchases library.


            Only set this in case your own service is requesting the reason from
            the

            customer. Or you copy a message directly from a customer

            conversation, i.e support.
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: >-
            Cancel an active subscription once the current period ends.


            Or uncancel a subscription currently set to be revoked at period
            end.
      type: object
      required:
        - cancel_at_period_end
      title: SubscriptionCancel
    SubscriptionCanceledEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.canceled
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionCanceledMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionCanceledEvent
      description: An event created by Polar when a subscription is canceled.
    SubscriptionCanceledMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
        customer_cancellation_reason:
          type: string
          title: Customer Cancellation Reason
        customer_cancellation_comment:
          type: string
          title: Customer Cancellation Comment
        canceled_at:
          type: string
          title: Canceled At
        ends_at:
          type: string
          title: Ends At
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
      type: object
      required:
        - subscription_id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
        - canceled_at
      title: SubscriptionCanceledMetadata
    SubscriptionCreateCustomer:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: >-
            The ID of the recurring product to subscribe to. Must be a free
            product, otherwise the customer should go through a checkout flow.
          examples:
            - d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
          description: The ID of the customer to create the subscription for.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
      type: object
      required:
        - product_id
        - customer_id
      title: SubscriptionCreateCustomer
      description: Create a subscription for an existing customer.
    SubscriptionCreateExternalCustomer:
      properties:
        metadata:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 500
                minLength: 1
              - type: integer
              - type: number
              - type: boolean
          propertyNames:
            maxLength: 40
            minLength: 1
          type: object
          maxProperties: 50
          title: Metadata
          description: |-
            Key-value object allowing you to store additional information.

            The key must be a string with a maximum length of **40 characters**.
            The value must be either:

            * A string with a maximum length of **500 characters**
            * An integer
            * A floating-point number
            * A boolean

            You can store up to **50 key-value pairs**.
        product_id:
          type: string
          format: uuid4
          title: Product Id
          description: >-
            The ID of the recurring product to subscribe to. Must be a free
            product, otherwise the customer should go through a checkout flow.
          examples:
            - d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23
        external_customer_id:
          type: string
          title: External Customer Id
          description: >-
            The ID of the customer in your system to create the subscription
            for. It must already exist in Polar.
      type: object
      required:
        - product_id
        - external_customer_id
      title: SubscriptionCreateExternalCustomer
      description: >-
        Create a subscription for an existing customer identified by an external
        ID.
    SubscriptionCreatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.created
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionCreatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionCreatedEvent
      description: An event created by Polar when a subscription is created.
    SubscriptionCreatedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
        started_at:
          type: string
          title: Started At
      type: object
      required:
        - subscription_id
        - product_id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
        - started_at
      title: SubscriptionCreatedMetadata
    SubscriptionCustomer:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the customer.
          examples:
            - 992fae2a-2a17-4b7a-8d9e-e287cf90131b
        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.
        metadata:
          $ref: '#/components/schemas/MetadataOutputType'
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: >-
            The ID of the customer in your system. This must be unique within
            the organization. Once set, it can't be updated.
          examples:
            - usr_1337
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: >-
            The email address of the customer. This must be unique within the
            organization.
          examples:
            - customer@example.com
        email_verified:
          type: boolean
          title: Email Verified
          description: >-
            Whether the customer email address is verified. The address is
            automatically verified when the customer accesses the customer
            portal using their email address.
          examples:
            - true
        type:
          $ref: '#/components/schemas/CustomerType'
          description: >-
            The type of customer: 'individual' for single users, 'team' for
            customers with multiple members.
          examples:
            - individual
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The name of the customer.
          examples:
            - John Doe
        billing_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Billing Name
          description: >-
            The name that should appear on the customer's invoices. Falls back
            to the customer name when not explicitly set.
          examples:
            - John Doe
        billing_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
        tax_id:
          anyOf:
            - prefixItems:
                - type: string
                - $ref: '#/components/schemas/TaxIDFormat'
              type: array
              maxItems: 2
              minItems: 2
              examples:
                - - '911144442'
                  - us_ein
                - - FR61954506077
                  - eu_vat
            - type: 'null'
          title: Tax Id
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the customer.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
        default_payment_method_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Default Payment Method Id
          description: >-
            The ID of the customer's default payment method, if any. Use the
            payment methods endpoint to retrieve its details.
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp for when the customer was soft deleted.
        avatar_url:
          type: string
          title: Avatar Url
          examples:
            - https://www.gravatar.com/avatar/xxx?d=404
      type: object
      required:
        - id
        - created_at
        - modified_at
        - metadata
        - email_verified
        - type
        - name
        - billing_name
        - billing_address
        - tax_id
        - organization_id
        - deleted_at
        - avatar_url
      title: SubscriptionCustomer
    SubscriptionCycledEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.cycled
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionCycledMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionCycledEvent
      description: An event created by Polar when a subscription is cycled.
    SubscriptionCycledMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
      type: object
      required:
        - subscription_id
      title: SubscriptionCycledMetadata
    SubscriptionLocked:
      properties:
        error:
          type: string
          const: SubscriptionLocked
          title: Error
          examples:
            - SubscriptionLocked
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: SubscriptionLocked
    SubscriptionMeter:
      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 object.
        consumed_units:
          type: number
          title: Consumed Units
          description: The number of consumed units so far in this billing period.
          examples:
            - 25
        credited_units:
          type: integer
          title: Credited Units
          description: The number of credited units so far in this billing period.
          examples:
            - 100
        amount:
          type: integer
          title: Amount
          description: The amount due in cents so far in this billing period.
          examples:
            - 0
        meter_id:
          type: string
          format: uuid4
          title: Meter Id
          description: The ID of the meter.
          examples:
            - d498a884-e2cd-4d3e-8002-f536468a8b22
        meter:
          $ref: '#/components/schemas/Meter'
          description: The meter associated with this subscription.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - consumed_units
        - credited_units
        - amount
        - meter_id
        - meter
      title: SubscriptionMeter
      description: Current consumption and spending for a subscription meter.
    SubscriptionPastDueEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.past_due
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionPastDueMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionPastDueEvent
      description: An event created by Polar when a subscription becomes past due.
    SubscriptionPastDueMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        past_due_at:
          type: string
          title: Past Due At
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
      type: object
      required:
        - subscription_id
        - past_due_at
      title: SubscriptionPastDueMetadata
    SubscriptionProductUpdatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.product_updated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionProductUpdatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionProductUpdatedEvent
      description: An event created by Polar when a subscription changes the product.
    SubscriptionProductUpdatedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        old_product_id:
          type: string
          title: Old Product Id
        new_product_id:
          type: string
          title: New Product Id
      type: object
      required:
        - subscription_id
        - old_product_id
        - new_product_id
      title: SubscriptionProductUpdatedMetadata
    SubscriptionProrationBehavior:
      type: string
      enum:
        - invoice
        - prorate
        - next_period
        - reset
      title: SubscriptionProrationBehavior
    SubscriptionReactivatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.reactivated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionReactivatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionReactivatedEvent
      description: An event created by Polar when a past due subscription is recovered.
    SubscriptionReactivatedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
      type: object
      required:
        - subscription_id
      title: SubscriptionReactivatedMetadata
    SubscriptionRecurringInterval:
      type: string
      enum:
        - day
        - week
        - month
        - year
      title: SubscriptionRecurringInterval
    SubscriptionRevoke:
      properties:
        customer_cancellation_reason:
          anyOf:
            - $ref: '#/components/schemas/CustomerCancellationReason'
            - type: 'null'
          description: >-
            Customer reason for cancellation.


            Helpful to monitor reasons behind churn for future improvements.


            Only set this in case your own service is requesting the reason from
            the

            customer. Or you know based on direct conversations, i.e support,
            with

            the customer.


            * `too_expensive`: Too expensive for the customer.

            * `missing_features`: Customer is missing certain features.

            * `switched_service`: Customer switched to another service.

            * `unused`: Customer is not using it enough.

            * `customer_service`: Customer is not satisfied with the customer
            service.

            * `low_quality`: Customer is unhappy with the quality.

            * `too_complex`: Customer considers the service too complicated.

            * `other`: Other reason(s).
        customer_cancellation_comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Cancellation Comment
          description: >-
            Customer feedback and why they decided to cancel.


            **IMPORTANT:**

            Do not use this to store internal notes! It's intended to be input

            from the customer and is therefore also available in their Polar

            purchases library.


            Only set this in case your own service is requesting the reason from
            the

            customer. Or you copy a message directly from a customer

            conversation, i.e support.
        revoke:
          type: boolean
          const: true
          title: Revoke
          description: Cancel and revoke an active subscription immediately
      type: object
      required:
        - revoke
      title: SubscriptionRevoke
    SubscriptionRevokedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.revoked
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionRevokedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionRevokedEvent
      description: >-
        An event created by Polar when a subscription is revoked from a
        customer.
    SubscriptionRevokedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
      type: object
      required:
        - subscription_id
      title: SubscriptionRevokedMetadata
    SubscriptionSeatsUpdatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.seats_updated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionSeatsUpdatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionSeatsUpdatedEvent
      description: An event created by Polar when a the seats on a subscription is changed.
    SubscriptionSeatsUpdatedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        old_seats:
          type: integer
          title: Old Seats
        new_seats:
          type: integer
          title: New Seats
        proration_behavior:
          type: string
          title: Proration Behavior
      type: object
      required:
        - subscription_id
        - old_seats
        - new_seats
        - proration_behavior
      title: SubscriptionSeatsUpdatedMetadata
    SubscriptionSortProperty:
      type: string
      enum:
        - customer
        - '-customer'
        - status
        - '-status'
        - started_at
        - '-started_at'
        - current_period_end
        - '-current_period_end'
        - ended_at
        - '-ended_at'
        - ends_at
        - '-ends_at'
        - amount
        - '-amount'
        - product
        - '-product'
        - discount
        - '-discount'
      title: SubscriptionSortProperty
    SubscriptionStatus:
      type: string
      enum:
        - incomplete
        - incomplete_expired
        - trialing
        - active
        - past_due
        - canceled
        - unpaid
      title: SubscriptionStatus
    SubscriptionUncanceledEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.uncanceled
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionUncanceledMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionUncanceledEvent
      description: An event created by Polar when a subscription cancellation is reversed.
    SubscriptionUncanceledMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        recurring_interval:
          type: string
          title: Recurring Interval
        recurring_interval_count:
          type: integer
          title: Recurring Interval Count
      type: object
      required:
        - subscription_id
        - product_id
        - amount
        - currency
        - recurring_interval
        - recurring_interval_count
      title: SubscriptionUncanceledMetadata
    SubscriptionUpdate:
      anyOf:
        - $ref: '#/components/schemas/SubscriptionUpdateBase'
        - $ref: '#/components/schemas/SubscriptionUpdateSeats'
        - $ref: '#/components/schemas/SubscriptionUpdateBillingPeriod'
        - $ref: '#/components/schemas/SubscriptionCancel'
        - $ref: '#/components/schemas/SubscriptionRevoke'
        - $ref: '#/components/schemas/SubscriptionUpdateClear'
    SubscriptionUpdateBase:
      properties:
        product_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Product Id
          description: Update subscription to another product.
          examples:
            - d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23
        proration_behavior:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionProrationBehavior'
            - type: 'null'
          description: >-
            Determine how to handle the proration billing. If not provided, will
            use the default organization setting.
        discount_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Discount Id
          description: >-
            Update the subscription to apply a new discount. If set to `null`,
            the discount will be removed. The change will be applied on the next
            billing cycle.
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: string
              const: now
            - type: 'null'
          title: Trial End
          description: >-
            Set or extend the trial period of the subscription. If set to `now`,
            the trial will end immediately.
      type: object
      title: SubscriptionUpdateBase
    SubscriptionUpdateBillingPeriod:
      properties:
        current_billing_period_end:
          type: string
          format: date-time
          title: Current Billing Period End
          description: >-
            Set a new date for the end of the current billing period. The
            subscription will renew on this date. The new date can be earlier or
            later than the current period end, as long as it's in the future.


            It is not possible to update the current billing period on a
            canceled subscription.
      type: object
      required:
        - current_billing_period_end
      title: SubscriptionUpdateBillingPeriod
    SubscriptionUpdateClear:
      properties:
        pending_update:
          type: 'null'
          title: Pending Update
          description: >-
            Clear the pending subscription update. Set to null to remove
            scheduled changes.
      type: object
      required:
        - pending_update
      title: SubscriptionUpdateClear
    SubscriptionUpdateClearedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.update_cleared
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionUpdateClearedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionUpdateClearedEvent
      description: >-
        An event created by Polar when a pending subscription update is cleared
        without being applied.
    SubscriptionUpdateClearedMetadata:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
      type: object
      required:
        - subscription_id
      title: SubscriptionUpdateClearedMetadata
    SubscriptionUpdateSeats:
      properties:
        seats:
          type: integer
          minimum: 1
          title: Seats
          description: Update the number of seats for this subscription.
        proration_behavior:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionProrationBehavior'
            - type: 'null'
          description: >-
            Determine how to handle the proration billing. If not provided, will
            use the default organization setting.
      type: object
      required:
        - seats
      title: SubscriptionUpdateSeats
    SubscriptionUpdatedEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        source:
          type: string
          const: system
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        name:
          type: string
          const: subscription.updated
          title: Name
          description: The name of the event.
        metadata:
          $ref: '#/components/schemas/SubscriptionUpdatedMetadata'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - source
        - name
        - metadata
      title: SubscriptionUpdatedEvent
      description: An event created by Polar when a subscription is updated.
    SubscriptionUpdatedMetadata:
      properties:
        product_id:
          type: string
          title: Product Id
        proration_behavior:
          $ref: '#/components/schemas/SubscriptionProrationBehavior'
        discount_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Discount Id
        trial_end:
          type: string
          title: Trial End
        seats:
          type: integer
          title: Seats
        billing_period_end:
          type: string
          title: Billing Period End
        subscription_id:
          type: string
          title: Subscription Id
      type: object
      required:
        - subscription_id
      title: SubscriptionUpdatedMetadata
    SubscriptionUser:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        public_name:
          type: string
          title: Public Name
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
        github_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Github Username
      type: object
      required:
        - id
        - public_name
      title: SubscriptionUser
    SystemEvent:
      oneOf:
        - $ref: '#/components/schemas/MeterCreditEvent'
        - $ref: '#/components/schemas/MeterResetEvent'
        - $ref: '#/components/schemas/BenefitGrantedEvent'
        - $ref: '#/components/schemas/BenefitCycledEvent'
        - $ref: '#/components/schemas/BenefitUpdatedEvent'
        - $ref: '#/components/schemas/BenefitRevokedEvent'
        - $ref: '#/components/schemas/SubscriptionCreatedEvent'
        - $ref: '#/components/schemas/SubscriptionUpdatedEvent'
        - $ref: '#/components/schemas/SubscriptionCycledEvent'
        - $ref: '#/components/schemas/SubscriptionCanceledEvent'
        - $ref: '#/components/schemas/SubscriptionRevokedEvent'
        - $ref: '#/components/schemas/SubscriptionPastDueEvent'
        - $ref: '#/components/schemas/SubscriptionReactivatedEvent'
        - $ref: '#/components/schemas/SubscriptionUncanceledEvent'
        - $ref: '#/components/schemas/SubscriptionProductUpdatedEvent'
        - $ref: '#/components/schemas/SubscriptionSeatsUpdatedEvent'
        - $ref: '#/components/schemas/SubscriptionBillingPeriodUpdatedEvent'
        - $ref: '#/components/schemas/SubscriptionUpdateClearedEvent'
        - $ref: '#/components/schemas/OrderPaidEvent'
        - $ref: '#/components/schemas/OrderRefundedEvent'
        - $ref: '#/components/schemas/OrderVoidedEvent'
        - $ref: '#/components/schemas/CheckoutCreatedEvent'
        - $ref: '#/components/schemas/CustomerCreatedEvent'
        - $ref: '#/components/schemas/CustomerUpdatedEvent'
        - $ref: '#/components/schemas/CustomerDeletedEvent'
        - $ref: '#/components/schemas/BalanceOrderEvent'
        - $ref: '#/components/schemas/BalanceCreditOrderEvent'
        - $ref: '#/components/schemas/BalanceRefundEvent'
        - $ref: '#/components/schemas/BalanceRefundReversalEvent'
        - $ref: '#/components/schemas/BalanceDisputeEvent'
        - $ref: '#/components/schemas/BalanceDisputeReversalEvent'
      discriminator:
        propertyName: name
        mapping:
          balance.credit_order: '#/components/schemas/BalanceCreditOrderEvent'
          balance.dispute: '#/components/schemas/BalanceDisputeEvent'
          balance.dispute_reversal: '#/components/schemas/BalanceDisputeReversalEvent'
          balance.order: '#/components/schemas/BalanceOrderEvent'
          balance.refund: '#/components/schemas/BalanceRefundEvent'
          balance.refund_reversal: '#/components/schemas/BalanceRefundReversalEvent'
          benefit.cycled: '#/components/schemas/BenefitCycledEvent'
          benefit.granted: '#/components/schemas/BenefitGrantedEvent'
          benefit.revoked: '#/components/schemas/BenefitRevokedEvent'
          benefit.updated: '#/components/schemas/BenefitUpdatedEvent'
          checkout.created: '#/components/schemas/CheckoutCreatedEvent'
          customer.created: '#/components/schemas/CustomerCreatedEvent'
          customer.deleted: '#/components/schemas/CustomerDeletedEvent'
          customer.updated: '#/components/schemas/CustomerUpdatedEvent'
          meter.credited: '#/components/schemas/MeterCreditEvent'
          meter.reset: '#/components/schemas/MeterResetEvent'
          order.paid: '#/components/schemas/OrderPaidEvent'
          order.refunded: '#/components/schemas/OrderRefundedEvent'
          order.voided: '#/components/schemas/OrderVoidedEvent'
          subscription.billing_period_updated: '#/components/schemas/SubscriptionBillingPeriodUpdatedEvent'
          subscription.canceled: '#/components/schemas/SubscriptionCanceledEvent'
          subscription.created: '#/components/schemas/SubscriptionCreatedEvent'
          subscription.cycled: '#/components/schemas/SubscriptionCycledEvent'
          subscription.past_due: '#/components/schemas/SubscriptionPastDueEvent'
          subscription.product_updated: '#/components/schemas/SubscriptionProductUpdatedEvent'
          subscription.reactivated: '#/components/schemas/SubscriptionReactivatedEvent'
          subscription.revoked: '#/components/schemas/SubscriptionRevokedEvent'
          subscription.seats_updated: '#/components/schemas/SubscriptionSeatsUpdatedEvent'
          subscription.uncanceled: '#/components/schemas/SubscriptionUncanceledEvent'
          subscription.update_cleared: '#/components/schemas/SubscriptionUpdateClearedEvent'
          subscription.updated: '#/components/schemas/SubscriptionUpdatedEvent'
    TaxBehavior:
      type: string
      enum:
        - inclusive
        - exclusive
      title: TaxBehavior
    TaxBehaviorOption:
      type: string
      enum:
        - location
        - inclusive
        - exclusive
      title: TaxBehaviorOption
    TaxIDFormat:
      type: string
      enum:
        - ad_nrt
        - ae_trn
        - ar_cuit
        - au_abn
        - au_arn
        - bg_uic
        - bh_vat
        - bo_tin
        - br_cnpj
        - br_cpf
        - ca_bn
        - ca_gst_hst
        - ca_pst_bc
        - ca_pst_mb
        - ca_pst_sk
        - ca_qst
        - ch_uid
        - ch_vat
        - cl_tin
        - cn_tin
        - co_nit
        - cr_tin
        - de_stn
        - do_rcn
        - ec_ruc
        - eg_tin
        - es_cif
        - eu_oss_vat
        - eu_vat
        - gb_vat
        - ge_vat
        - hk_br
        - hr_oib
        - hu_tin
        - id_npwp
        - il_vat
        - in_gst
        - is_vat
        - jp_cn
        - jp_rn
        - jp_trn
        - ke_pin
        - kr_brn
        - kz_bin
        - li_uid
        - mk_vat
        - mx_rfc
        - my_frp
        - my_itn
        - my_sst
        - ng_tin
        - no_vat
        - no_voec
        - nz_gst
        - om_vat
        - pe_ruc
        - ph_tin
        - ro_tin
        - rs_pib
        - ru_inn
        - ru_kpp
        - sa_vat
        - sg_gst
        - sg_uen
        - si_tin
        - sv_nit
        - th_vat
        - tr_tin
        - tw_vat
        - ua_vat
        - us_ein
        - uy_ruc
        - ve_rif
        - vn_tin
        - za_vat
      title: TaxIDFormat
      description: |-
        List of supported tax ID formats.

        Ref: https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id
    TimeInterval:
      type: string
      enum:
        - year
        - month
        - week
        - day
        - hour
      title: TimeInterval
    TokenResponse:
      properties:
        access_token:
          type: string
          title: Access Token
        token_type:
          type: string
          const: Bearer
          title: Token Type
        expires_in:
          type: integer
          title: Expires In
        refresh_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Refresh Token
        scope:
          type: string
          title: Scope
        id_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Id Token
      type: object
      required:
        - access_token
        - token_type
        - expires_in
        - scope
      title: TokenResponse
    TrialAlreadyRedeemed:
      properties:
        error:
          type: string
          const: TrialAlreadyRedeemed
          title: Error
          examples:
            - TrialAlreadyRedeemed
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: TrialAlreadyRedeemed
    TrialInterval:
      type: string
      enum:
        - day
        - week
        - month
        - year
      title: TrialInterval
    Unauthorized:
      properties:
        error:
          type: string
          const: Unauthorized
          title: Error
          examples:
            - Unauthorized
        detail:
          type: string
          title: Detail
      type: object
      required:
        - error
        - detail
      title: Unauthorized
    UniqueAggregation:
      properties:
        func:
          type: string
          const: unique
          title: Func
          default: unique
        property:
          type: string
          title: Property
      type: object
      required:
        - property
      title: UniqueAggregation
    UserEvent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the event.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The ID of the organization owning the event.
          examples:
            - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
          x-polar-selector-widget:
            displayProperty: name
            resourceName: Organization
            resourceRoot: /v1/organizations
        customer_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Customer Id
          description: >-
            ID of the customer in your Polar organization associated with the
            event.
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
          description: The customer associated with the event.
        external_customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Customer Id
          description: ID of the customer in your system associated with the event.
        member_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Member Id
          description: >-
            ID of the member within the customer's organization who performed
            the action inside B2B.
        external_member_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Member Id
          description: >-
            ID of the member in your system within the customer's organization
            who performed the action inside B2B.
        child_count:
          type: integer
          title: Child Count
          description: Number of direct child events linked to this event.
          default: 0
        parent_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Parent Id
          description: The ID of the parent event.
        label:
          type: string
          title: Label
          description: Human readable label of the event type.
        name:
          type: string
          title: Name
          description: The name of the event.
        source:
          type: string
          const: user
          title: Source
          description: >-
            The source of the event. `system` events are created by Polar.
            `user` events are the one you create through our ingestion API.
        metadata:
          $ref: '#/components/schemas/EventMetadataOutput'
      type: object
      required:
        - id
        - timestamp
        - organization_id
        - customer_id
        - customer
        - external_customer_id
        - label
        - name
        - source
        - metadata
      title: UserEvent
      description: An event you created through the ingestion API.
    UserInfoOrganization:
      properties:
        sub:
          type: string
          title: Sub
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - sub
      title: UserInfoOrganization
    UserInfoUser:
      properties:
        sub:
          type: string
          title: Sub
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        email_verified:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Email Verified
      type: object
      required:
        - sub
      title: UserInfoUser
    ValidatedLicenseKey:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
          description: The ID of the object.
        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.
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
        customer_id:
          type: string
          format: uuid4
          title: Customer Id
        customer:
          $ref: '#/components/schemas/LicenseKeyCustomer'
        benefit_id:
          type: string
          format: uuid4
          title: Benefit Id
          description: The benefit ID.
          x-polar-selector-widget:
            displayProperty: description
            resourceName: Benefit
            resourceRoot: /v1/benefits
        key:
          type: string
          title: Key
        display_key:
          type: string
          title: Display Key
        status:
          $ref: '#/components/schemas/LicenseKeyStatus'
        limit_activations:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Activations
        usage:
          type: integer
          title: Usage
        limit_usage:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit Usage
        validations:
          type: integer
          title: Validations
        last_validated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Validated At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        activation:
          anyOf:
            - $ref: '#/components/schemas/LicenseKeyActivationBase'
            - type: 'null'
      type: object
      required:
        - id
        - created_at
        - modified_at
        - organization_id
        - customer_id
        - customer
        - benefit_id
        - key
        - display_key
        - status
        - limit_activations
        - usage
        - limit_usage
        - validations
        - last_validated_at
        - expires_at
      title: ValidatedLicenseKey
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Visibility:
      type: string
      enum:
        - draft
        - private
        - public
      title: Visibility
    WebhookBenefitCreatedPayload:
      properties:
        type:
          type: string
          const: benefit.created
          title: Type
          examples:
            - benefit.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Benefit'
          title: Benefit
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookBenefitCreatedPayload
      description: |-
        Sent when a new benefit is created.

        **Discord & Slack support:** Basic
    WebhookBenefitGrantCreatedPayload:
      properties:
        type:
          type: string
          const: benefit_grant.created
          title: Type
          examples:
            - benefit_grant.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/BenefitGrantWebhook'
          title: BenefitGrantWebhook
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookBenefitGrantCreatedPayload
      description: |-
        Sent when a new benefit grant is created.

        **Discord & Slack support:** Basic
    WebhookBenefitGrantCycledPayload:
      properties:
        type:
          type: string
          const: benefit_grant.cycled
          title: Type
          examples:
            - benefit_grant.cycled
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/BenefitGrantWebhook'
          title: BenefitGrantWebhook
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookBenefitGrantCycledPayload
      description: |-
        Sent when a benefit grant is cycled,
        meaning the related subscription has been renewed for another period.

        **Discord & Slack support:** Basic
    WebhookBenefitGrantRevokedPayload:
      properties:
        type:
          type: string
          const: benefit_grant.revoked
          title: Type
          examples:
            - benefit_grant.revoked
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/BenefitGrantWebhook'
          title: BenefitGrantWebhook
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookBenefitGrantRevokedPayload
      description: |-
        Sent when a benefit grant is revoked.

        **Discord & Slack support:** Basic
    WebhookBenefitGrantUpdatedPayload:
      properties:
        type:
          type: string
          const: benefit_grant.updated
          title: Type
          examples:
            - benefit_grant.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/BenefitGrantWebhook'
          title: BenefitGrantWebhook
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookBenefitGrantUpdatedPayload
      description: |-
        Sent when a benefit grant is updated.

        **Discord & Slack support:** Basic
    WebhookBenefitUpdatedPayload:
      properties:
        type:
          type: string
          const: benefit.updated
          title: Type
          examples:
            - benefit.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Benefit'
          title: Benefit
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookBenefitUpdatedPayload
      description: |-
        Sent when a benefit is updated.

        **Discord & Slack support:** Basic
    WebhookCheckoutCreatedPayload:
      properties:
        type:
          type: string
          const: checkout.created
          title: Type
          examples:
            - checkout.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Checkout'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCheckoutCreatedPayload
      description: |-
        Sent when a new checkout is created.

        **Discord & Slack support:** Basic
    WebhookCheckoutExpiredPayload:
      properties:
        type:
          type: string
          const: checkout.expired
          title: Type
          examples:
            - checkout.expired
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Checkout'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCheckoutExpiredPayload
      description: >-
        Sent when a checkout expires.


        This event fires when a checkout reaches its expiration time without
        being completed.

        Developers can use this to send reminder emails or track checkout
        abandonment.


        **Discord & Slack support:** Basic
    WebhookCheckoutUpdatedPayload:
      properties:
        type:
          type: string
          const: checkout.updated
          title: Type
          examples:
            - checkout.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Checkout'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCheckoutUpdatedPayload
      description: |-
        Sent when a checkout is updated.

        **Discord & Slack support:** Basic
    WebhookCustomerCreatedPayload:
      properties:
        type:
          type: string
          const: customer.created
          title: Type
          examples:
            - customer.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Customer'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerCreatedPayload
      description: |-
        Sent when a new customer is created.

        A customer can be created:

        * After a successful checkout.
        * Programmatically via the API.

        **Discord & Slack support:** Basic
    WebhookCustomerDeletedPayload:
      properties:
        type:
          type: string
          const: customer.deleted
          title: Type
          examples:
            - customer.deleted
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Customer'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerDeletedPayload
      description: |-
        Sent when a customer is deleted.

        **Discord & Slack support:** Basic
    WebhookCustomerSeatAssignedPayload:
      properties:
        type:
          type: string
          const: customer_seat.assigned
          title: Type
          examples:
            - customer_seat.assigned
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/CustomerSeat'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerSeatAssignedPayload
      description: >-
        Sent when a new customer seat is assigned.


        This event is triggered when a seat is assigned to a customer by the
        organization.

        The customer will receive an invitation email to claim the seat.
    WebhookCustomerSeatClaimedPayload:
      properties:
        type:
          type: string
          const: customer_seat.claimed
          title: Type
          examples:
            - customer_seat.claimed
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/CustomerSeat'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerSeatClaimedPayload
      description: >-
        Sent when a customer seat is claimed.


        This event is triggered when a customer accepts the seat invitation and
        claims their access.
    WebhookCustomerSeatRevokedPayload:
      properties:
        type:
          type: string
          const: customer_seat.revoked
          title: Type
          examples:
            - customer_seat.revoked
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/CustomerSeat'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerSeatRevokedPayload
      description: >-
        Sent when a customer seat is revoked.


        This event is triggered when access to a seat is revoked, either
        manually by the organization or automatically when a subscription is
        canceled.
    WebhookCustomerStateChangedPayload:
      properties:
        type:
          type: string
          const: customer.state_changed
          title: Type
          examples:
            - customer.state_changed
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/CustomerState'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerStateChangedPayload
      description: |-
        Sent when a customer state has changed.

        It's triggered when:

        * Customer is created, updated or deleted.
        * A subscription is created or updated.
        * A benefit is granted or revoked.

        **Discord & Slack support:** Basic
    WebhookCustomerUpdatedPayload:
      properties:
        type:
          type: string
          const: customer.updated
          title: Type
          examples:
            - customer.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Customer'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookCustomerUpdatedPayload
      description: >-
        Sent when a customer is updated.


        This event is fired when the customer details are updated.


        If you want to be notified when a customer subscription or benefit state
        changes, you should listen to the `customer_state_changed` event.


        **Discord & Slack support:** Basic
    WebhookDelivery:
      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 object.
        succeeded:
          type: boolean
          title: Succeeded
          description: Whether the delivery was successful.
        http_code:
          anyOf:
            - type: integer
            - type: 'null'
          title: Http Code
          description: >-
            The HTTP code returned by the URL. `null` if the endpoint was
            unreachable.
        response:
          anyOf:
            - type: string
            - type: 'null'
          title: Response
          description: >-
            The response body returned by the URL, or the error message if the
            endpoint was unreachable.
        webhook_event:
          $ref: '#/components/schemas/WebhookEvent'
          description: The webhook event sent by this delivery.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - succeeded
        - http_code
        - response
        - webhook_event
      title: WebhookDelivery
      description: A webhook delivery for a webhook event.
    WebhookEndpoint:
      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 object.
        url:
          type: string
          title: Url
          description: The URL where the webhook events will be sent.
          examples:
            - https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            An optional name for the webhook endpoint to help organize and
            identify it.
        format:
          $ref: '#/components/schemas/WebhookFormat'
          description: The format of the webhook payload.
        secret:
          type: string
          title: Secret
          description: The secret used to sign the webhook events.
          examples:
            - polar_whs_ovyN6cPrTv56AApvzCaJno08SSmGJmgbWilb33N2JuK
        organization_id:
          type: string
          format: uuid4
          title: Organization Id
          description: The organization ID associated with the webhook endpoint.
        events:
          items:
            $ref: '#/components/schemas/WebhookEventType'
          type: array
          title: Events
          description: The events that will trigger the webhook.
        enabled:
          type: boolean
          title: Enabled
          description: Whether the webhook endpoint is enabled and will receive events.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - url
        - format
        - secret
        - organization_id
        - events
        - enabled
      title: WebhookEndpoint
      description: A webhook endpoint.
    WebhookEndpointCreate:
      properties:
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: The URL where the webhook events will be sent.
          examples:
            - https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            An optional name for the webhook endpoint to help organize and
            identify it.
        format:
          $ref: '#/components/schemas/WebhookFormat'
          description: The format of the webhook payload.
        events:
          items:
            $ref: '#/components/schemas/WebhookEventType'
          type: array
          title: Events
          description: The events that will trigger the webhook.
        organization_id:
          anyOf:
            - type: string
              format: uuid4
              description: The organization ID.
              examples:
                - 1dbfc517-0bbf-4301-9ba8-555ca42b9737
              x-polar-selector-widget:
                displayProperty: name
                resourceName: Organization
                resourceRoot: /v1/organizations
            - type: 'null'
          title: Organization Id
          description: >-
            The organization ID associated with the webhook endpoint. **Required
            unless you use an organization token.**
      type: object
      required:
        - url
        - format
        - events
      title: WebhookEndpointCreate
      description: Schema to create a webhook endpoint.
    WebhookEndpointUpdate:
      properties:
        url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
              description: The URL where the webhook events will be sent.
              examples:
                - https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0
            - type: 'null'
          title: Url
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            An optional name for the webhook endpoint to help organize and
            identify it.
        format:
          anyOf:
            - $ref: '#/components/schemas/WebhookFormat'
              description: The format of the webhook payload.
            - type: 'null'
        events:
          anyOf:
            - items:
                $ref: '#/components/schemas/WebhookEventType'
              type: array
              description: The events that will trigger the webhook.
            - type: 'null'
          title: Events
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
          description: Whether the webhook endpoint is enabled.
      type: object
      title: WebhookEndpointUpdate
      description: Schema to update a webhook endpoint.
    WebhookEvent:
      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 object.
        last_http_code:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Http Code
          description: >-
            Last HTTP code returned by the URL. `null` if no delviery has been
            attempted or if the endpoint was unreachable.
        succeeded:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Succeeded
          description: >-
            Whether this event was successfully delivered. `null` if no delivery
            has been attempted.
        skipped:
          type: boolean
          title: Skipped
          description: >-
            Whether this event was skipped because the webhook endpoint was
            disabled.
        payload:
          anyOf:
            - type: string
            - type: 'null'
          title: Payload
          description: The payload of the webhook event.
        type:
          $ref: '#/components/schemas/WebhookEventType'
          description: The type of the webhook event.
        is_archived:
          type: boolean
          title: Is Archived
          description: >-
            Whether this event is archived. Archived events can't be
            redelivered, and the payload is not accessible anymore.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - skipped
        - payload
        - type
        - is_archived
      title: WebhookEvent
      description: |-
        A webhook event.

        An event represent something that happened in the system
        that should be sent to the webhook endpoint.

        It can be delivered multiple times until it's marked as succeeded,
        each one creating a new delivery.
    WebhookEventType:
      type: string
      enum:
        - checkout.created
        - checkout.updated
        - checkout.expired
        - customer.created
        - customer.updated
        - customer.deleted
        - customer.state_changed
        - customer_seat.assigned
        - customer_seat.claimed
        - customer_seat.revoked
        - member.created
        - member.updated
        - member.deleted
        - order.created
        - order.updated
        - order.paid
        - order.refunded
        - subscription.created
        - subscription.updated
        - subscription.active
        - subscription.canceled
        - subscription.uncanceled
        - subscription.revoked
        - subscription.past_due
        - refund.created
        - refund.updated
        - product.created
        - product.updated
        - benefit.created
        - benefit.updated
        - benefit_grant.created
        - benefit_grant.cycled
        - benefit_grant.updated
        - benefit_grant.revoked
        - organization.updated
      title: WebhookEventType
    WebhookFormat:
      type: string
      enum:
        - raw
        - discord
        - slack
      title: WebhookFormat
    WebhookMemberCreatedPayload:
      properties:
        type:
          type: string
          const: member.created
          title: Type
          examples:
            - member.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Member'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookMemberCreatedPayload
      description: |-
        Sent when a new member is created.

        A member represents an individual within a customer (team).
        This event is triggered when a member is added to a customer,
        either programmatically via the API or when an owner is automatically
        created for a new customer.

        **Discord & Slack support:** Basic
    WebhookMemberDeletedPayload:
      properties:
        type:
          type: string
          const: member.deleted
          title: Type
          examples:
            - member.deleted
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Member'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookMemberDeletedPayload
      description: |-
        Sent when a member is deleted.

        This event is triggered when a member is removed from a customer.
        Any active seats assigned to the member will be automatically revoked.

        **Discord & Slack support:** Basic
    WebhookMemberUpdatedPayload:
      properties:
        type:
          type: string
          const: member.updated
          title: Type
          examples:
            - member.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Member'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookMemberUpdatedPayload
      description: |-
        Sent when a member is updated.

        This event is triggered when member details are updated,
        such as their name or role within the customer.

        **Discord & Slack support:** Basic
    WebhookOrderCreatedPayload:
      properties:
        type:
          type: string
          const: order.created
          title: Type
          examples:
            - order.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Order'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookOrderCreatedPayload
      description: >-
        Sent when a new order is created.


        A new order is created when:


        * A customer purchases a one-time product. In this case,
        `billing_reason` is set to `purchase`.

        * A customer starts a subscription. In this case, `billing_reason` is
        set to `subscription_create`.

        * A subscription is renewed. In this case, `billing_reason` is set to
        `subscription_cycle`.

        * A subscription is upgraded or downgraded with an immediate proration
        invoice. In this case, `billing_reason` is set to `subscription_update`.


        > [!WARNING]

        > The order might not be paid yet, so the `status` field might be
        `pending`.


        **Discord & Slack support:** Full
    WebhookOrderPaidPayload:
      properties:
        type:
          type: string
          const: order.paid
          title: Type
          examples:
            - order.paid
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Order'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookOrderPaidPayload
      description: >-
        Sent when an order is paid.


        When you receive this event, the order is fully processed and payment
        has been received.


        **Discord & Slack support:** Full
    WebhookOrderRefundedPayload:
      properties:
        type:
          type: string
          const: order.refunded
          title: Type
          examples:
            - order.refunded
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Order'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookOrderRefundedPayload
      description: |-
        Sent when an order is fully or partially refunded.

        **Discord & Slack support:** Full
    WebhookOrderUpdatedPayload:
      properties:
        type:
          type: string
          const: order.updated
          title: Type
          examples:
            - order.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Order'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookOrderUpdatedPayload
      description: |-
        Sent when an order is updated.

        An order is updated when:

        * Its status changes, e.g. from `pending` to `paid`.
        * It's refunded, partially or fully.

        **Discord & Slack support:** Full
    WebhookOrganizationUpdatedPayload:
      properties:
        type:
          type: string
          const: organization.updated
          title: Type
          examples:
            - organization.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Organization'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookOrganizationUpdatedPayload
      description: |-
        Sent when a organization is updated.

        **Discord & Slack support:** Basic
    WebhookProductCreatedPayload:
      properties:
        type:
          type: string
          const: product.created
          title: Type
          examples:
            - product.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Product'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookProductCreatedPayload
      description: |-
        Sent when a new product is created.

        **Discord & Slack support:** Basic
    WebhookProductUpdatedPayload:
      properties:
        type:
          type: string
          const: product.updated
          title: Type
          examples:
            - product.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Product'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookProductUpdatedPayload
      description: |-
        Sent when a product is updated.

        **Discord & Slack support:** Basic
    WebhookRefundCreatedPayload:
      properties:
        type:
          type: string
          const: refund.created
          title: Type
          examples:
            - refund.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Refund'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookRefundCreatedPayload
      description: |-
        Sent when a refund is created regardless of status.

        **Discord & Slack support:** Full
    WebhookRefundUpdatedPayload:
      properties:
        type:
          type: string
          const: refund.updated
          title: Type
          examples:
            - refund.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Refund'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookRefundUpdatedPayload
      description: |-
        Sent when a refund is updated.

        **Discord & Slack support:** Full
    WebhookSubscriptionActivePayload:
      properties:
        type:
          type: string
          const: subscription.active
          title: Type
          examples:
            - subscription.active
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionActivePayload
      description: >-
        Sent when a subscription becomes active,

        whether because it's a new paid subscription or because payment was
        recovered.


        **Discord & Slack support:** Full
    WebhookSubscriptionCanceledPayload:
      properties:
        type:
          type: string
          const: subscription.canceled
          title: Type
          examples:
            - subscription.canceled
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionCanceledPayload
      description: |-
        Sent when a subscription is canceled.
        Customers might still have access until the end of the current period.

        **Discord & Slack support:** Full
    WebhookSubscriptionCreatedPayload:
      properties:
        type:
          type: string
          const: subscription.created
          title: Type
          examples:
            - subscription.created
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionCreatedPayload
      description: >-
        Sent when a new subscription is created.


        When this event occurs, the subscription `status` might not be `active`
        yet, as we can still have to wait for the first payment to be processed.


        **Discord & Slack support:** Full
    WebhookSubscriptionPastDuePayload:
      properties:
        type:
          type: string
          const: subscription.past_due
          title: Type
          examples:
            - subscription.past_due
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionPastDuePayload
      description: >-
        Sent when a subscription payment fails and the subscription enters
        `past_due` status.


        This is a recoverable state - the customer can update their payment
        method to restore the subscription.

        Benefits may be revoked depending on the organization's grace period
        settings.


        If payment retries are exhausted, a `subscription.revoked` event will be
        sent.


        **Discord & Slack support:** Full
    WebhookSubscriptionRevokedPayload:
      properties:
        type:
          type: string
          const: subscription.revoked
          title: Type
          examples:
            - subscription.revoked
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionRevokedPayload
      description: >-
        Sent when a subscription is revoked and the user loses access
        immediately.

        Happens when the subscription is canceled or payment retries are
        exhausted (status becomes `unpaid`).


        For payment failures that can still be recovered, see
        `subscription.past_due`.


        **Discord & Slack support:** Full
    WebhookSubscriptionUncanceledPayload:
      properties:
        type:
          type: string
          const: subscription.uncanceled
          title: Type
          examples:
            - subscription.uncanceled
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionUncanceledPayload
      description: >-
        Sent when a customer revokes a pending cancellation.


        When a customer cancels with "at period end", they retain access until
        the

        subscription would renew. During this time, they can change their mind
        and

        undo the cancellation. This event is triggered when they do so.


        **Discord & Slack support:** Full
    WebhookSubscriptionUpdatedPayload:
      properties:
        type:
          type: string
          const: subscription.updated
          title: Type
          examples:
            - subscription.updated
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        data:
          $ref: '#/components/schemas/Subscription'
      type: object
      required:
        - type
        - timestamp
        - data
      title: WebhookSubscriptionUpdatedPayload
      description: >-
        Sent when a subscription is updated. This event fires for all changes to
        the subscription, including renewals.


        If you want more specific events, you can listen to
        `subscription.active`, `subscription.canceled`, `subscription.past_due`,
        and `subscription.revoked`.


        To listen specifically for renewals, you can listen to `order.created`
        events and check the `billing_reason` field.


        **Discord & Slack support:** On cancellation, past due, and revocation.
        Renewals are skipped.
    MetadataQuery:
      anyOf:
        - type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: array
                items:
                  type: string
              - type: array
                items:
                  type: integer
              - type: array
                items:
                  type: boolean
        - type: 'null'
      title: MetadataQuery
    AuthorizationCodeTokenRequest:
      properties:
        grant_type:
          const: authorization_code
          title: Grant Type
          type: string
        client_id:
          title: Client Id
          type: string
        client_secret:
          title: Client Secret
          type: string
        code:
          title: Code
          type: string
        redirect_uri:
          format: uri
          maxLength: 2083
          minLength: 1
          title: Redirect Uri
          type: string
      required:
        - grant_type
        - client_id
        - client_secret
        - code
        - redirect_uri
      title: AuthorizationCodeTokenRequest
      type: object
    RefreshTokenRequest:
      properties:
        grant_type:
          const: refresh_token
          title: Grant Type
          type: string
        client_id:
          title: Client Id
          type: string
        client_secret:
          title: Client Secret
          type: string
        refresh_token:
          title: Refresh Token
          type: string
      required:
        - grant_type
        - client_id
        - client_secret
        - refresh_token
      title: RefreshTokenRequest
      type: object
    WebTokenRequest:
      properties:
        grant_type:
          const: web
          title: Grant Type
          type: string
        client_id:
          title: Client Id
          type: string
        client_secret:
          title: Client Secret
          type: string
        session_token:
          title: Session Token
          type: string
        sub_type:
          default: user
          enum:
            - user
            - organization
          title: Sub Type
          type: string
        sub:
          anyOf:
            - format: uuid4
              type: string
            - type: 'null'
          default: null
          title: Sub
        scope:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Scope
      required:
        - grant_type
        - client_id
        - client_secret
        - session_token
      title: WebTokenRequest
      type: object
    RevokeTokenRequest:
      properties:
        token:
          title: Token
          type: string
        token_type_hint:
          anyOf:
            - enum:
                - access_token
                - refresh_token
              type: string
            - type: 'null'
          default: null
          title: Token Type Hint
        client_id:
          title: Client Id
          type: string
        client_secret:
          title: Client Secret
          type: string
      required:
        - token
        - client_id
        - client_secret
      title: RevokeTokenRequest
      type: object
    IntrospectTokenRequest:
      properties:
        token:
          title: Token
          type: string
        token_type_hint:
          anyOf:
            - enum:
                - access_token
                - refresh_token
              type: string
            - type: 'null'
          default: null
          title: Token Type Hint
        client_id:
          title: Client Id
          type: string
        client_secret:
          title: Client Secret
          type: string
      required:
        - token
        - client_id
        - client_secret
      title: IntrospectTokenRequest
      type: object
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: /.well-known/openid-configuration
    pat:
      type: http
      description: >-
        You can generate a **Personal Access Token** from your
        [settings](https://polar.sh/settings).
      scheme: bearer
    oat:
      type: http
      description: >-
        You can generate an **Organization Access Token** from your
        organization's settings.
      scheme: bearer
    customer_session:
      type: http
      description: >-
        Customer session tokens are specific tokens that are used to
        authenticate customers on your organization. You can create those
        sessions programmatically using the [Create Customer Session
        endpoint](/api-reference/customer-portal/sessions/create).
      scheme: bearer
    member_session:
      type: http
      description: >-
        Member session tokens are specific tokens that are used to authenticate
        members on your organization. You can create those sessions
        programmatically using the [Create Member Session
        endpoint](/api-reference/member-portal/sessions/create).
      scheme: bearer
    access_token:
      type: http
      scheme: bearer
      description: >-
        You can generate an **Organization Access Token** from your
        organization's settings.
tags:
  - name: public
    description: >-
      Endpoints shown and documented in the Polar API documentation and
      available in our SDKs.
  - name: private
    description: >-
      Endpoints that should appear in the schema only in development to generate
      our internal JS SDK.
  - name: mcp
    description: Endpoints enabled in the MCP server.
security:
  - access_token: []
