diff --git a/.github/scripts/generate_llms_files.py b/.github/scripts/generate_llms_files.py new file mode 100644 index 00000000..863454fa --- /dev/null +++ b/.github/scripts/generate_llms_files.py @@ -0,0 +1,158 @@ +import argparse +import os +import toml +from pathlib import Path +from urllib.parse import urljoin +import re +from typing import List, Optional, Tuple + + +def _construct_url(base_url: Optional[str], relative_path: str) -> str: + """Constructs an absolute URL if base_url is provided, otherwise returns relative_path.""" + if not base_url: + # If no base URL, return the relative path as is (or adjust if needed based on output location) + # Assuming output is at repo root, the relative path from repo root is correct. + return relative_path + + # Ensure base_url ends with a slash for urljoin + temp_base_url = base_url + if not temp_base_url.endswith('/'): + temp_base_url += '/' + + # urljoin handles joining base and relative path correctly + # It correctly handles paths starting with '/' or not. + return urljoin(temp_base_url, relative_path) + +def find_md_files(directory: Path) -> List[Path]: + """Recursively finds all Markdown files in a directory.""" + return list(Path(directory).rglob('*.md')) + +def get_project_metadata(repo_root: Path) -> Tuple[str, str]: + """Reads project metadata from pyproject.toml.""" + pyproject_path = Path(repo_root) / 'pyproject.toml' + if not pyproject_path.exists(): + print(f"Warning: pyproject.toml not found at {pyproject_path}") + return "Unknown Project", "No description found." + + try: + data = toml.load(pyproject_path) + name = data.get('tool', {}).get('poetry', {}).get('name', 'Polar') + description = data.get('tool', {}).get('poetry', {}).get('description', 'Polar SDK Python') + return name, description + except Exception as e: + print(f"Error reading pyproject.toml: {e}") + return "Unknown Project", "Error reading description." + +def generate_llms_txt(project_name: str, description: str, md_files: List[Path], repo_root: Path, docs_dir_path: Path, base_url: Optional[str] = None) -> str: + """Generates the llms.txt file content.""" + content = f"# {project_name}\n\n" + content += f"> {description}\n\n" + + # Create dynamic header from the scanned directory name + dir_name = docs_dir_path.name.replace('_', ' ').replace('-', ' ').title() + content += f"## {dir_name} Files\n\n" + + if not md_files: + content += "- No Markdown documentation files found.\n" + else: + for md_path in sorted(md_files): + # Relative path from repo root is needed for URL construction or relative link + relative_path = md_path.relative_to(repo_root).as_posix() + # Use the capitalized parent directory name as the link title + link_title = md_path.parent.name.capitalize() + + # Use the helper function to construct the URL + link_url = _construct_url(base_url, relative_path) + + content += f"- [{link_title}]({link_url})\n" + + content += "\n## Optional\n" + # Construct the link for llms-full.txt using the helper function + extended_context_link = _construct_url(base_url, "llms-full.txt") + + content += f"- [Extended Context]({extended_context_link})\n" + + return content + +def generate_llms_full_txt(llms_txt_content: str, md_files: List[Path], repo_root: Path, base_url: Optional[str] = None) -> str: + """Generates the llms-full.txt file content, adjusting heading levels and adding raw links.""" + full_content = llms_txt_content + full_content += "\n\n---\n\n# Full Content Details\n\n" + + if not md_files: + full_content += "No Markdown documentation files found to include.\n" + else: + for md_path in sorted(md_files): + relative_path = md_path.relative_to(repo_root) + relative_path_posix = relative_path.as_posix() + + # Construct the link URL using the helper function + link_url = _construct_url(base_url, relative_path_posix) + + # Determine the header link based on whether a URL was constructed + header_link = f"[{relative_path_posix}]({link_url})" if base_url else relative_path_posix + + try: + file_content = md_path.read_text(encoding='utf-8') + # Adjust heading levels: Add two '#' to each heading line (H1->H3, H2->H4, etc.) + adjusted_content = re.sub(r'^(#+ )', r'##\1', file_content, flags=re.MULTILINE) + + full_content += f"## Content: {header_link}\n\n" + full_content += adjusted_content + full_content += "\n\n---\n\n" + except Exception as e: + full_content += f"## Content: {header_link}\n\n" # Still add link even if read fails + full_content += f"Error reading file: {e}\n\n---\n\n" + + return full_content + +def main() -> None: + parser = argparse.ArgumentParser(description='Generate llms.txt and llms-full.txt for a project.') + parser.add_argument('--dir', required=True, help='Directory to scan for Markdown files (e.g., docs).') + parser.add_argument('--output', default='.', help='Output directory for llms.txt and llms-full.txt.') + parser.add_argument('--repo-root', default='.', help='Path to the repository root.') + parser.add_argument('--base-url', default=None, help='Optional base URL for constructing absolute links (e.g., GitHub raw URL).') + + args = parser.parse_args() + + docs_dir_path = Path(args.repo_root) / args.dir + output_dir_path = Path(args.output) + repo_root_path = Path(args.repo_root) + + if not docs_dir_path.is_dir(): + print(f"Error: Documentation directory not found: {docs_dir_path}") + return + + output_dir_path.mkdir(parents=True, exist_ok=True) + + project_name, description = get_project_metadata(repo_root_path) + md_files = find_md_files(docs_dir_path) + + # Ensure paths in md_files are relative to repo_root for consistency + md_files_relative_to_root = [f.relative_to(repo_root_path) for f in md_files] + # Get absolute paths again for reading/linking + md_files_abs = [repo_root_path / f for f in md_files_relative_to_root] + + # --- Generate llms.txt --- + print(f"Generating llms.txt in {output_dir_path}...") + llms_txt_content = generate_llms_txt(project_name, description, md_files_abs, repo_root_path, docs_dir_path, args.base_url) + llms_txt_file = output_dir_path / 'llms.txt' + try: + llms_txt_file.write_text(llms_txt_content, encoding='utf-8') + print(f"Successfully wrote {llms_txt_file}") + except Exception as e: + print(f"Error writing {llms_txt_file}: {e}") + + # --- Generate llms-full.txt --- + print(f"Generating llms-full.txt in {output_dir_path}...") + # Pass the *generated* content of llms.txt, md_files, repo_root, and base_url + llms_full_content = generate_llms_full_txt(llms_txt_content, md_files_abs, repo_root_path, args.base_url) + llms_full_txt_file = output_dir_path / 'llms-full.txt' + try: + llms_full_txt_file.write_text(llms_full_content, encoding='utf-8') + print(f"Successfully wrote {llms_full_txt_file}") + except Exception as e: + print(f"Error writing {llms_full_txt_file}: {e}") + +if __name__ == "__main__": + main() diff --git a/.github/workflows/generate-llms-txt.yml b/.github/workflows/generate-llms-txt.yml new file mode 100644 index 00000000..645967d2 --- /dev/null +++ b/.github/workflows/generate-llms-txt.yml @@ -0,0 +1,56 @@ +name: Generate llms.txt and llms-full.txt + +on: + push: + branches: + - main + - feature/llm-txt # testing purpose + paths: + - 'docs/sdks/**' # Trigger only if files in docs/ change + - '.github/scripts/generate_llms_files.py' # Also trigger if the script itself changes + - 'pyproject.toml' # Also trigger if project metadata changes + - '.github/workflows/generate-llms-txt.yml' # Also trigger if the workflow changes + workflow_dispatch: # Allows manual triggering + +jobs: + generate: + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the changed files. + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' # Choose a version that includes toml or install it + + - name: Install dependencies + run: pip install toml + + - name: Run script to generate llms files + env: + # Construct the base URL for raw file links using the branch/tag name + RAW_BASE_URL: "https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ github.event.repository.name}}/${{ github.ref_name }}/" + run: | + echo "Base URL: $RAW_BASE_URL" + python .github/scripts/generate_llms_files.py \ + --dir docs/sdks \ + --output . \ + --repo-root . \ + --base-url "$RAW_BASE_URL" + # Explanation: + # --dir docs: Scan the 'docs/sdks' directory for *.md files. + # --output .: Place the generated llms.txt/llms-full.txt in the repo root. + # --repo-root .: Use the current checkout directory as the repo root for path calculations. + + - name: Commit and push if files changed + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "chore: Auto-generate llms.txt and llms-full.txt" + file_pattern: "llms.txt llms-full.txt" # Only commit these specific files if they change + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + commit_author: "github-actions[bot] " diff --git a/llms-full.txt b/llms-full.txt new file mode 100644 index 00000000..c12d0a87 --- /dev/null +++ b/llms-full.txt @@ -0,0 +1,5785 @@ +# Polar + +> Polar SDK Python + +## Sdks Files + +- [Benefitgrants](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/benefitgrants/README.md) +- [Benefits](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/benefits/README.md) +- [Checkoutlinks](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/checkoutlinks/README.md) +- [Checkouts](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/checkouts/README.md) +- [Clients](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/clients/README.md) +- [Customermeters](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customermeters/README.md) +- [Customerportal](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customerportal/README.md) +- [Customers](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customers/README.md) +- [Customersessions](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customersessions/README.md) +- [Customfields](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customfields/README.md) +- [Discounts](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/discounts/README.md) +- [Downloadables](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/downloadables/README.md) +- [Events](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/events/README.md) +- [Files](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/files/README.md) +- [Licensekeys](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/licensekeys/README.md) +- [Meters](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/meters/README.md) +- [Metricssdk](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/metricssdk/README.md) +- [Oauth2](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/oauth2/README.md) +- [Orders](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/orders/README.md) +- [Organizations](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/organizations/README.md) +- [Polar](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polar/README.md) +- [Polarcustomermeters](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarcustomermeters/README.md) +- [Polarcustomers](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarcustomers/README.md) +- [Polarlicensekeys](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarlicensekeys/README.md) +- [Polarorders](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarorders/README.md) +- [Polarorganizations](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarorganizations/README.md) +- [Polarsubscriptions](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarsubscriptions/README.md) +- [Products](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/products/README.md) +- [Refunds](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/refunds/README.md) +- [Subscriptions](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/subscriptions/README.md) + +## Optional +- [Extended Context](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/llms-full.txt) + + +--- + +# Full Content Details + +## Content: [docs/sdks/benefitgrants/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/benefitgrants/README.md) + +### BenefitGrants +(*customer_portal.benefit_grants*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Benefit Grants +* [get](#get) - Get Benefit Grant +* [update](#update) - Update Benefit Grant + +#### list + +List benefits grants of the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.benefit_grants.list(security=polar_sdk.CustomerPortalBenefitGrantsListSecurity( + customer_session="", + ), organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalBenefitGrantsListSecurity](../../models/customerportalbenefitgrantslistsecurity.md) | :heavy_check_mark: | N/A | +| `type_filter` | [OptionalNullable[models.QueryParamBenefitTypeFilter]](../../models/queryparambenefittypefilter.md) | :heavy_minus_sign: | Filter by benefit type. | +| `benefit_id` | [OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter]](../../models/customerportalbenefitgrantslistqueryparambenefitidfilter.md) | :heavy_minus_sign: | Filter by benefit ID. | +| `organization_id` | [OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter]](../../models/customerportalbenefitgrantslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `checkout_id` | [OptionalNullable[models.QueryParamCheckoutIDFilter]](../../models/queryparamcheckoutidfilter.md) | :heavy_minus_sign: | Filter by checkout ID. | +| `order_id` | [OptionalNullable[models.QueryParamOrderIDFilter]](../../models/queryparamorderidfilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `subscription_id` | [OptionalNullable[models.QueryParamSubscriptionIDFilter]](../../models/queryparamsubscriptionidfilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomerBenefitGrantSortProperty](../../models/customerbenefitgrantsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalBenefitGrantsListResponse](../../models/customerportalbenefitgrantslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a benefit grant by ID for the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.benefit_grants.get(security=polar_sdk.CustomerPortalBenefitGrantsGetSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalBenefitGrantsGetSecurity](../../models/customerportalbenefitgrantsgetsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The benefit grant ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerBenefitGrant](../../models/customerbenefitgrant.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a benefit grant for the authenticated customer. + +**Scopes**: `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.benefit_grants.update(security=polar_sdk.CustomerPortalBenefitGrantsUpdateSecurity( + customer_session="", + ), id="", customer_benefit_grant_update={ + "benefit_type": "meter_credit", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalBenefitGrantsUpdateSecurity](../../models/customerportalbenefitgrantsupdatesecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The benefit grant ID. | +| `customer_benefit_grant_update` | [models.CustomerBenefitGrantUpdate](../../models/customerbenefitgrantupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerBenefitGrant](../../models/customerbenefitgrant.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/benefits/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/benefits/README.md) + +### Benefits +(*benefits*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Benefits +* [create](#create) - Create Benefit +* [get](#get) - Get Benefit +* [update](#update) - Update Benefit +* [delete](#delete) - Delete Benefit +* [grants](#grants) - List Benefit Grants + +#### list + +List benefits. + +**Scopes**: `benefits:read` `benefits:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.benefits.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.QueryParamOrganizationIDFilter]](../../models/queryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `type_filter` | [OptionalNullable[models.BenefitTypeFilter]](../../models/benefittypefilter.md) | :heavy_minus_sign: | Filter by benefit type. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by description. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.BenefitSortProperty](../../models/benefitsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.BenefitsListResponse](../../models/benefitslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a benefit. + +**Scopes**: `benefits:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.benefits.create(request={ + "type": "downloadables", + "description": "delightfully fumigate convection though zowie up bulky electronics", + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "properties": { + "files": [ + "", + ], + }, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.BenefitCreate](../../models/benefitcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Benefit](../../models/benefit.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a benefit by ID. + +**Scopes**: `benefits:read` `benefits:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.benefits.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Benefit](../../models/benefit.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a benefit. + +**Scopes**: `benefits:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.benefits.update(id="", request_body={ + "type": "meter_credit", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `request_body` | [models.BenefitsUpdateBenefitUpdate](../../models/benefitsupdatebenefitupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Benefit](../../models/benefit.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +Delete a benefit. + +> [!WARNING] +> Every grants associated with the benefit will be revoked. +> Users will lose access to the benefit. + +**Scopes**: `benefits:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.benefits.delete(id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### grants + +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` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.benefits.grants(id="") + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `is_granted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned. | +| `customer_id` | [OptionalNullable[models.QueryParamCustomerIDFilter]](../../models/queryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.BenefitsGrantsResponse](../../models/benefitsgrantsresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/checkoutlinks/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/checkoutlinks/README.md) + +### CheckoutLinks +(*checkout_links*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Checkout Links +* [create](#create) - Create Checkout Link +* [get](#get) - Get Checkout Link +* [update](#update) - Update Checkout Link +* [delete](#delete) - Delete Checkout Link + +#### list + +List checkout links. + +**Scopes**: `checkout_links:read` `checkout_links:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkout_links.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.CheckoutLinksListQueryParamOrganizationIDFilter]](../../models/checkoutlinkslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.CheckoutLinksListQueryParamProductIDFilter]](../../models/checkoutlinkslistqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CheckoutLinkSortProperty](../../models/checkoutlinksortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutLinksListResponse](../../models/checkoutlinkslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a checkout link. + +**Scopes**: `checkout_links:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkout_links.create(request={ + "payment_processor": "stripe", + "allow_discount_codes": True, + "require_billing_address": False, + "product_id": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `request` | [models.CheckoutLinksCreateCheckoutLinkCreate](../../models/checkoutlinkscreatecheckoutlinkcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutLink](../../models/checkoutlink.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a checkout link by ID. + +**Scopes**: `checkout_links:read` `checkout_links:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkout_links.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The checkout link ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutLink](../../models/checkoutlink.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a checkout link. + +**Scopes**: `checkout_links:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkout_links.update(id="", checkout_link_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The checkout link ID. | +| `checkout_link_update` | [models.CheckoutLinkUpdate](../../models/checkoutlinkupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutLink](../../models/checkoutlink.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +Delete a checkout link. + +**Scopes**: `checkout_links:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.checkout_links.delete(id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The checkout link ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/checkouts/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/checkouts/README.md) + +### Checkouts +(*checkouts*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Checkout Sessions +* [create](#create) - Create Checkout Session +* [get](#get) - Get Checkout Session +* [update](#update) - Update Checkout Session +* [client_get](#client_get) - Get Checkout Session from Client +* [client_update](#client_update) - Update Checkout Session from Client +* [client_confirm](#client_confirm) - Confirm Checkout Session from Client + +#### list + +List checkout sessions. + +**Scopes**: `checkouts:read` `checkouts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkouts.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.CheckoutsListQueryParamOrganizationIDFilter]](../../models/checkoutslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.CheckoutsListQueryParamProductIDFilter]](../../models/checkoutslistqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CheckoutSortProperty](../../models/checkoutsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutsListResponse](../../models/checkoutslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a checkout session. + +**Scopes**: `checkouts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkouts.create(request={ + "customer_billing_address": { + "country": "SE", + }, + "products": [ + "", + "", + ], + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.CheckoutCreate](../../models/checkoutcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Checkout](../../models/checkout.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a checkout session by ID. + +**Scopes**: `checkouts:read` `checkouts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkouts.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The checkout session ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Checkout](../../models/checkout.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a checkout session. + +**Scopes**: `checkouts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkouts.update(id="", checkout_update={ + "customer_billing_address": { + "country": "FR", + }, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The checkout session ID. | +| `checkout_update` | [models.CheckoutUpdate](../../models/checkoutupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Checkout](../../models/checkout.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models.AlreadyActiveSubscriptionError | 403 | application/json | +| models.NotOpenCheckout | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### client_get + +Get a checkout session by client secret. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.checkouts.client_get(client_secret="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `client_secret` | *str* | :heavy_check_mark: | The checkout session client secret. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutPublic](../../models/checkoutpublic.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.ExpiredCheckoutError | 410 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### client_update + +Update a checkout session by client secret. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.checkouts.client_update(client_secret="", checkout_update_public={ + "customer_billing_address": { + "country": "FR", + }, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `client_secret` | *str* | :heavy_check_mark: | The checkout session client secret. | +| `checkout_update_public` | [models.CheckoutUpdatePublic](../../models/checkoutupdatepublic.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutPublic](../../models/checkoutpublic.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models.AlreadyActiveSubscriptionError | 403 | application/json | +| models.NotOpenCheckout | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.ExpiredCheckoutError | 410 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### client_confirm + +Confirm a checkout session by client secret. + +Orders and subscriptions will be processed. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.checkouts.client_confirm(client_secret="", checkout_confirm_stripe={ + "customer_billing_address": { + "country": "FR", + }, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `client_secret` | *str* | :heavy_check_mark: | The checkout session client secret. | +| `checkout_confirm_stripe` | [models.CheckoutConfirmStripe](../../models/checkoutconfirmstripe.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CheckoutPublicConfirmed](../../models/checkoutpublicconfirmed.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models.PaymentError | 400 | application/json | +| models.AlreadyActiveSubscriptionError | 403 | application/json | +| models.NotOpenCheckout | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.ExpiredCheckoutError | 410 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/clients/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/clients/README.md) + +### Clients +(*oauth2.clients*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Clients +* [create](#create) - Create Client +* [get](#get) - Get Client +* [update](#update) - Update Client +* [delete](#delete) - Delete Client + +#### list + +List OAuth2 clients. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.clients.list() + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Oauth2ClientsListResponse](../../models/oauth2clientslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create an OAuth2 client. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.clients.create(request={ + "redirect_uris": [ + "https://inferior-chainstay.com", + ], + "client_name": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `request` | [models.OAuth2ClientConfiguration](../../models/oauth2clientconfiguration.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[Any](../../models/.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get an OAuth2 client by Client ID. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.clients.get(client_id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `client_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[Any](../../models/.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update an OAuth2 client. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.clients.update(client_id="", o_auth2_client_configuration_update={ + "redirect_uris": [ + "https://grown-worth.name", + "https://worthwhile-avalanche.org/", + "https://general-digit.com/", + ], + "client_name": "", + "client_id": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `client_id` | *str* | :heavy_check_mark: | N/A | +| `o_auth2_client_configuration_update` | [models.OAuth2ClientConfigurationUpdate](../../models/oauth2clientconfigurationupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[Any](../../models/.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +Delete an OAuth2 client. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.clients.delete(client_id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `client_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[Any](../../models/.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/customermeters/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customermeters/README.md) + +### CustomerMeters +(*customer_meters*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Customer Meters +* [get](#get) - Get Customer Meter + +#### list + +List customer meters. + +**Scopes**: `customer_meters:read` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customer_meters.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.CustomerMetersListQueryParamOrganizationIDFilter]](../../models/customermeterslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.CustomerMetersListQueryParamCustomerIDFilter]](../../models/customermeterslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `external_customer_id` | [OptionalNullable[models.CustomerMetersListQueryParamExternalCustomerIDFilter]](../../models/customermeterslistqueryparamexternalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `meter_id` | [OptionalNullable[models.QueryParamMeterIDFilter]](../../models/queryparammeteridfilter.md) | :heavy_minus_sign: | Filter by meter ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomerMeterSortProperty](../../models/customermetersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerMetersListResponse](../../models/customermeterslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a customer meter by ID. + +**Scopes**: `customer_meters:read` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customer_meters.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The customer meter ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerMeter](../../models/customermeter.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/customerportal/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customerportal/README.md) + +### CustomerPortal +(*customer_portal*) + +#### Overview + +##### Available Operations + + +--- + +## Content: [docs/sdks/customers/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customers/README.md) + +### Customers +(*customers*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Customers +* [create](#create) - Create Customer +* [get](#get) - Get Customer +* [update](#update) - Update Customer +* [delete](#delete) - Delete Customer +* [get_external](#get_external) - Get Customer by External ID +* [update_external](#update_external) - Update Customer by External ID +* [delete_external](#delete_external) - Delete Customer by External ID +* [get_state](#get_state) - Get Customer State +* [get_state_external](#get_state_external) - Get Customer State by External ID + +#### list + +List customers. + +**Scopes**: `customers:read` `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.CustomersListQueryParamOrganizationIDFilter]](../../models/customerslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by exact email. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name or email. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomerSortProperty](../../models/customersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomersListResponse](../../models/customerslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a customer. + +**Scopes**: `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.create(request={ + "external_id": "usr_1337", + "email": "customer@example.com", + "name": "John Doe", + "billing_address": { + "country": "SE", + }, + "tax_id": [ + "FR61954506077", + "eu_vat", + ], + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.CustomerCreate](../../models/customercreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Customer](../../models/customer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a customer by ID. + +**Scopes**: `customers:read` `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The customer ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Customer](../../models/customer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a customer. + +**Scopes**: `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.update(id="", customer_update={ + "external_id": "usr_1337", + "email": "customer@example.com", + "name": "John Doe", + "billing_address": { + "country": "FR", + }, + "tax_id": [ + "FR61954506077", + "eu_vat", + ], + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The customer ID. | +| `customer_update` | [models.CustomerUpdate](../../models/customerupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Customer](../../models/customer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +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. + +**Scopes**: `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.customers.delete(id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The customer ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get_external + +Get a customer by external ID. + +**Scopes**: `customers:read` `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.get_external(external_id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `external_id` | *str* | :heavy_check_mark: | The customer external ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Customer](../../models/customer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update_external + +Update a customer by external ID. + +**Scopes**: `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.update_external(external_id="", customer_update={ + "external_id": "usr_1337", + "email": "customer@example.com", + "name": "John Doe", + "billing_address": { + "country": "US", + }, + "tax_id": [ + "FR61954506077", + "eu_vat", + ], + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `external_id` | *str* | :heavy_check_mark: | The customer external ID. | +| `customer_update` | [models.CustomerUpdate](../../models/customerupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Customer](../../models/customer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete_external + +Delete a customer by external ID. + +Immediately cancels any active subscriptions and revokes any active benefits. + +**Scopes**: `customers:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.customers.delete_external(external_id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `external_id` | *str* | :heavy_check_mark: | The customer external ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get_state + +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` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.get_state(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The customer ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerState](../../models/customerstate.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get_state_external + +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` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.get_state_external(external_id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `external_id` | *str* | :heavy_check_mark: | The customer external ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerState](../../models/customerstate.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/customersessions/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customersessions/README.md) + +### CustomerSessions +(*customer_sessions*) + +#### Overview + +##### Available Operations + +* [create](#create) - Create Customer Session + +#### create + +Create a customer session. + +**Scopes**: `customer_sessions:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customer_sessions.create(request={ + "customer_id": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `request` | [models.CustomerSessionsCreateCustomerSessionCreate](../../models/customersessionscreatecustomersessioncreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerSession](../../models/customersession.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/customfields/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customfields/README.md) + +### CustomFields +(*custom_fields*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Custom Fields +* [create](#create) - Create Custom Field +* [get](#get) - Get Custom Field +* [update](#update) - Update Custom Field +* [delete](#delete) - Delete Custom Field + +#### list + +List custom fields. + +**Scopes**: `custom_fields:read` `custom_fields:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.custom_fields.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.CustomFieldsListQueryParamOrganizationIDFilter]](../../models/customfieldslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by custom field name or slug. | +| `type_filter` | [OptionalNullable[models.CustomFieldTypeFilter]](../../models/customfieldtypefilter.md) | :heavy_minus_sign: | Filter by custom field type. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomFieldSortProperty](../../models/customfieldsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomFieldsListResponse](../../models/customfieldslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a custom field. + +**Scopes**: `custom_fields:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.custom_fields.create(request={ + "type": "number", + "slug": "", + "name": "", + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "properties": {}, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.CustomFieldCreate](../../models/customfieldcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomField](../../models/customfield.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a custom field by ID. + +**Scopes**: `custom_fields:read` `custom_fields:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.custom_fields.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The custom field ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomField](../../models/customfield.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a custom field. + +**Scopes**: `custom_fields:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.custom_fields.update(id="", custom_field_update={ + "type": "text", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The custom field ID. | +| `custom_field_update` | [models.CustomFieldUpdate](../../models/customfieldupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomField](../../models/customfield.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +Delete a custom field. + +**Scopes**: `custom_fields:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.custom_fields.delete(id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The custom field ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/discounts/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/discounts/README.md) + +### Discounts +(*discounts*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Discounts +* [create](#create) - Create Discount +* [get](#get) - Get Discount +* [update](#update) - Update Discount +* [delete](#delete) - Delete Discount + +#### list + +List discounts. + +**Scopes**: `discounts:read` `discounts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.discounts.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.DiscountsListQueryParamOrganizationIDFilter]](../../models/discountslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.DiscountSortProperty](../../models/discountsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.DiscountsListResponse](../../models/discountslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a discount. + +**Scopes**: `discounts:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.discounts.create(request={ + "duration": polar_sdk.DiscountDuration.FOREVER, + "duration_in_months": 417458, + "type": polar_sdk.DiscountType.FIXED, + "amount": 69025, + "currency": "usd", + "name": "", + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.DiscountCreate](../../models/discountcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Discount](../../models/discount.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a discount by ID. + +**Scopes**: `discounts:read` `discounts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.discounts.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The discount ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Discount](../../models/discount.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a discount. + +**Scopes**: `discounts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.discounts.update(id="", discount_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The discount ID. | +| `discount_update` | [models.DiscountUpdate](../../models/discountupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Discount](../../models/discount.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +Delete a discount. + +**Scopes**: `discounts:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.discounts.delete(id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The discount ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/downloadables/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/downloadables/README.md) + +### Downloadables +(*customer_portal.downloadables*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Downloadables +* [get](#get) - Get Downloadable + +#### list + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.downloadables.list(security=polar_sdk.CustomerPortalDownloadablesListSecurity( + customer_session="", + ), organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalDownloadablesListSecurity](../../models/customerportaldownloadableslistsecurity.md) | :heavy_check_mark: | N/A | +| `organization_id` | [OptionalNullable[models.CustomerPortalDownloadablesListQueryParamOrganizationIDFilter]](../../models/customerportaldownloadableslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `benefit_id` | [OptionalNullable[models.CustomerPortalDownloadablesListQueryParamBenefitIDFilter]](../../models/customerportaldownloadableslistqueryparambenefitidfilter.md) | :heavy_minus_sign: | Filter by benefit ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalDownloadablesListResponse](../../models/customerportaldownloadableslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get Downloadable + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.downloadables.get(token="") + + assert res is not None + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `token` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[Any](../../models/.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/events/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/events/README.md) + +### Events +(*events*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Events +* [list_names](#list_names) - List Event Names +* [get](#get) - Get Event +* [ingest](#ingest) - Ingest Events + +#### list + +List events. + +**Scopes**: `events:read` `events:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.events.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `filter_` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter events following filter clauses. JSON string following the same schema a meter filter clause. | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter events after this timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter events before this timestamp. | +| `organization_id` | [OptionalNullable[models.EventsListQueryParamOrganizationIDFilter]](../../models/eventslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.EventsListQueryParamCustomerIDFilter]](../../models/eventslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `external_customer_id` | [OptionalNullable[models.ExternalCustomerIDFilter]](../../models/externalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `meter_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by a meter filter clause. | +| `name` | [OptionalNullable[models.NameFilter]](../../models/namefilter.md) | :heavy_minus_sign: | Filter by event name. | +| `source` | [OptionalNullable[models.SourceFilter]](../../models/sourcefilter.md) | :heavy_minus_sign: | Filter by event source. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.EventSortProperty](../../models/eventsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.EventsListResponse](../../models/eventslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### list_names + +List event names. + +**Scopes**: `events:read` `events:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.events.list_names(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737") + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.EventsListNamesQueryParamOrganizationIDFilter]](../../models/eventslistnamesqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.EventsListNamesQueryParamCustomerIDFilter]](../../models/eventslistnamesqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `external_customer_id` | [OptionalNullable[models.QueryParamExternalCustomerIDFilter]](../../models/queryparamexternalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `source` | [OptionalNullable[models.QueryParamSourceFilter]](../../models/queryparamsourcefilter.md) | :heavy_minus_sign: | Filter by event source. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Query to filter event names. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.EventNamesSortProperty](../../models/eventnamessortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.EventsListNamesResponse](../../models/eventslistnamesresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get an event by ID. + +**Scopes**: `events:read` `events:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.events.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The event ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Event](../../models/event.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### ingest + +Ingest batch of events. + +**Scopes**: `events:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.events.ingest(request={ + "events": [ + { + "name": "", + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "customer_id": "", + }, + { + "name": "", + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "external_customer_id": "", + }, + ], + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.EventsIngest](../../models/eventsingest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.EventsIngestResponse](../../models/eventsingestresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/files/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/files/README.md) + +### Files +(*files*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Files +* [create](#create) - Create File +* [uploaded](#uploaded) - Complete File Upload +* [update](#update) - Update File +* [delete](#delete) - Delete File + +#### list + +List files. + +**Scopes**: `files:read` `files:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.files.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737") + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `ids` | List[*str*] | :heavy_minus_sign: | List of file IDs to get. | | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +##### Response + +**[models.FilesListResponse](../../models/fileslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a file. + +**Scopes**: `files:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.files.create(request={ + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "name": "", + "mime_type": "", + "size": 638424, + "upload": { + "parts": [ + { + "number": 417458, + "chunk_start": 134365, + "chunk_end": 69025, + }, + ], + }, + "service": "organization_avatar", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.FileCreate](../../models/filecreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.FileUpload](../../models/fileupload.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### uploaded + +Complete a file upload. + +**Scopes**: `files:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.files.uploaded(id="", file_upload_completed={ + "id": "", + "path": "/sys", + "parts": [ + { + "number": 173116, + "checksum_etag": "", + "checksum_sha256_base64": "", + }, + { + "number": 894030, + "checksum_etag": "", + "checksum_sha256_base64": "", + }, + { + "number": 673715, + "checksum_etag": "", + "checksum_sha256_base64": "", + }, + ], + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The file ID. | +| `file_upload_completed` | [models.FileUploadCompleted](../../models/fileuploadcompleted.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.FilesUploadedResponseFilesUploaded](../../models/filesuploadedresponsefilesuploaded.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a file. + +**Scopes**: `files:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.files.update(id="", file_patch={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The file ID. | +| `file_patch` | [models.FilePatch](../../models/filepatch.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.FilesUpdateResponseFilesUpdate](../../models/filesupdateresponsefilesupdate.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete + +Delete a file. + +**Scopes**: `files:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.files.delete(id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/licensekeys/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/licensekeys/README.md) + +### LicenseKeys +(*license_keys*) + +#### Overview + +##### Available Operations + +* [list](#list) - List License Keys +* [get](#get) - Get License Key +* [update](#update) - Update License Key +* [get_activation](#get_activation) - Get Activation + +#### list + +Get license keys connected to the given organization & filters. + +**Scopes**: `license_keys:read` `license_keys:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.license_keys.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.LicenseKeysListQueryParamOrganizationIDFilter]](../../models/licensekeyslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `benefit_id` | [OptionalNullable[models.QueryParamBenefitIDFilter]](../../models/queryparambenefitidfilter.md) | :heavy_minus_sign: | Filter by benefit ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.LicenseKeysListResponse](../../models/licensekeyslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.Unauthorized | 401 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a license key. + +**Scopes**: `license_keys:read` `license_keys:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.license_keys.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.LicenseKeyWithActivations](../../models/licensekeywithactivations.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.Unauthorized | 401 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a license key. + +**Scopes**: `license_keys:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.license_keys.update(id="", license_key_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `license_key_update` | [models.LicenseKeyUpdate](../../models/licensekeyupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.LicenseKeyRead](../../models/licensekeyread.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.Unauthorized | 401 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get_activation + +Get a license key activation. + +**Scopes**: `license_keys:read` `license_keys:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.license_keys.get_activation(id="", activation_id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `activation_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.LicenseKeyActivationRead](../../models/licensekeyactivationread.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.Unauthorized | 401 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/meters/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/meters/README.md) + +### Meters +(*meters*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Meters +* [create](#create) - Create Meter +* [get](#get) - Get Meter +* [update](#update) - Update Meter +* [quantities](#quantities) - Get Meter Quantities + +#### list + +List meters. + +**Scopes**: `meters:read` `meters:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.meters.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.MetersListQueryParamOrganizationIDFilter]](../../models/meterslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.MeterSortProperty](../../models/metersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.MetersListResponse](../../models/meterslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a meter. + +**Scopes**: `meters:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.meters.create(request={ + "name": "", + "filter_": { + "conjunction": polar_sdk.FilterConjunction.AND, + "clauses": [], + }, + "aggregation": { + "func": polar_sdk.Func.SUM, + "property": "", + }, + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.MeterCreate](../../models/metercreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Meter](../../models/meter.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a meter by ID. + +**Scopes**: `meters:read` `meters:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.meters.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Meter](../../models/meter.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a meter. + +**Scopes**: `meters:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.meters.update(id="", meter_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `meter_update` | [models.MeterUpdate](../../models/meterupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Meter](../../models/meter.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### quantities + +Get quantities of a meter over a time period. + +**Scopes**: `meters:read` `meters:write` + +##### Example Usage + +```python +import dateutil.parser +import polar_sdk +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.meters.quantities(id="", start_timestamp=dateutil.parser.isoparse("2023-09-17T00:45:34.608Z"), end_timestamp=dateutil.parser.isoparse("2023-07-21T18:11:39.069Z"), interval=polar_sdk.TimeInterval.HOUR) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Start timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | End timestamp. | +| `interval` | [models.TimeInterval](../../models/timeinterval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `customer_id` | [OptionalNullable[models.MetersQuantitiesQueryParamCustomerIDFilter]](../../models/metersquantitiesqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `external_customer_id` | [OptionalNullable[models.MetersQuantitiesQueryParamExternalCustomerIDFilter]](../../models/metersquantitiesqueryparamexternalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.MeterQuantities](../../models/meterquantities.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/metricssdk/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/metricssdk/README.md) + +### MetricsSDK +(*metrics*) + +#### Overview + +##### Available Operations + +* [get](#get) - Get Metrics +* [limits](#limits) - Get Metrics Limits + +#### get + +Get metrics about your orders and subscriptions. + +Currency values are output in cents. + +**Scopes**: `metrics:read` + +##### Example Usage + +```python +import dateutil.parser +import polar_sdk +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.metrics.get(start_date=dateutil.parser.parse("2025-02-06").date(), end_date=dateutil.parser.parse("2024-09-04").date(), interval=polar_sdk.TimeInterval.WEEK, organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `start_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_check_mark: | Start date. | +| `end_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_check_mark: | End date. | +| `interval` | [models.TimeInterval](../../models/timeinterval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `organization_id` | [OptionalNullable[models.MetricsGetQueryParamOrganizationIDFilter]](../../models/metricsgetqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.MetricsGetQueryParamProductIDFilter]](../../models/metricsgetqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `billing_type` | [OptionalNullable[models.QueryParamProductBillingTypeFilter]](../../models/queryparamproductbillingtypefilter.md) | :heavy_minus_sign: | Filter by billing type. `recurring` will filter data corresponding to subscriptions creations or renewals. `one_time` will filter data corresponding to one-time purchases. | +| `customer_id` | [OptionalNullable[models.MetricsGetQueryParamCustomerIDFilter]](../../models/metricsgetqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.MetricsResponse](../../models/metricsresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### limits + +Get the interval limits for the metrics endpoint. + +**Scopes**: `metrics:read` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.metrics.limits() + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.MetricsLimits](../../models/metricslimits.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/oauth2/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/oauth2/README.md) + +### Oauth2 +(*oauth2*) + +#### Overview + +##### Available Operations + +* [authorize](#authorize) - Authorize +* [token](#token) - Request Token +* [revoke](#revoke) - Revoke Token +* [introspect](#introspect) - Introspect Token +* [userinfo](#userinfo) - Get User Info + +#### authorize + +Authorize + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.authorize() + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Oauth2AuthorizeResponseOauth2Authorize](../../models/oauth2authorizeresponseoauth2authorize.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### token + +Request an access token using a valid grant. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.oauth2.token(request={ + "grant_type": "authorization_code", + "client_id": "", + "client_secret": "", + "code": "", + "redirect_uri": "https://old-fort.name", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `request` | [models.Oauth2RequestTokenRequestBody](../../models/oauth2requesttokenrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.TokenResponse](../../models/tokenresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### revoke + +Revoke an access token or a refresh token. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.oauth2.revoke(request={ + "token": "", + "client_id": "", + "client_secret": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.RevokeTokenRequest](../../models/revoketokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.RevokeTokenResponse](../../models/revoketokenresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### introspect + +Get information about an access token. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.oauth2.introspect(request={ + "token": "", + "client_id": "", + "client_secret": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `request` | [models.IntrospectTokenRequest](../../models/introspecttokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.IntrospectTokenResponse](../../models/introspecttokenresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### userinfo + +Get information about the authenticated user. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.oauth2.userinfo() + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Oauth2UserinfoResponseOauth2Userinfo](../../models/oauth2userinforesponseoauth2userinfo.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/orders/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/orders/README.md) + +### Orders +(*orders*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Orders +* [get](#get) - Get Order +* [invoice](#invoice) - Get Order Invoice + +#### list + +List orders. + +**Scopes**: `orders:read` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.orders.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.OrdersListQueryParamOrganizationIDFilter]](../../models/orderslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.OrdersListQueryParamProductIDFilter]](../../models/orderslistqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `product_billing_type` | [OptionalNullable[models.ProductBillingTypeFilter]](../../models/productbillingtypefilter.md) | :heavy_minus_sign: | 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. | +| `discount_id` | [OptionalNullable[models.QueryParamDiscountIDFilter]](../../models/queryparamdiscountidfilter.md) | :heavy_minus_sign: | Filter by discount ID. | +| `customer_id` | [OptionalNullable[models.OrdersListQueryParamCustomerIDFilter]](../../models/orderslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `checkout_id` | [OptionalNullable[models.CheckoutIDFilter]](../../models/checkoutidfilter.md) | :heavy_minus_sign: | Filter by checkout ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.OrderSortProperty](../../models/ordersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.OrdersListResponse](../../models/orderslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get an order by ID. + +**Scopes**: `orders:read` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.orders.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Order](../../models/order.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### invoice + +Get an order's invoice data. + +**Scopes**: `orders:read` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.orders.invoice(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.OrderInvoice](../../models/orderinvoice.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/organizations/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/organizations/README.md) + +### Organizations +(*organizations*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Organizations +* [create](#create) - Create Organization +* [get](#get) - Get Organization +* [update](#update) - Update Organization + +#### list + +List organizations. + +**Scopes**: `organizations:read` `organizations:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.organizations.list() + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by slug. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.OrganizationSortProperty](../../models/organizationsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.OrganizationsListResponse](../../models/organizationslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create an organization. + +**Scopes**: `organizations:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.organizations.create(request={ + "name": "", + "slug": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.OrganizationCreate](../../models/organizationcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Organization](../../models/organization.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get an organization by ID. + +**Scopes**: `organizations:read` `organizations:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.organizations.get(id="1dbfc517-0bbf-4301-9ba8-555ca42b9737") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +##### Response + +**[models.Organization](../../models/organization.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update an organization. + +**Scopes**: `organizations:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.organizations.update(id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", organization_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `organization_update` | [models.OrganizationUpdate](../../models/organizationupdate.md) | :heavy_check_mark: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +##### Response + +**[models.Organization](../../models/organization.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/polar/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polar/README.md) + +### Polar SDK + +#### Overview + +Read the docs at https://docs.polar.sh/api-reference + +##### Available Operations + + +--- + +## Content: [docs/sdks/polarcustomermeters/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarcustomermeters/README.md) + +### PolarCustomerMeters +(*customer_portal.customer_meters*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Meters +* [get](#get) - Get Customer Meter + +#### list + +List meters of the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.customer_meters.list(security=polar_sdk.CustomerPortalCustomerMetersListSecurity( + customer_session="", + )) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalCustomerMetersListSecurity](../../models/customerportalcustomermeterslistsecurity.md) | :heavy_check_mark: | N/A | +| `meter_id` | [OptionalNullable[models.MeterIDFilter]](../../models/meteridfilter.md) | :heavy_minus_sign: | Filter by meter ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by meter name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomerCustomerMeterSortProperty](../../models/customercustomermetersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalCustomerMetersListResponse](../../models/customerportalcustomermeterslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a meter by ID for the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.customer_meters.get(security=polar_sdk.CustomerPortalCustomerMetersGetSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalCustomerMetersGetSecurity](../../models/customerportalcustomermetersgetsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The customer meter ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerCustomerMeter](../../models/customercustomermeter.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/polarcustomers/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarcustomers/README.md) + +### PolarCustomers +(*customer_portal.customers*) + +#### Overview + +##### Available Operations + +* [get](#get) - Get Customer +* [update](#update) - Update Customer +* [get_payment_methods](#get_payment_methods) - Get Customer Payment Methods +* [add_payment_method](#add_payment_method) - Add Customer Payment Method +* [delete_payment_method](#delete_payment_method) - Delete Customer Payment Method + +#### get + +Get authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.customers.get(security=polar_sdk.CustomerPortalCustomersGetSecurity( + customer_session="", + )) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalCustomersGetSecurity](../../customerportalcustomersgetsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalCustomer](../../models/customerportalcustomer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update authenticated customer. + +**Scopes**: `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.customers.update(security=polar_sdk.CustomerPortalCustomersUpdateSecurity( + customer_session="", + ), request={ + "billing_address": { + "country": "FR", + }, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `request` | [models.CustomerPortalCustomerUpdate](../../models/customerportalcustomerupdate.md) | :heavy_check_mark: | The request object to use for the request. | +| `security` | [models.CustomerPortalCustomersUpdateSecurity](../../customerportalcustomersupdatesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalCustomer](../../models/customerportalcustomer.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get_payment_methods + +Get saved payment methods of the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.customers.get_payment_methods(security=polar_sdk.CustomerPortalCustomersGetPaymentMethodsSecurity( + customer_session="", + )) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalCustomersGetPaymentMethodsSecurity](../../models/customerportalcustomersgetpaymentmethodssecurity.md) | :heavy_check_mark: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalCustomersGetPaymentMethodsResponse](../../models/customerportalcustomersgetpaymentmethodsresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### add_payment_method + +Add a payment method to the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.customers.add_payment_method(security=polar_sdk.CustomerPortalCustomersAddPaymentMethodSecurity( + customer_session="", + ), request={ + "confirmation_token_id": "", + "set_default": False, + "return_url": "https://slight-digestive.info", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `request` | [models.CustomerPaymentMethodCreate](../../models/customerpaymentmethodcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `security` | [models.CustomerPortalCustomersAddPaymentMethodSecurity](../../customerportalcustomersaddpaymentmethodsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalCustomersAddPaymentMethodResponseCustomerPortalCustomersAddPaymentMethod](../../models/customerportalcustomersaddpaymentmethodresponsecustomerportalcustomersaddpaymentmethod.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### delete_payment_method + +Delete a payment method from the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + polar.customer_portal.customers.delete_payment_method(security=polar_sdk.CustomerPortalCustomersDeletePaymentMethodSecurity( + customer_session="", + ), id="") + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalCustomersDeletePaymentMethodSecurity](../../models/customerportalcustomersdeletepaymentmethodsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/polarlicensekeys/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarlicensekeys/README.md) + +### PolarLicenseKeys +(*customer_portal.license_keys*) + +#### Overview + +##### Available Operations + +* [list](#list) - List License Keys +* [get](#get) - Get License Key +* [validate](#validate) - Validate License Key +* [activate](#activate) - Activate License Key +* [deactivate](#deactivate) - Deactivate License Key + +#### list + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.license_keys.list(security=polar_sdk.CustomerPortalLicenseKeysListSecurity( + customer_session="", + ), organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalLicenseKeysListSecurity](../../models/customerportallicensekeyslistsecurity.md) | :heavy_check_mark: | N/A | +| `organization_id` | [OptionalNullable[models.CustomerPortalLicenseKeysListQueryParamOrganizationIDFilter]](../../models/customerportallicensekeyslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `benefit_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by a specific benefit | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalLicenseKeysListResponse](../../models/customerportallicensekeyslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.Unauthorized | 401 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a license key. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.license_keys.get(security=polar_sdk.CustomerPortalLicenseKeysGetSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalLicenseKeysGetSecurity](../../models/customerportallicensekeysgetsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.LicenseKeyWithActivations](../../models/licensekeywithactivations.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### validate + +Validate a license key. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.license_keys.validate(request={ + "key": "", + "organization_id": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.LicenseKeyValidate](../../models/licensekeyvalidate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.ValidatedLicenseKey](../../models/validatedlicensekey.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### activate + +Activate a license key instance. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.license_keys.activate(request={ + "key": "", + "organization_id": "", + "label": "", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.LicenseKeyActivate](../../models/licensekeyactivate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.LicenseKeyActivationRead](../../models/licensekeyactivationread.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### deactivate + +Deactivate a license key instance. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar() as polar: + + polar.customer_portal.license_keys.deactivate(request={ + "key": "", + "organization_id": "", + "activation_id": "", + }) + + # Use the SDK ... + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.LicenseKeyDeactivate](../../models/licensekeydeactivate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/polarorders/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarorders/README.md) + +### PolarOrders +(*customer_portal.orders*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Orders +* [get](#get) - Get Order +* [invoice](#invoice) - Get Order Invoice + +#### list + +List orders of the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.orders.list(security=polar_sdk.CustomerPortalOrdersListSecurity( + customer_session="", + ), organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalOrdersListSecurity](../../models/customerportalorderslistsecurity.md) | :heavy_check_mark: | N/A | +| `organization_id` | [OptionalNullable[models.CustomerPortalOrdersListQueryParamOrganizationIDFilter]](../../models/customerportalorderslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.CustomerPortalOrdersListQueryParamProductIDFilter]](../../models/customerportalorderslistqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `product_billing_type` | [OptionalNullable[models.CustomerPortalOrdersListQueryParamProductBillingTypeFilter]](../../models/customerportalorderslistqueryparamproductbillingtypefilter.md) | :heavy_minus_sign: | 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. | +| `subscription_id` | [OptionalNullable[models.CustomerPortalOrdersListQueryParamSubscriptionIDFilter]](../../models/customerportalorderslistqueryparamsubscriptionidfilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Search by product or organization name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomerOrderSortProperty](../../models/customerordersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalOrdersListResponse](../../models/customerportalorderslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get an order by ID for the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.orders.get(security=polar_sdk.CustomerPortalOrdersGetSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalOrdersGetSecurity](../../models/customerportalordersgetsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerOrder](../../models/customerorder.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### invoice + +Get an order's invoice data. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.orders.invoice(security=polar_sdk.CustomerPortalOrdersInvoiceSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalOrdersInvoiceSecurity](../../models/customerportalordersinvoicesecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerOrderInvoice](../../models/customerorderinvoice.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/polarorganizations/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarorganizations/README.md) + +### PolarOrganizations +(*customer_portal.organizations*) + +#### Overview + +##### Available Operations + +* [get](#get) - Get Organization + +#### get + +Get a customer portal's organization by slug. + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customer_portal.organizations.get(slug="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `slug` | *str* | :heavy_check_mark: | The organization slug. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerOrganization](../../models/customerorganization.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/polarsubscriptions/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarsubscriptions/README.md) + +### PolarSubscriptions +(*customer_portal.subscriptions*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Subscriptions +* [get](#get) - Get Subscription +* [update](#update) - Update Subscription +* [cancel](#cancel) - Cancel Subscription + +#### list + +List subscriptions of the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.subscriptions.list(security=polar_sdk.CustomerPortalSubscriptionsListSecurity( + customer_session="", + ), organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalSubscriptionsListSecurity](../../models/customerportalsubscriptionslistsecurity.md) | :heavy_check_mark: | N/A | +| `organization_id` | [OptionalNullable[models.CustomerPortalSubscriptionsListQueryParamOrganizationIDFilter]](../../models/customerportalsubscriptionslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.CustomerPortalSubscriptionsListQueryParamProductIDFilter]](../../models/customerportalsubscriptionslistqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by active or cancelled subscription. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Search by product or organization name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.CustomerSubscriptionSortProperty](../../models/customersubscriptionsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerPortalSubscriptionsListResponse](../../models/customerportalsubscriptionslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a subscription for the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.subscriptions.get(security=polar_sdk.CustomerPortalSubscriptionsGetSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalSubscriptionsGetSecurity](../../models/customerportalsubscriptionsgetsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The subscription ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerSubscription](../../models/customersubscription.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a subscription of the authenticated customer. + +**Scopes**: `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.subscriptions.update(security=polar_sdk.CustomerPortalSubscriptionsUpdateSecurity( + customer_session="", + ), id="", customer_subscription_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalSubscriptionsUpdateSecurity](../../models/customerportalsubscriptionsupdatesecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The subscription ID. | +| `customer_subscription_update` | [models.CustomerSubscriptionUpdate](../../models/customersubscriptionupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerSubscription](../../models/customersubscription.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| models.AlreadyCanceledSubscription | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### cancel + +Cancel a subscription of the authenticated customer. + +**Scopes**: `customer_portal:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.subscriptions.cancel(security=polar_sdk.CustomerPortalSubscriptionsCancelSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalSubscriptionsCancelSecurity](../../models/customerportalsubscriptionscancelsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The subscription ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.CustomerSubscription](../../models/customersubscription.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| models.AlreadyCanceledSubscription | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/products/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/products/README.md) + +### Products +(*products*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Products +* [create](#create) - Create Product +* [get](#get) - Get Product +* [update](#update) - Update Product +* [update_benefits](#update_benefits) - Update Product Benefits + +#### list + +List products. + +**Scopes**: `products:read` `products:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.products.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | [OptionalNullable[models.QueryParamProductIDFilter]](../../models/queryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `organization_id` | [OptionalNullable[models.ProductsListQueryParamOrganizationIDFilter]](../../models/productslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by product name. | +| `is_archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter on archived products. | +| `is_recurring` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter on recurring products. If `true`, only subscriptions tiers are returned. If `false`, only one-time purchase products are returned. | +| `benefit_id` | [OptionalNullable[models.BenefitIDFilter]](../../models/benefitidfilter.md) | :heavy_minus_sign: | Filter products granting specific benefit. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.ProductSortProperty](../../models/productsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.ProductsListResponse](../../models/productslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a product. + +**Scopes**: `products:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.products.create(request={ + "name": "", + "recurring_interval": polar_sdk.SubscriptionRecurringInterval.MONTH, + "prices": [ + { + "amount_type": "custom", + "price_currency": "usd", + }, + { + "amount_type": "free", + }, + ], + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.ProductCreate](../../models/productcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Product](../../models/product.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a product by ID. + +**Scopes**: `products:read` `products:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.products.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Product](../../models/product.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a product. + +**Scopes**: `products:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.products.update(id="", product_update={}) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `product_update` | [models.ProductUpdate](../../models/productupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Product](../../models/product.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update_benefits + +Update benefits granted by a product. + +**Scopes**: `products:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.products.update_benefits(id="", product_benefits_update={ + "benefits": [ + "", + ], + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `product_benefits_update` | [models.ProductBenefitsUpdate](../../models/productbenefitsupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Product](../../models/product.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/refunds/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/refunds/README.md) + +### Refunds +(*refunds*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Refunds +* [create](#create) - Create Refund + +#### list + +List products. + +**Scopes**: `refunds:read` `refunds:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.refunds.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | [OptionalNullable[models.RefundIDFilter]](../../models/refundidfilter.md) | :heavy_minus_sign: | Filter by refund ID. | +| `organization_id` | [OptionalNullable[models.RefundsListQueryParamOrganizationIDFilter]](../../models/refundslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `order_id` | [OptionalNullable[models.OrderIDFilter]](../../models/orderidfilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `subscription_id` | [OptionalNullable[models.SubscriptionIDFilter]](../../models/subscriptionidfilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `customer_id` | [OptionalNullable[models.RefundsListQueryParamCustomerIDFilter]](../../models/refundslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `succeeded` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by `succeeded`. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.RefundSortProperty](../../models/refundsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.RefundsListResponse](../../models/refundslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### create + +Create a refund. + +**Scopes**: `refunds:write` + +##### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.refunds.create(request={ + "order_id": "", + "reason": polar_sdk.RefundReason.CUSTOMER_REQUEST, + "amount": 638424, + }) + + assert res is not None + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.RefundCreate](../../models/refundcreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Refund](../../models/refund.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.RefundAmountTooHigh | 400 | application/json | +| models.RefundedAlready | 403 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + +## Content: [docs/sdks/subscriptions/README.md](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/subscriptions/README.md) + +### Subscriptions +(*subscriptions*) + +#### Overview + +##### Available Operations + +* [list](#list) - List Subscriptions +* [export](#export) - Export Subscriptions +* [get](#get) - Get Subscription +* [update](#update) - Update Subscription +* [revoke](#revoke) - Revoke Subscription + +#### list + +List subscriptions. + +**Scopes**: `subscriptions:read` `subscriptions:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.subscriptions.list(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + while res is not None: + # Handle items + + res = res.next() + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.OrganizationIDFilter]](../../models/organizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `product_id` | [OptionalNullable[models.ProductIDFilter]](../../models/productidfilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `customer_id` | [OptionalNullable[models.CustomerIDFilter]](../../models/customeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `discount_id` | [OptionalNullable[models.DiscountIDFilter]](../../models/discountidfilter.md) | :heavy_minus_sign: | Filter by discount ID. | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by active or inactive subscription. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.SubscriptionSortProperty](../../models/subscriptionsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.SubscriptionsListResponse](../../models/subscriptionslistresponse.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### export + +Export subscriptions as a CSV file. + +**Scopes**: `subscriptions:read` `subscriptions:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.subscriptions.export(organization_id=[ + "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + ]) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.OrganizationID]](../../models/organizationid.md) | :heavy_minus_sign: | Filter by organization ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[Any](../../models/.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### get + +Get a subscription by ID. + +**Scopes**: `subscriptions:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.subscriptions.get(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The subscription ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Subscription](../../models/subscription.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### update + +Update a subscription. + +**Scopes**: `subscriptions:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.subscriptions.update(id="", subscription_update={ + "revoke": True, + }) + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The subscription ID. | +| `subscription_update` | [models.SubscriptionUpdate](../../models/subscriptionupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Subscription](../../models/subscription.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| models.AlreadyCanceledSubscription | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +#### revoke + +Revoke a subscription, i.e cancel immediately. + +**Scopes**: `subscriptions:write` + +##### Example Usage + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.subscriptions.revoke(id="") + + # Handle response + print(res) + +``` + +##### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The subscription ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +##### Response + +**[models.Subscription](../../models/subscription.md)** + +##### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| models.AlreadyCanceledSubscription | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +--- + diff --git a/llms.txt b/llms.txt new file mode 100644 index 00000000..63733f23 --- /dev/null +++ b/llms.txt @@ -0,0 +1,39 @@ +# Polar + +> Polar SDK Python + +## Sdks Files + +- [Benefitgrants](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/benefitgrants/README.md) +- [Benefits](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/benefits/README.md) +- [Checkoutlinks](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/checkoutlinks/README.md) +- [Checkouts](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/checkouts/README.md) +- [Clients](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/clients/README.md) +- [Customermeters](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customermeters/README.md) +- [Customerportal](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customerportal/README.md) +- [Customers](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customers/README.md) +- [Customersessions](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customersessions/README.md) +- [Customfields](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/customfields/README.md) +- [Discounts](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/discounts/README.md) +- [Downloadables](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/downloadables/README.md) +- [Events](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/events/README.md) +- [Files](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/files/README.md) +- [Licensekeys](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/licensekeys/README.md) +- [Meters](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/meters/README.md) +- [Metricssdk](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/metricssdk/README.md) +- [Oauth2](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/oauth2/README.md) +- [Orders](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/orders/README.md) +- [Organizations](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/organizations/README.md) +- [Polar](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polar/README.md) +- [Polarcustomermeters](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarcustomermeters/README.md) +- [Polarcustomers](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarcustomers/README.md) +- [Polarlicensekeys](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarlicensekeys/README.md) +- [Polarorders](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarorders/README.md) +- [Polarorganizations](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarorganizations/README.md) +- [Polarsubscriptions](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/polarsubscriptions/README.md) +- [Products](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/products/README.md) +- [Refunds](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/refunds/README.md) +- [Subscriptions](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/docs/sdks/subscriptions/README.md) + +## Optional +- [Extended Context](https://raw.githubusercontent.com/canburaks/polar-python/feature/llm-txt/llms-full.txt)