├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github └── workflows │ ├── ci.yml │ ├── publish-pypi.yml │ └── release-doctor.yml ├── .gitignore ├── .python-version ├── .release-please-manifest.json ├── .stats.yml ├── Brewfile ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── api.md ├── bin ├── check-release-environment └── publish-pypi ├── examples ├── .keep ├── datetime_usage.py ├── hello_sailor.txt ├── hello_world.txt ├── transactions.py └── upload_evidence.py ├── integrations └── pagination.py ├── mypy.ini ├── noxfile.py ├── pyproject.toml ├── release-please-config.json ├── requirements-dev.lock ├── requirements.lock ├── scripts ├── bootstrap ├── format ├── lint ├── mock ├── test └── utils │ ├── ruffen-docs.py │ └── upload-artifact.sh ├── src └── lithic │ ├── __init__.py │ ├── _base_client.py │ ├── _client.py │ ├── _compat.py │ ├── _constants.py │ ├── _exceptions.py │ ├── _files.py │ ├── _legacy_response.py │ ├── _models.py │ ├── _qs.py │ ├── _resource.py │ ├── _response.py │ ├── _streaming.py │ ├── _types.py │ ├── _utils │ ├── __init__.py │ ├── _logs.py │ ├── _proxy.py │ ├── _reflection.py │ ├── _resources_proxy.py │ ├── _streams.py │ ├── _sync.py │ ├── _transform.py │ ├── _typing.py │ └── _utils.py │ ├── _version.py │ ├── lib │ └── .keep │ ├── pagination.py │ ├── py.typed │ ├── resources │ ├── __init__.py │ ├── account_holders.py │ ├── accounts.py │ ├── aggregate_balances.py │ ├── auth_rules │ │ ├── __init__.py │ │ ├── auth_rules.py │ │ └── v2 │ │ │ ├── __init__.py │ │ │ ├── backtests.py │ │ │ └── v2.py │ ├── auth_stream_enrollment.py │ ├── balances.py │ ├── book_transfers.py │ ├── card_programs.py │ ├── cards │ │ ├── __init__.py │ │ ├── aggregate_balances.py │ │ ├── balances.py │ │ ├── cards.py │ │ └── financial_transactions.py │ ├── credit_products │ │ ├── __init__.py │ │ ├── credit_products.py │ │ ├── extended_credit.py │ │ └── prime_rates.py │ ├── digital_card_art.py │ ├── disputes.py │ ├── events │ │ ├── __init__.py │ │ ├── event_subscriptions.py │ │ ├── events.py │ │ └── subscriptions.py │ ├── external_bank_accounts │ │ ├── __init__.py │ │ ├── external_bank_accounts.py │ │ └── micro_deposits.py │ ├── external_payments.py │ ├── financial_accounts │ │ ├── __init__.py │ │ ├── balances.py │ │ ├── credit_configuration.py │ │ ├── financial_accounts.py │ │ ├── financial_transactions.py │ │ ├── loan_tapes.py │ │ └── statements │ │ │ ├── __init__.py │ │ │ ├── line_items.py │ │ │ └── statements.py │ ├── funding_events.py │ ├── management_operations.py │ ├── payments.py │ ├── reports │ │ ├── __init__.py │ │ ├── reports.py │ │ └── settlement │ │ │ ├── __init__.py │ │ │ ├── network_totals.py │ │ │ └── settlement.py │ ├── responder_endpoints.py │ ├── three_ds │ │ ├── __init__.py │ │ ├── authentication.py │ │ ├── decisioning.py │ │ └── three_ds.py │ ├── tokenization_decisioning.py │ ├── tokenizations.py │ ├── transactions │ │ ├── __init__.py │ │ ├── enhanced_commercial_data.py │ │ ├── events │ │ │ ├── __init__.py │ │ │ ├── enhanced_commercial_data.py │ │ │ └── events.py │ │ └── transactions.py │ └── webhooks.py │ └── types │ ├── __init__.py │ ├── account.py │ ├── account_holder.py │ ├── account_holder_create_params.py │ ├── account_holder_create_response.py │ ├── account_holder_list_documents_response.py │ ├── account_holder_list_params.py │ ├── account_holder_simulate_enrollment_document_review_params.py │ ├── account_holder_simulate_enrollment_review_params.py │ ├── account_holder_simulate_enrollment_review_response.py │ ├── account_holder_update_params.py │ ├── account_holder_update_response.py │ ├── account_holder_upload_document_params.py │ ├── account_list_params.py │ ├── account_spend_limits.py │ ├── account_update_params.py │ ├── address_update_param.py │ ├── aggregate_balance.py │ ├── aggregate_balance_list_params.py │ ├── api_status.py │ ├── auth_rules │ ├── __init__.py │ ├── auth_rule_condition.py │ ├── auth_rule_condition_param.py │ ├── conditional_attribute.py │ ├── conditional_block_parameters.py │ ├── conditional_block_parameters_param.py │ ├── v2 │ │ ├── __init__.py │ │ ├── backtest_create_params.py │ │ ├── backtest_create_response.py │ │ └── backtest_results.py │ ├── v2_apply_params.py │ ├── v2_apply_response.py │ ├── v2_create_params.py │ ├── v2_create_response.py │ ├── v2_draft_params.py │ ├── v2_draft_response.py │ ├── v2_list_params.py │ ├── v2_list_response.py │ ├── v2_promote_response.py │ ├── v2_report_response.py │ ├── v2_retrieve_response.py │ ├── v2_update_params.py │ ├── v2_update_response.py │ ├── velocity_limit_params.py │ ├── velocity_limit_params_param.py │ └── velocity_limit_params_period_window.py │ ├── auth_stream_secret.py │ ├── balance.py │ ├── balance_list_params.py │ ├── book_transfer_create_params.py │ ├── book_transfer_list_params.py │ ├── book_transfer_response.py │ ├── book_transfer_reverse_params.py │ ├── card.py │ ├── card_convert_physical_params.py │ ├── card_create_params.py │ ├── card_embed_params.py │ ├── card_embed_response.py │ ├── card_get_embed_html_params.py │ ├── card_get_embed_url_params.py │ ├── card_list_params.py │ ├── card_program.py │ ├── card_program_list_params.py │ ├── card_provision_params.py │ ├── card_provision_response.py │ ├── card_reissue_params.py │ ├── card_renew_params.py │ ├── card_search_by_pan_params.py │ ├── card_spend_limits.py │ ├── card_update_params.py │ ├── card_web_provision_params.py │ ├── card_web_provision_response.py │ ├── cards │ ├── __init__.py │ ├── aggregate_balance_list_params.py │ ├── aggregate_balance_list_response.py │ ├── balance_list_params.py │ ├── balance_list_response.py │ └── financial_transaction_list_params.py │ ├── credit_products │ ├── __init__.py │ ├── extended_credit.py │ ├── prime_rate_create_params.py │ ├── prime_rate_retrieve_params.py │ └── prime_rate_retrieve_response.py │ ├── digital_card_art.py │ ├── digital_card_art_list_params.py │ ├── dispute.py │ ├── dispute_create_params.py │ ├── dispute_evidence.py │ ├── dispute_initiate_evidence_upload_params.py │ ├── dispute_list_evidences_params.py │ ├── dispute_list_params.py │ ├── dispute_update_params.py │ ├── event.py │ ├── event_list_attempts_params.py │ ├── event_list_params.py │ ├── event_resend_params.py │ ├── event_subscription.py │ ├── events │ ├── __init__.py │ ├── subscription_create_params.py │ ├── subscription_list_attempts_params.py │ ├── subscription_list_params.py │ ├── subscription_recover_params.py │ ├── subscription_replay_missing_params.py │ ├── subscription_retrieve_secret_response.py │ ├── subscription_send_simulated_example_params.py │ └── subscription_update_params.py │ ├── external_bank_account_address.py │ ├── external_bank_account_address_param.py │ ├── external_bank_account_create_params.py │ ├── external_bank_account_create_response.py │ ├── external_bank_account_list_params.py │ ├── external_bank_account_list_response.py │ ├── external_bank_account_retrieve_response.py │ ├── external_bank_account_retry_micro_deposits_params.py │ ├── external_bank_account_retry_micro_deposits_response.py │ ├── external_bank_account_retry_prenote_params.py │ ├── external_bank_account_retry_prenote_response.py │ ├── external_bank_account_update_params.py │ ├── external_bank_account_update_response.py │ ├── external_bank_accounts │ ├── __init__.py │ ├── micro_deposit_create_params.py │ └── micro_deposit_create_response.py │ ├── external_payment.py │ ├── external_payment_cancel_params.py │ ├── external_payment_create_params.py │ ├── external_payment_list_params.py │ ├── external_payment_release_params.py │ ├── external_payment_reverse_params.py │ ├── external_payment_settle_params.py │ ├── financial_account.py │ ├── financial_account_create_params.py │ ├── financial_account_list_params.py │ ├── financial_account_update_params.py │ ├── financial_account_update_status_params.py │ ├── financial_accounts │ ├── __init__.py │ ├── balance_list_params.py │ ├── balance_list_response.py │ ├── credit_configuration_update_params.py │ ├── financial_account_credit_config.py │ ├── financial_transaction_list_params.py │ ├── loan_tape.py │ ├── loan_tape_list_params.py │ ├── statement.py │ ├── statement_list_params.py │ └── statements │ │ ├── __init__.py │ │ ├── line_item_list_params.py │ │ ├── statement_line_items.py │ │ └── statements.py │ ├── financial_transaction.py │ ├── funding_event_list_params.py │ ├── funding_event_list_response.py │ ├── funding_event_retrieve_details_response.py │ ├── funding_event_retrieve_response.py │ ├── kyb_business_entity.py │ ├── kyb_param.py │ ├── kyc_exempt_param.py │ ├── kyc_param.py │ ├── management_operation_create_params.py │ ├── management_operation_list_params.py │ ├── management_operation_reverse_params.py │ ├── management_operation_transaction.py │ ├── message_attempt.py │ ├── non_pci_card.py │ ├── owner_type.py │ ├── payment.py │ ├── payment_create_params.py │ ├── payment_create_response.py │ ├── payment_list_params.py │ ├── payment_retry_response.py │ ├── payment_simulate_action_params.py │ ├── payment_simulate_action_response.py │ ├── payment_simulate_receipt_params.py │ ├── payment_simulate_receipt_response.py │ ├── payment_simulate_release_params.py │ ├── payment_simulate_release_response.py │ ├── payment_simulate_return_params.py │ ├── payment_simulate_return_response.py │ ├── reports │ ├── __init__.py │ ├── settlement │ │ ├── __init__.py │ │ ├── network_total_list_params.py │ │ ├── network_total_list_response.py │ │ └── network_total_retrieve_response.py │ └── settlement_list_details_params.py │ ├── required_document.py │ ├── responder_endpoint_check_status_params.py │ ├── responder_endpoint_create_params.py │ ├── responder_endpoint_create_response.py │ ├── responder_endpoint_delete_params.py │ ├── responder_endpoint_status.py │ ├── settlement_detail.py │ ├── settlement_report.py │ ├── settlement_summary_details.py │ ├── shared │ ├── __init__.py │ ├── account_financial_account_type.py │ ├── address.py │ ├── carrier.py │ ├── currency.py │ ├── document.py │ ├── instance_financial_account_type.py │ └── shipping_address.py │ ├── shared_params │ ├── __init__.py │ ├── address.py │ ├── carrier.py │ └── shipping_address.py │ ├── spend_limit_duration.py │ ├── three_ds │ ├── __init__.py │ ├── authentication_retrieve_response.py │ ├── authentication_simulate_otp_entry_params.py │ ├── authentication_simulate_params.py │ ├── authentication_simulate_response.py │ ├── challenge_result.py │ ├── decisioning_challenge_response_params.py │ └── decisioning_retrieve_secret_response.py │ ├── tokenization.py │ ├── tokenization_decisioning_rotate_secret_response.py │ ├── tokenization_list_params.py │ ├── tokenization_resend_activation_code_params.py │ ├── tokenization_retrieve_response.py │ ├── tokenization_secret.py │ ├── tokenization_simulate_params.py │ ├── tokenization_simulate_response.py │ ├── tokenization_update_digital_card_art_params.py │ ├── tokenization_update_digital_card_art_response.py │ ├── transaction.py │ ├── transaction_list_params.py │ ├── transaction_simulate_authorization_advice_params.py │ ├── transaction_simulate_authorization_advice_response.py │ ├── transaction_simulate_authorization_params.py │ ├── transaction_simulate_authorization_response.py │ ├── transaction_simulate_clearing_params.py │ ├── transaction_simulate_clearing_response.py │ ├── transaction_simulate_credit_authorization_params.py │ ├── transaction_simulate_credit_authorization_response.py │ ├── transaction_simulate_return_params.py │ ├── transaction_simulate_return_response.py │ ├── transaction_simulate_return_reversal_params.py │ ├── transaction_simulate_return_reversal_response.py │ ├── transaction_simulate_void_params.py │ ├── transaction_simulate_void_response.py │ ├── transactions │ ├── __init__.py │ ├── enhanced_commercial_data_retrieve_response.py │ └── events │ │ ├── __init__.py │ │ └── enhanced_data.py │ └── verification_method.py └── tests ├── __init__.py ├── api_resources ├── __init__.py ├── auth_rules │ ├── __init__.py │ ├── test_v2.py │ └── v2 │ │ ├── __init__.py │ │ └── test_backtests.py ├── cards │ ├── __init__.py │ ├── test_aggregate_balances.py │ ├── test_balances.py │ └── test_financial_transactions.py ├── credit_products │ ├── __init__.py │ ├── test_extended_credit.py │ └── test_prime_rates.py ├── events │ ├── __init__.py │ ├── test_event_subscriptions.py │ └── test_subscriptions.py ├── external_bank_accounts │ ├── __init__.py │ └── test_micro_deposits.py ├── financial_accounts │ ├── __init__.py │ ├── statements │ │ ├── __init__.py │ │ └── test_line_items.py │ ├── test_balances.py │ ├── test_credit_configuration.py │ ├── test_financial_transactions.py │ ├── test_loan_tapes.py │ └── test_statements.py ├── reports │ ├── __init__.py │ ├── settlement │ │ ├── __init__.py │ │ └── test_network_totals.py │ └── test_settlement.py ├── test_account_holders.py ├── test_accounts.py ├── test_aggregate_balances.py ├── test_auth_stream_enrollment.py ├── test_balances.py ├── test_book_transfers.py ├── test_card_programs.py ├── test_cards.py ├── test_client.py ├── test_digital_card_art.py ├── test_disputes.py ├── test_events.py ├── test_external_bank_accounts.py ├── test_external_payments.py ├── test_financial_accounts.py ├── test_funding_events.py ├── test_management_operations.py ├── test_payments.py ├── test_responder_endpoints.py ├── test_tokenization_decisioning.py ├── test_tokenizations.py ├── test_transactions.py ├── test_webhooks.py ├── three_ds │ ├── __init__.py │ ├── test_authentication.py │ └── test_decisioning.py └── transactions │ ├── __init__.py │ ├── events │ ├── __init__.py │ └── test_enhanced_commercial_data.py │ └── test_enhanced_commercial_data.py ├── conftest.py ├── sample_file.txt ├── test_client.py ├── test_deepcopy.py ├── test_extract_files.py ├── test_files.py ├── test_legacy_response.py ├── test_models.py ├── test_qs.py ├── test_required_args.py ├── test_response.py ├── test_streaming.py ├── test_transform.py ├── test_utils ├── test_proxy.py └── test_typing.py └── utils.py /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VARIANT="3.9" 2 | FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} 3 | 4 | USER vscode 5 | 6 | RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash 7 | ENV PATH=/home/vscode/.rye/shims:$PATH 8 | 9 | RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc 10 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/debian 3 | { 4 | "name": "Debian", 5 | "build": { 6 | "dockerfile": "Dockerfile", 7 | "context": ".." 8 | }, 9 | 10 | "postStartCommand": "rye sync --all-features", 11 | 12 | "customizations": { 13 | "vscode": { 14 | "extensions": [ 15 | "ms-python.python" 16 | ], 17 | "settings": { 18 | "terminal.integrated.shell.linux": "/bin/bash", 19 | "python.pythonPath": ".venv/bin/python", 20 | "python.defaultInterpreterPath": ".venv/bin/python", 21 | "python.typeChecking": "basic", 22 | "terminal.integrated.env.linux": { 23 | "PATH": "/home/vscode/.rye/shims:${env:PATH}" 24 | } 25 | } 26 | } 27 | }, 28 | "features": { 29 | "ghcr.io/devcontainers/features/node:1": {} 30 | } 31 | 32 | // Features to add to the dev container. More info: https://containers.dev/features. 33 | // "features": {}, 34 | 35 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 36 | // "forwardPorts": [], 37 | 38 | // Configure tool-specific properties. 39 | // "customizations": {}, 40 | 41 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 42 | // "remoteUser": "root" 43 | } 44 | -------------------------------------------------------------------------------- /.github/workflows/publish-pypi.yml: -------------------------------------------------------------------------------- 1 | # This workflow is triggered when a GitHub release is created. 2 | # It can also be run manually to re-publish to PyPI in case it failed for some reason. 3 | # You can run this workflow by navigating to https://www.github.com/lithic-com/lithic-python/actions/workflows/publish-pypi.yml 4 | name: Publish PyPI 5 | on: 6 | workflow_dispatch: 7 | 8 | release: 9 | types: [published] 10 | 11 | jobs: 12 | publish: 13 | name: publish 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | - name: Install Rye 20 | run: | 21 | curl -sSf https://rye.astral.sh/get | bash 22 | echo "$HOME/.rye/shims" >> $GITHUB_PATH 23 | env: 24 | RYE_VERSION: '0.44.0' 25 | RYE_INSTALL_OPTION: '--yes' 26 | 27 | - name: Publish to PyPI 28 | run: | 29 | bash ./bin/publish-pypi 30 | env: 31 | PYPI_TOKEN: ${{ secrets.LITHIC_PYPI_TOKEN || secrets.PYPI_TOKEN }} 32 | -------------------------------------------------------------------------------- /.github/workflows/release-doctor.yml: -------------------------------------------------------------------------------- 1 | name: Release Doctor 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | workflow_dispatch: 7 | 8 | jobs: 9 | release_doctor: 10 | name: release doctor 11 | runs-on: ubuntu-latest 12 | if: github.repository == 'lithic-com/lithic-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Check release environment 18 | run: | 19 | bash ./bin/check-release-environment 20 | env: 21 | PYPI_TOKEN: ${{ secrets.LITHIC_PYPI_TOKEN || secrets.PYPI_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .prism.log 2 | .vscode 3 | _dev 4 | 5 | __pycache__ 6 | .mypy_cache 7 | 8 | dist 9 | 10 | .venv 11 | .idea 12 | 13 | .env 14 | .envrc 15 | codegen.log 16 | Brewfile.lock.json 17 | -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.9.18 2 | -------------------------------------------------------------------------------- /.release-please-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | ".": "0.93.0" 3 | } -------------------------------------------------------------------------------- /.stats.yml: -------------------------------------------------------------------------------- 1 | configured_endpoints: 160 2 | openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-025f40c854a9485cf316c9058f9cc5fa37f069add30e409d49ab93f2e166f4fb.yml 3 | openapi_spec_hash: a9391f3a54b8db5d5df40169de8c645c 4 | config_hash: fa3481d1d8505e4157f6cebe93211bd0 5 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | brew "rye" 2 | 3 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting Security Issues 4 | 5 | This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. 6 | 7 | To report a security issue, please contact the Stainless team at security@stainless.com. 8 | 9 | ## Responsible Disclosure 10 | 11 | We appreciate the efforts of security researchers and individuals who help us maintain the security of 12 | SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible 13 | disclosure practices by allowing us a reasonable amount of time to investigate and address the issue 14 | before making any information public. 15 | 16 | ## Reporting Non-SDK Related Security Issues 17 | 18 | If you encounter security issues that are not directly related to SDKs but pertain to the services 19 | or products provided by Lithic please follow the respective company's security reporting guidelines. 20 | 21 | ### Lithic Terms and Policies 22 | 23 | Please contact sdk-feedback@lithic.com for any questions or concerns regarding security of our services. 24 | 25 | --- 26 | 27 | Thank you for helping us keep the SDKs and systems they interact with secure. 28 | -------------------------------------------------------------------------------- /bin/check-release-environment: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | errors=() 4 | 5 | if [ -z "${PYPI_TOKEN}" ]; then 6 | errors+=("The LITHIC_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") 7 | fi 8 | 9 | lenErrors=${#errors[@]} 10 | 11 | if [[ lenErrors -gt 0 ]]; then 12 | echo -e "Found the following errors in the release environment:\n" 13 | 14 | for error in "${errors[@]}"; do 15 | echo -e "- $error\n" 16 | done 17 | 18 | exit 1 19 | fi 20 | 21 | echo "The environment is ready to push releases!" 22 | -------------------------------------------------------------------------------- /bin/publish-pypi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | mkdir -p dist 5 | rye build --clean 6 | rye publish --yes --token=$PYPI_TOKEN 7 | -------------------------------------------------------------------------------- /examples/.keep: -------------------------------------------------------------------------------- 1 | File generated from our OpenAPI spec by Stainless. 2 | 3 | This directory can be used to store example files demonstrating usage of this SDK. 4 | It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. -------------------------------------------------------------------------------- /examples/datetime_usage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S rye run python 2 | 3 | # To run this example locally 4 | # 1. Install Rye and setup a Python virtual environment: ./scripts/bootstrap 5 | # 2. Run the example: LITHIC_API_KEY= rye run python examples/datetime_usage.py 6 | 7 | from datetime import datetime 8 | 9 | from lithic import Lithic 10 | 11 | client = Lithic(environment="sandbox") 12 | 13 | now = datetime.now() 14 | 15 | # datetime responses will always be instances of `datetime` 16 | card = client.cards.create(type="VIRTUAL") 17 | assert isinstance(card.created, datetime) 18 | assert card.created.year == now.year 19 | assert card.created.month == now.month 20 | assert card.created.tzname() == "UTC" 21 | 22 | dt = datetime.fromisoformat("2022-07-25T21:34:45+00:00") 23 | 24 | # # both `datetime` instances or datetime strings can be passed as a request param 25 | page = client.cards.list(begin=dt, page_size=1) 26 | assert len(page.data) == 1 27 | 28 | page = client.cards.list(begin=dt.isoformat(), page_size=1) 29 | assert len(page.data) == 1 30 | -------------------------------------------------------------------------------- /examples/hello_sailor.txt: -------------------------------------------------------------------------------- 1 | Hello, Sailor! 2 | -------------------------------------------------------------------------------- /examples/hello_world.txt: -------------------------------------------------------------------------------- 1 | Hello, World! 2 | -------------------------------------------------------------------------------- /examples/upload_evidence.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S rye run python 2 | 3 | # To run this example locally 4 | # 1. Install Rye and setup a Python virtual environment: ./scripts/bootstrap 5 | # 2. Run the example: LITHIC_API_KEY= rye run python examples/upload_evidence.py 6 | 7 | 8 | from lithic import Lithic, file_from_path 9 | 10 | client = Lithic(environment="sandbox") 11 | 12 | transactions_page = client.transactions.list() 13 | assert len(transactions_page.data) > 0, "No transactions found" 14 | 15 | transaction = transactions_page.data[0] 16 | assert transaction.token, "Transaction must have a token" 17 | 18 | disputes_page = client.disputes.list() 19 | dispute = disputes_page.data[0] 20 | if not dispute: 21 | dispute = client.disputes.create( 22 | amount=42, 23 | reason="ATM_CASH_MISDISPENSE", 24 | transaction_token=transaction.token, 25 | ) 26 | 27 | print(dispute) 28 | assert dispute, "Could not find or create a dispute" 29 | 30 | my_file = file_from_path("hello_world.txt") 31 | 32 | upload = client.disputes.upload_evidence(dispute.token, my_file) 33 | print(upload) 34 | 35 | print("Done!") 36 | -------------------------------------------------------------------------------- /integrations/pagination.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S rye run python integrations/pagination.py 2 | 3 | from __future__ import annotations 4 | 5 | import json 6 | 7 | from lithic import Lithic 8 | 9 | client = Lithic(environment="sandbox") 10 | 11 | 12 | def main() -> None: 13 | page = client.transactions.list() 14 | assert len(page.data) > 0, "No transactions found" 15 | 16 | if not page.has_more or not page.has_next_page(): 17 | raise RuntimeError(f"Expected multiple pages to be present, only got {len(page.data)} items") 18 | 19 | tokens: dict[str, int] = {} 20 | 21 | for transaction in page: 22 | tokens[transaction.token] = tokens.get(transaction.token, 0) + 1 23 | 24 | duplicates = {token: count for token, count in tokens.items() if count > 1} 25 | if duplicates: 26 | print(json.dumps(duplicates, indent=2)) # noqa: T201 27 | raise RuntimeError(f"Found {len(duplicates)} duplicate entries!") 28 | 29 | print("Success!") # noqa: T201 30 | 31 | 32 | main() 33 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | pretty = True 3 | show_error_codes = True 4 | 5 | # Exclude _files.py because mypy isn't smart enough to apply 6 | # the correct type narrowing and as this is an internal module 7 | # it's fine to just use Pyright. 8 | # 9 | # We also exclude our `tests` as mypy doesn't always infer 10 | # types correctly and Pyright will still catch any type errors. 11 | exclude = ^(src/lithic/_files\.py|_dev/.*\.py|tests/.*)$ 12 | 13 | strict_equality = True 14 | implicit_reexport = True 15 | check_untyped_defs = True 16 | no_implicit_optional = True 17 | 18 | warn_return_any = True 19 | warn_unreachable = True 20 | warn_unused_configs = True 21 | 22 | # Turn these options off as it could cause conflicts 23 | # with the Pyright options. 24 | warn_unused_ignores = False 25 | warn_redundant_casts = False 26 | 27 | disallow_any_generics = True 28 | disallow_untyped_defs = True 29 | disallow_untyped_calls = True 30 | disallow_subclassing_any = True 31 | disallow_incomplete_defs = True 32 | disallow_untyped_decorators = True 33 | cache_fine_grained = True 34 | 35 | # By default, mypy reports an error if you assign a value to the result 36 | # of a function call that doesn't return anything. We do this in our test 37 | # cases: 38 | # ``` 39 | # result = ... 40 | # assert result is None 41 | # ``` 42 | # Changing this codegen to make mypy happy would increase complexity 43 | # and would not be worth it. 44 | disable_error_code = func-returns-value,overload-cannot-match 45 | 46 | # https://github.com/python/mypy/issues/12162 47 | [mypy.overrides] 48 | module = "black.files.*" 49 | ignore_errors = true 50 | ignore_missing_imports = true 51 | -------------------------------------------------------------------------------- /noxfile.py: -------------------------------------------------------------------------------- 1 | import nox 2 | 3 | 4 | @nox.session(reuse_venv=True, name="test-pydantic-v1") 5 | def test_pydantic_v1(session: nox.Session) -> None: 6 | session.install("-r", "requirements-dev.lock") 7 | session.install("pydantic<2") 8 | 9 | session.run("pytest", "--showlocals", "--ignore=tests/functional", *session.posargs) 10 | -------------------------------------------------------------------------------- /release-please-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": { 3 | ".": {} 4 | }, 5 | "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", 6 | "include-v-in-tag": true, 7 | "include-component-in-tag": false, 8 | "versioning": "prerelease", 9 | "prerelease": true, 10 | "bump-minor-pre-major": true, 11 | "bump-patch-for-minor-pre-major": false, 12 | "pull-request-header": "Automated Release PR", 13 | "pull-request-title-pattern": "release: ${version}", 14 | "changelog-sections": [ 15 | { 16 | "type": "feat", 17 | "section": "Features" 18 | }, 19 | { 20 | "type": "fix", 21 | "section": "Bug Fixes" 22 | }, 23 | { 24 | "type": "perf", 25 | "section": "Performance Improvements" 26 | }, 27 | { 28 | "type": "revert", 29 | "section": "Reverts" 30 | }, 31 | { 32 | "type": "chore", 33 | "section": "Chores" 34 | }, 35 | { 36 | "type": "docs", 37 | "section": "Documentation" 38 | }, 39 | { 40 | "type": "style", 41 | "section": "Styles" 42 | }, 43 | { 44 | "type": "refactor", 45 | "section": "Refactors" 46 | }, 47 | { 48 | "type": "test", 49 | "section": "Tests", 50 | "hidden": true 51 | }, 52 | { 53 | "type": "build", 54 | "section": "Build System" 55 | }, 56 | { 57 | "type": "ci", 58 | "section": "Continuous Integration", 59 | "hidden": true 60 | } 61 | ], 62 | "release-type": "python", 63 | "extra-files": [ 64 | "src/lithic/_version.py" 65 | ] 66 | } -------------------------------------------------------------------------------- /requirements.lock: -------------------------------------------------------------------------------- 1 | # generated by rye 2 | # use `rye lock` or `rye sync` to update this lockfile 3 | # 4 | # last locked with the following flags: 5 | # pre: false 6 | # features: [] 7 | # all-features: true 8 | # with-sources: false 9 | # generate-hashes: false 10 | # universal: false 11 | 12 | -e file:. 13 | annotated-types==0.6.0 14 | # via pydantic 15 | anyio==4.4.0 16 | # via httpx 17 | # via lithic 18 | certifi==2023.7.22 19 | # via httpcore 20 | # via httpx 21 | distro==1.8.0 22 | # via lithic 23 | exceptiongroup==1.2.2 24 | # via anyio 25 | h11==0.14.0 26 | # via httpcore 27 | httpcore==1.0.2 28 | # via httpx 29 | httpx==0.28.1 30 | # via lithic 31 | idna==3.4 32 | # via anyio 33 | # via httpx 34 | pydantic==2.10.3 35 | # via lithic 36 | pydantic-core==2.27.1 37 | # via pydantic 38 | sniffio==1.3.0 39 | # via anyio 40 | # via lithic 41 | typing-extensions==4.12.2 42 | # via anyio 43 | # via lithic 44 | # via pydantic 45 | # via pydantic-core 46 | -------------------------------------------------------------------------------- /scripts/bootstrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then 8 | brew bundle check >/dev/null 2>&1 || { 9 | echo "==> Installing Homebrew dependencies…" 10 | brew bundle 11 | } 12 | fi 13 | 14 | echo "==> Installing Python dependencies…" 15 | 16 | # experimental uv support makes installations significantly faster 17 | rye config --set-bool behavior.use-uv=true 18 | 19 | rye sync --all-features 20 | -------------------------------------------------------------------------------- /scripts/format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | echo "==> Running formatters" 8 | rye run format 9 | -------------------------------------------------------------------------------- /scripts/lint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | echo "==> Running lints" 8 | rye run lint 9 | 10 | echo "==> Making sure it imports" 11 | rye run python -c 'import lithic' 12 | -------------------------------------------------------------------------------- /scripts/mock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | if [[ -n "$1" && "$1" != '--'* ]]; then 8 | URL="$1" 9 | shift 10 | else 11 | URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" 12 | fi 13 | 14 | # Check if the URL is empty 15 | if [ -z "$URL" ]; then 16 | echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" 17 | exit 1 18 | fi 19 | 20 | echo "==> Starting mock server with URL ${URL}" 21 | 22 | # Run prism mock on the given spec 23 | if [ "$1" == "--daemon" ]; then 24 | npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & 25 | 26 | # Wait for server to come online 27 | echo -n "Waiting for server" 28 | while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do 29 | echo -n "." 30 | sleep 0.1 31 | done 32 | 33 | if grep -q "✖ fatal" ".prism.log"; then 34 | cat .prism.log 35 | exit 1 36 | fi 37 | 38 | echo 39 | else 40 | npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" 41 | fi 42 | -------------------------------------------------------------------------------- /scripts/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | RED='\033[0;31m' 8 | GREEN='\033[0;32m' 9 | YELLOW='\033[0;33m' 10 | NC='\033[0m' # No Color 11 | 12 | function prism_is_running() { 13 | curl --silent "http://localhost:4010" >/dev/null 2>&1 14 | } 15 | 16 | kill_server_on_port() { 17 | pids=$(lsof -t -i tcp:"$1" || echo "") 18 | if [ "$pids" != "" ]; then 19 | kill "$pids" 20 | echo "Stopped $pids." 21 | fi 22 | } 23 | 24 | function is_overriding_api_base_url() { 25 | [ -n "$TEST_API_BASE_URL" ] 26 | } 27 | 28 | if ! is_overriding_api_base_url && ! prism_is_running ; then 29 | # When we exit this script, make sure to kill the background mock server process 30 | trap 'kill_server_on_port 4010' EXIT 31 | 32 | # Start the dev server 33 | ./scripts/mock --daemon 34 | fi 35 | 36 | if is_overriding_api_base_url ; then 37 | echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" 38 | echo 39 | elif ! prism_is_running ; then 40 | echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" 41 | echo -e "running against your OpenAPI spec." 42 | echo 43 | echo -e "To run the server, pass in the path or url of your OpenAPI" 44 | echo -e "spec to the prism command:" 45 | echo 46 | echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" 47 | echo 48 | 49 | exit 1 50 | else 51 | echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" 52 | echo 53 | fi 54 | 55 | export DEFER_PYDANTIC_BUILD=false 56 | 57 | echo "==> Running tests" 58 | rye run pytest "$@" 59 | 60 | echo "==> Running Pydantic v1 tests" 61 | rye run nox -s test-pydantic-v1 -- "$@" 62 | -------------------------------------------------------------------------------- /scripts/utils/upload-artifact.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -exuo pipefail 3 | 4 | RESPONSE=$(curl -X POST "$URL" \ 5 | -H "Authorization: Bearer $AUTH" \ 6 | -H "Content-Type: application/json") 7 | 8 | SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') 9 | 10 | if [[ "$SIGNED_URL" == "null" ]]; then 11 | echo -e "\033[31mFailed to get signed URL.\033[0m" 12 | exit 1 13 | fi 14 | 15 | UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ 16 | -H "Content-Type: application/gzip" \ 17 | --data-binary @- "$SIGNED_URL" 2>&1) 18 | 19 | if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then 20 | echo -e "\033[32mUploaded build to Stainless storage.\033[0m" 21 | echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/lithic-python/$SHA'\033[0m" 22 | else 23 | echo -e "\033[31mFailed to upload artifact.\033[0m" 24 | exit 1 25 | fi 26 | -------------------------------------------------------------------------------- /src/lithic/_constants.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | import httpx 4 | 5 | RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" 6 | OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" 7 | 8 | # default timeout is 1 minute 9 | DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) 10 | DEFAULT_MAX_RETRIES = 2 11 | DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) 12 | 13 | INITIAL_RETRY_DELAY = 0.5 14 | MAX_RETRY_DELAY = 8.0 15 | -------------------------------------------------------------------------------- /src/lithic/_resource.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | import time 6 | from typing import TYPE_CHECKING 7 | 8 | import anyio 9 | 10 | if TYPE_CHECKING: 11 | from ._client import Lithic, AsyncLithic 12 | 13 | 14 | class SyncAPIResource: 15 | _client: Lithic 16 | 17 | def __init__(self, client: Lithic) -> None: 18 | self._client = client 19 | self._get = client.get 20 | self._post = client.post 21 | self._patch = client.patch 22 | self._put = client.put 23 | self._delete = client.delete 24 | self._get_api_list = client.get_api_list 25 | 26 | def _sleep(self, seconds: float) -> None: 27 | time.sleep(seconds) 28 | 29 | 30 | class AsyncAPIResource: 31 | _client: AsyncLithic 32 | 33 | def __init__(self, client: AsyncLithic) -> None: 34 | self._client = client 35 | self._get = client.get 36 | self._post = client.post 37 | self._patch = client.patch 38 | self._put = client.put 39 | self._delete = client.delete 40 | self._get_api_list = client.get_api_list 41 | 42 | async def _sleep(self, seconds: float) -> None: 43 | await anyio.sleep(seconds) 44 | -------------------------------------------------------------------------------- /src/lithic/_utils/_logs.py: -------------------------------------------------------------------------------- 1 | import os 2 | import logging 3 | 4 | logger: logging.Logger = logging.getLogger("lithic") 5 | httpx_logger: logging.Logger = logging.getLogger("httpx") 6 | 7 | 8 | def _basic_config() -> None: 9 | # e.g. [2023-10-05 14:12:26 - lithic._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" 10 | logging.basicConfig( 11 | format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", 12 | datefmt="%Y-%m-%d %H:%M:%S", 13 | ) 14 | 15 | 16 | def setup_logging() -> None: 17 | env = os.environ.get("LITHIC_LOG") 18 | if env == "debug": 19 | _basic_config() 20 | logger.setLevel(logging.DEBUG) 21 | httpx_logger.setLevel(logging.DEBUG) 22 | elif env == "info": 23 | _basic_config() 24 | logger.setLevel(logging.INFO) 25 | httpx_logger.setLevel(logging.INFO) 26 | -------------------------------------------------------------------------------- /src/lithic/_utils/_reflection.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import inspect 4 | from typing import Any, Callable 5 | 6 | 7 | def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool: 8 | """Returns whether or not the given function has a specific parameter""" 9 | sig = inspect.signature(func) 10 | return arg_name in sig.parameters 11 | 12 | 13 | def assert_signatures_in_sync( 14 | source_func: Callable[..., Any], 15 | check_func: Callable[..., Any], 16 | *, 17 | exclude_params: set[str] = set(), 18 | ) -> None: 19 | """Ensure that the signature of the second function matches the first.""" 20 | 21 | check_sig = inspect.signature(check_func) 22 | source_sig = inspect.signature(source_func) 23 | 24 | errors: list[str] = [] 25 | 26 | for name, source_param in source_sig.parameters.items(): 27 | if name in exclude_params: 28 | continue 29 | 30 | custom_param = check_sig.parameters.get(name) 31 | if not custom_param: 32 | errors.append(f"the `{name}` param is missing") 33 | continue 34 | 35 | if custom_param.annotation != source_param.annotation: 36 | errors.append( 37 | f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(custom_param.annotation)}" 38 | ) 39 | continue 40 | 41 | if errors: 42 | raise AssertionError(f"{len(errors)} errors encountered when comparing signatures:\n\n" + "\n\n".join(errors)) 43 | -------------------------------------------------------------------------------- /src/lithic/_utils/_resources_proxy.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Any 4 | from typing_extensions import override 5 | 6 | from ._proxy import LazyProxy 7 | 8 | 9 | class ResourcesProxy(LazyProxy[Any]): 10 | """A proxy for the `lithic.resources` module. 11 | 12 | This is used so that we can lazily import `lithic.resources` only when 13 | needed *and* so that users can just import `lithic` and reference `lithic.resources` 14 | """ 15 | 16 | @override 17 | def __load__(self) -> Any: 18 | import importlib 19 | 20 | mod = importlib.import_module("lithic.resources") 21 | return mod 22 | 23 | 24 | resources = ResourcesProxy().__as_proxied__() 25 | -------------------------------------------------------------------------------- /src/lithic/_utils/_streams.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing_extensions import Iterator, AsyncIterator 3 | 4 | 5 | def consume_sync_iterator(iterator: Iterator[Any]) -> None: 6 | for _ in iterator: 7 | ... 8 | 9 | 10 | async def consume_async_iterator(iterator: AsyncIterator[Any]) -> None: 11 | async for _ in iterator: 12 | ... 13 | -------------------------------------------------------------------------------- /src/lithic/_version.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | __title__ = "lithic" 4 | __version__ = "0.93.0" # x-release-please-version 5 | -------------------------------------------------------------------------------- /src/lithic/lib/.keep: -------------------------------------------------------------------------------- 1 | File generated from our OpenAPI spec by Stainless. 2 | 3 | This directory can be used to store custom files to expand the SDK. 4 | It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. -------------------------------------------------------------------------------- /src/lithic/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lithic-com/lithic-python/bec2ddfb55ac7de9602e0a1d776a3e33729d6dd6/src/lithic/py.typed -------------------------------------------------------------------------------- /src/lithic/resources/auth_rules/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .v2 import ( 4 | V2, 5 | AsyncV2, 6 | V2WithRawResponse, 7 | AsyncV2WithRawResponse, 8 | V2WithStreamingResponse, 9 | AsyncV2WithStreamingResponse, 10 | ) 11 | from .auth_rules import ( 12 | AuthRules, 13 | AsyncAuthRules, 14 | AuthRulesWithRawResponse, 15 | AsyncAuthRulesWithRawResponse, 16 | AuthRulesWithStreamingResponse, 17 | AsyncAuthRulesWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "V2", 22 | "AsyncV2", 23 | "V2WithRawResponse", 24 | "AsyncV2WithRawResponse", 25 | "V2WithStreamingResponse", 26 | "AsyncV2WithStreamingResponse", 27 | "AuthRules", 28 | "AsyncAuthRules", 29 | "AuthRulesWithRawResponse", 30 | "AsyncAuthRulesWithRawResponse", 31 | "AuthRulesWithStreamingResponse", 32 | "AsyncAuthRulesWithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/resources/auth_rules/v2/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .v2 import ( 4 | V2, 5 | AsyncV2, 6 | V2WithRawResponse, 7 | AsyncV2WithRawResponse, 8 | V2WithStreamingResponse, 9 | AsyncV2WithStreamingResponse, 10 | ) 11 | from .backtests import ( 12 | Backtests, 13 | AsyncBacktests, 14 | BacktestsWithRawResponse, 15 | AsyncBacktestsWithRawResponse, 16 | BacktestsWithStreamingResponse, 17 | AsyncBacktestsWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "Backtests", 22 | "AsyncBacktests", 23 | "BacktestsWithRawResponse", 24 | "AsyncBacktestsWithRawResponse", 25 | "BacktestsWithStreamingResponse", 26 | "AsyncBacktestsWithStreamingResponse", 27 | "V2", 28 | "AsyncV2", 29 | "V2WithRawResponse", 30 | "AsyncV2WithRawResponse", 31 | "V2WithStreamingResponse", 32 | "AsyncV2WithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/resources/credit_products/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .prime_rates import ( 4 | PrimeRates, 5 | AsyncPrimeRates, 6 | PrimeRatesWithRawResponse, 7 | AsyncPrimeRatesWithRawResponse, 8 | PrimeRatesWithStreamingResponse, 9 | AsyncPrimeRatesWithStreamingResponse, 10 | ) 11 | from .credit_products import ( 12 | CreditProducts, 13 | AsyncCreditProducts, 14 | CreditProductsWithRawResponse, 15 | AsyncCreditProductsWithRawResponse, 16 | CreditProductsWithStreamingResponse, 17 | AsyncCreditProductsWithStreamingResponse, 18 | ) 19 | from .extended_credit import ( 20 | ExtendedCreditResource, 21 | AsyncExtendedCreditResource, 22 | ExtendedCreditResourceWithRawResponse, 23 | AsyncExtendedCreditResourceWithRawResponse, 24 | ExtendedCreditResourceWithStreamingResponse, 25 | AsyncExtendedCreditResourceWithStreamingResponse, 26 | ) 27 | 28 | __all__ = [ 29 | "ExtendedCreditResource", 30 | "AsyncExtendedCreditResource", 31 | "ExtendedCreditResourceWithRawResponse", 32 | "AsyncExtendedCreditResourceWithRawResponse", 33 | "ExtendedCreditResourceWithStreamingResponse", 34 | "AsyncExtendedCreditResourceWithStreamingResponse", 35 | "PrimeRates", 36 | "AsyncPrimeRates", 37 | "PrimeRatesWithRawResponse", 38 | "AsyncPrimeRatesWithRawResponse", 39 | "PrimeRatesWithStreamingResponse", 40 | "AsyncPrimeRatesWithStreamingResponse", 41 | "CreditProducts", 42 | "AsyncCreditProducts", 43 | "CreditProductsWithRawResponse", 44 | "AsyncCreditProductsWithRawResponse", 45 | "CreditProductsWithStreamingResponse", 46 | "AsyncCreditProductsWithStreamingResponse", 47 | ] 48 | -------------------------------------------------------------------------------- /src/lithic/resources/events/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .events import ( 4 | Events, 5 | AsyncEvents, 6 | EventsWithRawResponse, 7 | AsyncEventsWithRawResponse, 8 | EventsWithStreamingResponse, 9 | AsyncEventsWithStreamingResponse, 10 | ) 11 | from .subscriptions import ( 12 | Subscriptions, 13 | AsyncSubscriptions, 14 | SubscriptionsWithRawResponse, 15 | AsyncSubscriptionsWithRawResponse, 16 | SubscriptionsWithStreamingResponse, 17 | AsyncSubscriptionsWithStreamingResponse, 18 | ) 19 | from .event_subscriptions import ( 20 | EventSubscriptions, 21 | AsyncEventSubscriptions, 22 | EventSubscriptionsWithRawResponse, 23 | AsyncEventSubscriptionsWithRawResponse, 24 | EventSubscriptionsWithStreamingResponse, 25 | AsyncEventSubscriptionsWithStreamingResponse, 26 | ) 27 | 28 | __all__ = [ 29 | "Subscriptions", 30 | "AsyncSubscriptions", 31 | "SubscriptionsWithRawResponse", 32 | "AsyncSubscriptionsWithRawResponse", 33 | "SubscriptionsWithStreamingResponse", 34 | "AsyncSubscriptionsWithStreamingResponse", 35 | "EventSubscriptions", 36 | "AsyncEventSubscriptions", 37 | "EventSubscriptionsWithRawResponse", 38 | "AsyncEventSubscriptionsWithRawResponse", 39 | "EventSubscriptionsWithStreamingResponse", 40 | "AsyncEventSubscriptionsWithStreamingResponse", 41 | "Events", 42 | "AsyncEvents", 43 | "EventsWithRawResponse", 44 | "AsyncEventsWithRawResponse", 45 | "EventsWithStreamingResponse", 46 | "AsyncEventsWithStreamingResponse", 47 | ] 48 | -------------------------------------------------------------------------------- /src/lithic/resources/external_bank_accounts/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .micro_deposits import ( 4 | MicroDeposits, 5 | AsyncMicroDeposits, 6 | MicroDepositsWithRawResponse, 7 | AsyncMicroDepositsWithRawResponse, 8 | MicroDepositsWithStreamingResponse, 9 | AsyncMicroDepositsWithStreamingResponse, 10 | ) 11 | from .external_bank_accounts import ( 12 | ExternalBankAccounts, 13 | AsyncExternalBankAccounts, 14 | ExternalBankAccountsWithRawResponse, 15 | AsyncExternalBankAccountsWithRawResponse, 16 | ExternalBankAccountsWithStreamingResponse, 17 | AsyncExternalBankAccountsWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "MicroDeposits", 22 | "AsyncMicroDeposits", 23 | "MicroDepositsWithRawResponse", 24 | "AsyncMicroDepositsWithRawResponse", 25 | "MicroDepositsWithStreamingResponse", 26 | "AsyncMicroDepositsWithStreamingResponse", 27 | "ExternalBankAccounts", 28 | "AsyncExternalBankAccounts", 29 | "ExternalBankAccountsWithRawResponse", 30 | "AsyncExternalBankAccountsWithRawResponse", 31 | "ExternalBankAccountsWithStreamingResponse", 32 | "AsyncExternalBankAccountsWithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/resources/financial_accounts/statements/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .line_items import ( 4 | LineItems, 5 | AsyncLineItems, 6 | LineItemsWithRawResponse, 7 | AsyncLineItemsWithRawResponse, 8 | LineItemsWithStreamingResponse, 9 | AsyncLineItemsWithStreamingResponse, 10 | ) 11 | from .statements import ( 12 | Statements, 13 | AsyncStatements, 14 | StatementsWithRawResponse, 15 | AsyncStatementsWithRawResponse, 16 | StatementsWithStreamingResponse, 17 | AsyncStatementsWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "LineItems", 22 | "AsyncLineItems", 23 | "LineItemsWithRawResponse", 24 | "AsyncLineItemsWithRawResponse", 25 | "LineItemsWithStreamingResponse", 26 | "AsyncLineItemsWithStreamingResponse", 27 | "Statements", 28 | "AsyncStatements", 29 | "StatementsWithRawResponse", 30 | "AsyncStatementsWithRawResponse", 31 | "StatementsWithStreamingResponse", 32 | "AsyncStatementsWithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/resources/reports/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .reports import ( 4 | Reports, 5 | AsyncReports, 6 | ReportsWithRawResponse, 7 | AsyncReportsWithRawResponse, 8 | ReportsWithStreamingResponse, 9 | AsyncReportsWithStreamingResponse, 10 | ) 11 | from .settlement import ( 12 | Settlement, 13 | AsyncSettlement, 14 | SettlementWithRawResponse, 15 | AsyncSettlementWithRawResponse, 16 | SettlementWithStreamingResponse, 17 | AsyncSettlementWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "Settlement", 22 | "AsyncSettlement", 23 | "SettlementWithRawResponse", 24 | "AsyncSettlementWithRawResponse", 25 | "SettlementWithStreamingResponse", 26 | "AsyncSettlementWithStreamingResponse", 27 | "Reports", 28 | "AsyncReports", 29 | "ReportsWithRawResponse", 30 | "AsyncReportsWithRawResponse", 31 | "ReportsWithStreamingResponse", 32 | "AsyncReportsWithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/resources/reports/settlement/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .settlement import ( 4 | Settlement, 5 | AsyncSettlement, 6 | SettlementWithRawResponse, 7 | AsyncSettlementWithRawResponse, 8 | SettlementWithStreamingResponse, 9 | AsyncSettlementWithStreamingResponse, 10 | ) 11 | from .network_totals import ( 12 | NetworkTotals, 13 | AsyncNetworkTotals, 14 | NetworkTotalsWithRawResponse, 15 | AsyncNetworkTotalsWithRawResponse, 16 | NetworkTotalsWithStreamingResponse, 17 | AsyncNetworkTotalsWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "NetworkTotals", 22 | "AsyncNetworkTotals", 23 | "NetworkTotalsWithRawResponse", 24 | "AsyncNetworkTotalsWithRawResponse", 25 | "NetworkTotalsWithStreamingResponse", 26 | "AsyncNetworkTotalsWithStreamingResponse", 27 | "Settlement", 28 | "AsyncSettlement", 29 | "SettlementWithRawResponse", 30 | "AsyncSettlementWithRawResponse", 31 | "SettlementWithStreamingResponse", 32 | "AsyncSettlementWithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/resources/three_ds/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .three_ds import ( 4 | ThreeDS, 5 | AsyncThreeDS, 6 | ThreeDSWithRawResponse, 7 | AsyncThreeDSWithRawResponse, 8 | ThreeDSWithStreamingResponse, 9 | AsyncThreeDSWithStreamingResponse, 10 | ) 11 | from .decisioning import ( 12 | Decisioning, 13 | AsyncDecisioning, 14 | DecisioningWithRawResponse, 15 | AsyncDecisioningWithRawResponse, 16 | DecisioningWithStreamingResponse, 17 | AsyncDecisioningWithStreamingResponse, 18 | ) 19 | from .authentication import ( 20 | Authentication, 21 | AsyncAuthentication, 22 | AuthenticationWithRawResponse, 23 | AsyncAuthenticationWithRawResponse, 24 | AuthenticationWithStreamingResponse, 25 | AsyncAuthenticationWithStreamingResponse, 26 | ) 27 | 28 | __all__ = [ 29 | "Authentication", 30 | "AsyncAuthentication", 31 | "AuthenticationWithRawResponse", 32 | "AsyncAuthenticationWithRawResponse", 33 | "AuthenticationWithStreamingResponse", 34 | "AsyncAuthenticationWithStreamingResponse", 35 | "Decisioning", 36 | "AsyncDecisioning", 37 | "DecisioningWithRawResponse", 38 | "AsyncDecisioningWithRawResponse", 39 | "DecisioningWithStreamingResponse", 40 | "AsyncDecisioningWithStreamingResponse", 41 | "ThreeDS", 42 | "AsyncThreeDS", 43 | "ThreeDSWithRawResponse", 44 | "AsyncThreeDSWithRawResponse", 45 | "ThreeDSWithStreamingResponse", 46 | "AsyncThreeDSWithStreamingResponse", 47 | ] 48 | -------------------------------------------------------------------------------- /src/lithic/resources/transactions/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .events import ( 4 | Events, 5 | AsyncEvents, 6 | EventsWithRawResponse, 7 | AsyncEventsWithRawResponse, 8 | EventsWithStreamingResponse, 9 | AsyncEventsWithStreamingResponse, 10 | ) 11 | from .transactions import ( 12 | Transactions, 13 | AsyncTransactions, 14 | TransactionsWithRawResponse, 15 | AsyncTransactionsWithRawResponse, 16 | TransactionsWithStreamingResponse, 17 | AsyncTransactionsWithStreamingResponse, 18 | ) 19 | from .enhanced_commercial_data import ( 20 | EnhancedCommercialData, 21 | AsyncEnhancedCommercialData, 22 | EnhancedCommercialDataWithRawResponse, 23 | AsyncEnhancedCommercialDataWithRawResponse, 24 | EnhancedCommercialDataWithStreamingResponse, 25 | AsyncEnhancedCommercialDataWithStreamingResponse, 26 | ) 27 | 28 | __all__ = [ 29 | "EnhancedCommercialData", 30 | "AsyncEnhancedCommercialData", 31 | "EnhancedCommercialDataWithRawResponse", 32 | "AsyncEnhancedCommercialDataWithRawResponse", 33 | "EnhancedCommercialDataWithStreamingResponse", 34 | "AsyncEnhancedCommercialDataWithStreamingResponse", 35 | "Events", 36 | "AsyncEvents", 37 | "EventsWithRawResponse", 38 | "AsyncEventsWithRawResponse", 39 | "EventsWithStreamingResponse", 40 | "AsyncEventsWithStreamingResponse", 41 | "Transactions", 42 | "AsyncTransactions", 43 | "TransactionsWithRawResponse", 44 | "AsyncTransactionsWithRawResponse", 45 | "TransactionsWithStreamingResponse", 46 | "AsyncTransactionsWithStreamingResponse", 47 | ] 48 | -------------------------------------------------------------------------------- /src/lithic/resources/transactions/events/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .events import ( 4 | Events, 5 | AsyncEvents, 6 | EventsWithRawResponse, 7 | AsyncEventsWithRawResponse, 8 | EventsWithStreamingResponse, 9 | AsyncEventsWithStreamingResponse, 10 | ) 11 | from .enhanced_commercial_data import ( 12 | EnhancedCommercialData, 13 | AsyncEnhancedCommercialData, 14 | EnhancedCommercialDataWithRawResponse, 15 | AsyncEnhancedCommercialDataWithRawResponse, 16 | EnhancedCommercialDataWithStreamingResponse, 17 | AsyncEnhancedCommercialDataWithStreamingResponse, 18 | ) 19 | 20 | __all__ = [ 21 | "EnhancedCommercialData", 22 | "AsyncEnhancedCommercialData", 23 | "EnhancedCommercialDataWithRawResponse", 24 | "AsyncEnhancedCommercialDataWithRawResponse", 25 | "EnhancedCommercialDataWithStreamingResponse", 26 | "AsyncEnhancedCommercialDataWithStreamingResponse", 27 | "Events", 28 | "AsyncEvents", 29 | "EventsWithRawResponse", 30 | "AsyncEventsWithRawResponse", 31 | "EventsWithStreamingResponse", 32 | "AsyncEventsWithStreamingResponse", 33 | ] 34 | -------------------------------------------------------------------------------- /src/lithic/types/account_holder_list_documents_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | 5 | from .._models import BaseModel 6 | from .shared.document import Document 7 | 8 | __all__ = ["AccountHolderListDocumentsResponse"] 9 | 10 | 11 | class AccountHolderListDocumentsResponse(BaseModel): 12 | data: Optional[List[Document]] = None 13 | -------------------------------------------------------------------------------- /src/lithic/types/account_holder_simulate_enrollment_document_review_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import List 6 | from typing_extensions import Literal, Required, TypedDict 7 | 8 | __all__ = ["AccountHolderSimulateEnrollmentDocumentReviewParams"] 9 | 10 | 11 | class AccountHolderSimulateEnrollmentDocumentReviewParams(TypedDict, total=False): 12 | document_upload_token: Required[str] 13 | """The account holder document upload which to perform the simulation upon.""" 14 | 15 | status: Required[Literal["UPLOADED", "ACCEPTED", "REJECTED", "PARTIAL_APPROVAL"]] 16 | """An account holder document's upload status for use within the simulation.""" 17 | 18 | accepted_entity_status_reasons: List[str] 19 | """A list of status reasons associated with a KYB account holder in PENDING_REVIEW""" 20 | 21 | status_reason: Literal[ 22 | "DOCUMENT_MISSING_REQUIRED_DATA", 23 | "DOCUMENT_UPLOAD_TOO_BLURRY", 24 | "FILE_SIZE_TOO_LARGE", 25 | "INVALID_DOCUMENT_TYPE", 26 | "INVALID_DOCUMENT_UPLOAD", 27 | "INVALID_ENTITY", 28 | "DOCUMENT_EXPIRED", 29 | "DOCUMENT_ISSUED_GREATER_THAN_30_DAYS", 30 | "DOCUMENT_TYPE_NOT_SUPPORTED", 31 | "UNKNOWN_FAILURE_REASON", 32 | "UNKNOWN_ERROR", 33 | ] 34 | """Status reason that will be associated with the simulated account holder status. 35 | 36 | Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. 37 | """ 38 | -------------------------------------------------------------------------------- /src/lithic/types/account_holder_simulate_enrollment_review_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import List 6 | from typing_extensions import Literal, TypedDict 7 | 8 | __all__ = ["AccountHolderSimulateEnrollmentReviewParams"] 9 | 10 | 11 | class AccountHolderSimulateEnrollmentReviewParams(TypedDict, total=False): 12 | account_holder_token: str 13 | """The account holder which to perform the simulation upon.""" 14 | 15 | status: Literal["ACCEPTED", "REJECTED"] 16 | """An account holder's status for use within the simulation.""" 17 | 18 | status_reasons: List[ 19 | Literal[ 20 | "PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE", 21 | "PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE", 22 | "PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE", 23 | "PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED", 24 | "PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE", 25 | "PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED", 26 | "PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE", 27 | "PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE", 28 | "PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE", 29 | "CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE", 30 | "CONTROL_PERSON_ID_VERIFICATION_FAILURE", 31 | "CONTROL_PERSON_DOB_VERIFICATION_FAILURE", 32 | "CONTROL_PERSON_NAME_VERIFICATION_FAILURE", 33 | "BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE", 34 | "BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE", 35 | "BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE", 36 | "BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE", 37 | ] 38 | ] 39 | """Status reason that will be associated with the simulated account holder status. 40 | 41 | Only required for a `REJECTED` status. 42 | """ 43 | -------------------------------------------------------------------------------- /src/lithic/types/account_holder_upload_document_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["AccountHolderUploadDocumentParams"] 8 | 9 | 10 | class AccountHolderUploadDocumentParams(TypedDict, total=False): 11 | document_type: Required[ 12 | Literal[ 13 | "EIN_LETTER", 14 | "TAX_RETURN", 15 | "OPERATING_AGREEMENT", 16 | "CERTIFICATE_OF_FORMATION", 17 | "DRIVERS_LICENSE", 18 | "PASSPORT", 19 | "PASSPORT_CARD", 20 | "CERTIFICATE_OF_GOOD_STANDING", 21 | "ARTICLES_OF_INCORPORATION", 22 | "ARTICLES_OF_ORGANIZATION", 23 | "BYLAWS", 24 | "GOVERNMENT_BUSINESS_LICENSE", 25 | "PARTNERSHIP_AGREEMENT", 26 | "SS4_FORM", 27 | "BANK_STATEMENT", 28 | "UTILITY_BILL_STATEMENT", 29 | "SSN_CARD", 30 | "ITIN_LETTER", 31 | "FINCEN_BOI_REPORT", 32 | ] 33 | ] 34 | """The type of document to upload""" 35 | 36 | entity_token: Required[str] 37 | """Globally unique identifier for the entity.""" 38 | -------------------------------------------------------------------------------- /src/lithic/types/account_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["AccountListParams"] 12 | 13 | 14 | class AccountListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | -------------------------------------------------------------------------------- /src/lithic/types/address_update_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["AddressUpdateParam"] 8 | 9 | 10 | class AddressUpdateParam(TypedDict, total=False): 11 | address1: str 12 | """Valid deliverable address (no PO boxes).""" 13 | 14 | address2: str 15 | """Unit or apartment number (if applicable).""" 16 | 17 | city: str 18 | """Name of city.""" 19 | 20 | country: str 21 | """Valid country code. 22 | 23 | Only USA is currently supported, entered in uppercase ISO 3166-1 alpha-3 24 | three-character format. 25 | """ 26 | 27 | postal_code: str 28 | """Valid postal code. 29 | 30 | Only USA ZIP codes are currently supported, entered as a five-digit ZIP or 31 | nine-digit ZIP+4. 32 | """ 33 | 34 | state: str 35 | """Valid state code. 36 | 37 | Only USA state codes are currently supported, entered in uppercase ISO 3166-2 38 | two-character format. 39 | """ 40 | -------------------------------------------------------------------------------- /src/lithic/types/aggregate_balance.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from datetime import datetime 4 | from typing_extensions import Literal 5 | 6 | from .._models import BaseModel 7 | 8 | __all__ = ["AggregateBalance"] 9 | 10 | 11 | class AggregateBalance(BaseModel): 12 | available_amount: int 13 | """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" 14 | 15 | created: datetime 16 | """Date and time for when the balance was first created.""" 17 | 18 | currency: str 19 | """3-character alphabetic ISO 4217 code for the local currency of the balance.""" 20 | 21 | financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] 22 | """Type of financial account""" 23 | 24 | last_financial_account_token: str 25 | """ 26 | Globally unique identifier for the financial account that had its balance 27 | updated most recently 28 | """ 29 | 30 | last_transaction_event_token: str 31 | """ 32 | Globally unique identifier for the last transaction event that impacted this 33 | balance 34 | """ 35 | 36 | last_transaction_token: str 37 | """Globally unique identifier for the last transaction that impacted this balance""" 38 | 39 | pending_amount: int 40 | """Funds not available for spend due to card authorizations or pending ACH release. 41 | 42 | Shown in the currency's smallest unit (e.g., cents for USD) 43 | """ 44 | 45 | total_amount: int 46 | """ 47 | The sum of available and pending balance in the currency's smallest unit (e.g., 48 | cents for USD) 49 | """ 50 | 51 | updated: datetime 52 | """Date and time for when the balance was last updated.""" 53 | -------------------------------------------------------------------------------- /src/lithic/types/aggregate_balance_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["AggregateBalanceListParams"] 8 | 9 | 10 | class AggregateBalanceListParams(TypedDict, total=False): 11 | financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] 12 | """Get the aggregate balance for a given Financial Account type.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/api_status.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["APIStatus"] 8 | 9 | 10 | class APIStatus(BaseModel): 11 | message: Optional[str] = None 12 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .v2_list_params import V2ListParams as V2ListParams 6 | from .v2_apply_params import V2ApplyParams as V2ApplyParams 7 | from .v2_draft_params import V2DraftParams as V2DraftParams 8 | from .v2_create_params import V2CreateParams as V2CreateParams 9 | from .v2_list_response import V2ListResponse as V2ListResponse 10 | from .v2_update_params import V2UpdateParams as V2UpdateParams 11 | from .v2_apply_response import V2ApplyResponse as V2ApplyResponse 12 | from .v2_draft_response import V2DraftResponse as V2DraftResponse 13 | from .v2_create_response import V2CreateResponse as V2CreateResponse 14 | from .v2_report_response import V2ReportResponse as V2ReportResponse 15 | from .v2_update_response import V2UpdateResponse as V2UpdateResponse 16 | from .auth_rule_condition import AuthRuleCondition as AuthRuleCondition 17 | from .v2_promote_response import V2PromoteResponse as V2PromoteResponse 18 | from .v2_retrieve_response import V2RetrieveResponse as V2RetrieveResponse 19 | from .conditional_attribute import ConditionalAttribute as ConditionalAttribute 20 | from .velocity_limit_params import VelocityLimitParams as VelocityLimitParams 21 | from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam 22 | from .velocity_limit_params_param import VelocityLimitParamsParam as VelocityLimitParamsParam 23 | from .conditional_block_parameters import ConditionalBlockParameters as ConditionalBlockParameters 24 | from .conditional_block_parameters_param import ConditionalBlockParametersParam as ConditionalBlockParametersParam 25 | from .velocity_limit_params_period_window import VelocityLimitParamsPeriodWindow as VelocityLimitParamsPeriodWindow 26 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/conditional_attribute.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ConditionalAttribute"] 6 | 7 | ConditionalAttribute: TypeAlias = Literal[ 8 | "MCC", 9 | "COUNTRY", 10 | "CURRENCY", 11 | "MERCHANT_ID", 12 | "DESCRIPTOR", 13 | "LIABILITY_SHIFT", 14 | "PAN_ENTRY_MODE", 15 | "TRANSACTION_AMOUNT", 16 | "RISK_SCORE", 17 | "CARD_TRANSACTION_COUNT_15M", 18 | "CARD_TRANSACTION_COUNT_1H", 19 | "CARD_TRANSACTION_COUNT_24H", 20 | "CARD_STATE", 21 | "PIN_ENTERED", 22 | "PIN_STATUS", 23 | "WALLET_TYPE", 24 | ] 25 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/conditional_block_parameters.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | 5 | from ..._models import BaseModel 6 | from .auth_rule_condition import AuthRuleCondition 7 | 8 | __all__ = ["ConditionalBlockParameters"] 9 | 10 | 11 | class ConditionalBlockParameters(BaseModel): 12 | conditions: List[AuthRuleCondition] 13 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/conditional_block_parameters_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Iterable 6 | from typing_extensions import Required, TypedDict 7 | 8 | from .auth_rule_condition_param import AuthRuleConditionParam 9 | 10 | __all__ = ["ConditionalBlockParametersParam"] 11 | 12 | 13 | class ConditionalBlockParametersParam(TypedDict, total=False): 14 | conditions: Required[Iterable[AuthRuleConditionParam]] 15 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .backtest_results import BacktestResults as BacktestResults 6 | from .backtest_create_params import BacktestCreateParams as BacktestCreateParams 7 | from .backtest_create_response import BacktestCreateResponse as BacktestCreateResponse 8 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2/backtest_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ...._utils import PropertyInfo 10 | 11 | __all__ = ["BacktestCreateParams"] 12 | 13 | 14 | class BacktestCreateParams(TypedDict, total=False): 15 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """The end time of the backtest.""" 17 | 18 | start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 19 | """The start time of the backtest.""" 20 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2/backtest_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ...._models import BaseModel 6 | 7 | __all__ = ["BacktestCreateResponse"] 8 | 9 | 10 | class BacktestCreateResponse(BaseModel): 11 | backtest_token: Optional[str] = None 12 | """Auth Rule Backtest Token""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2_apply_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import List, Union 6 | from typing_extensions import Required, TypeAlias, TypedDict 7 | 8 | __all__ = [ 9 | "V2ApplyParams", 10 | "ApplyAuthRuleRequestAccountTokens", 11 | "ApplyAuthRuleRequestCardTokens", 12 | "ApplyAuthRuleRequestProgramLevel", 13 | ] 14 | 15 | 16 | class ApplyAuthRuleRequestAccountTokens(TypedDict, total=False): 17 | account_tokens: Required[List[str]] 18 | """Account tokens to which the Auth Rule applies.""" 19 | 20 | 21 | class ApplyAuthRuleRequestCardTokens(TypedDict, total=False): 22 | card_tokens: Required[List[str]] 23 | """Card tokens to which the Auth Rule applies.""" 24 | 25 | 26 | class ApplyAuthRuleRequestProgramLevel(TypedDict, total=False): 27 | program_level: Required[bool] 28 | """Whether the Auth Rule applies to all authorizations on the card program.""" 29 | 30 | excluded_card_tokens: List[str] 31 | """Card tokens to which the Auth Rule does not apply.""" 32 | 33 | 34 | V2ApplyParams: TypeAlias = Union[ 35 | ApplyAuthRuleRequestAccountTokens, ApplyAuthRuleRequestCardTokens, ApplyAuthRuleRequestProgramLevel 36 | ] 37 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2_draft_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union, Iterable, Optional 6 | from typing_extensions import Required, TypeAlias, TypedDict 7 | 8 | from .velocity_limit_params_param import VelocityLimitParamsParam 9 | from .conditional_block_parameters_param import ConditionalBlockParametersParam 10 | 11 | __all__ = [ 12 | "V2DraftParams", 13 | "Parameters", 14 | "ParametersMerchantLockParameters", 15 | "ParametersMerchantLockParametersMerchant", 16 | ] 17 | 18 | 19 | class V2DraftParams(TypedDict, total=False): 20 | parameters: Optional[Parameters] 21 | """Parameters for the Auth Rule""" 22 | 23 | 24 | class ParametersMerchantLockParametersMerchant(TypedDict, total=False): 25 | comment: str 26 | """ 27 | A comment or explanation about the merchant, used internally for rule management 28 | purposes. 29 | """ 30 | 31 | descriptor: str 32 | """ 33 | Short description of the merchant, often used to provide more human-readable 34 | context about the transaction merchant. This is typically the name or label 35 | shown on transaction summaries. 36 | """ 37 | 38 | merchant_id: str 39 | """Unique alphanumeric identifier for the payment card acceptor (merchant). 40 | 41 | This attribute specifies the merchant entity that will be locked or referenced 42 | for authorization rules. 43 | """ 44 | 45 | 46 | class ParametersMerchantLockParameters(TypedDict, total=False): 47 | merchants: Required[Iterable[ParametersMerchantLockParametersMerchant]] 48 | """ 49 | A list of merchant locks defining specific merchants or groups of merchants 50 | (based on descriptors or IDs) that the lock applies to. 51 | """ 52 | 53 | 54 | Parameters: TypeAlias = Union[ 55 | ConditionalBlockParametersParam, VelocityLimitParamsParam, ParametersMerchantLockParameters 56 | ] 57 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["V2ListParams"] 8 | 9 | 10 | class V2ListParams(TypedDict, total=False): 11 | account_token: str 12 | """Only return Authorization Rules that are bound to the provided account token.""" 13 | 14 | card_token: str 15 | """Only return Authorization Rules that are bound to the provided card token.""" 16 | 17 | ending_before: str 18 | """A cursor representing an item's token before which a page of results should end. 19 | 20 | Used to retrieve the previous page of results before this item. 21 | """ 22 | 23 | page_size: int 24 | """Page size (for pagination).""" 25 | 26 | scope: Literal["PROGRAM", "ACCOUNT", "CARD"] 27 | """Only return Authorization Rules that are bound to the provided scope;""" 28 | 29 | starting_after: str 30 | """A cursor representing an item's token after which a page of results should 31 | begin. 32 | 33 | Used to retrieve the next page of results after this item. 34 | """ 35 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/v2_report_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["V2ReportResponse"] 8 | 9 | 10 | class V2ReportResponse(BaseModel): 11 | report_token: Optional[str] = None 12 | -------------------------------------------------------------------------------- /src/lithic/types/auth_rules/velocity_limit_params_period_window.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["VelocityLimitParamsPeriodWindow"] 6 | 7 | VelocityLimitParamsPeriodWindow: TypeAlias = Literal["DAY", "WEEK", "MONTH"] 8 | -------------------------------------------------------------------------------- /src/lithic/types/auth_stream_secret.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["AuthStreamSecret"] 8 | 9 | 10 | class AuthStreamSecret(BaseModel): 11 | secret: Optional[str] = None 12 | """The shared HMAC ASA secret""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/balance.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from datetime import datetime 4 | from typing_extensions import Literal 5 | 6 | from .._models import BaseModel 7 | 8 | __all__ = ["Balance"] 9 | 10 | 11 | class Balance(BaseModel): 12 | available_amount: int 13 | """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" 14 | 15 | created: datetime 16 | """Date and time for when the balance was first created.""" 17 | 18 | currency: str 19 | """3-character alphabetic ISO 4217 code for the local currency of the balance.""" 20 | 21 | financial_account_token: str 22 | """Globally unique identifier for the financial account that holds this balance.""" 23 | 24 | financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] 25 | """Type of financial account.""" 26 | 27 | last_transaction_event_token: str 28 | """ 29 | Globally unique identifier for the last financial transaction event that 30 | impacted this balance. 31 | """ 32 | 33 | last_transaction_token: str 34 | """ 35 | Globally unique identifier for the last financial transaction that impacted this 36 | balance. 37 | """ 38 | 39 | pending_amount: int 40 | """Funds not available for spend due to card authorizations or pending ACH release. 41 | 42 | Shown in the currency's smallest unit (e.g., cents for USD). 43 | """ 44 | 45 | total_amount: int 46 | """ 47 | The sum of available and pending balance in the currency's smallest unit (e.g., 48 | cents for USD). 49 | """ 50 | 51 | updated: datetime 52 | """Date and time for when the balance was last updated.""" 53 | -------------------------------------------------------------------------------- /src/lithic/types/balance_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["BalanceListParams"] 12 | 13 | 14 | class BalanceListParams(TypedDict, total=False): 15 | account_token: str 16 | """List balances for all financial accounts of a given account_token.""" 17 | 18 | balance_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 19 | """UTC date and time of the balances to retrieve. 20 | 21 | Defaults to latest available balances 22 | """ 23 | 24 | business_account_token: str 25 | """List balances for all financial accounts of a given business_account_token.""" 26 | 27 | financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] 28 | """List balances for a given Financial Account type.""" 29 | -------------------------------------------------------------------------------- /src/lithic/types/book_transfer_reverse_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["BookTransferReverseParams"] 8 | 9 | 10 | class BookTransferReverseParams(TypedDict, total=False): 11 | memo: str 12 | """Optional descriptor for the reversal.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/card.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .non_pci_card import NonPCICard 6 | 7 | __all__ = ["Card"] 8 | 9 | 10 | class Card(NonPCICard): 11 | cvv: Optional[str] = None 12 | """Three digit cvv printed on the back of the card.""" 13 | 14 | pan: Optional[str] = None 15 | """Primary Account Number (PAN) (i.e. 16 | 17 | the card number). Customers must be PCI compliant to have PAN returned as a 18 | field in production. Please contact support@lithic.com for questions. 19 | """ 20 | -------------------------------------------------------------------------------- /src/lithic/types/card_convert_physical_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from .shared_params.carrier import Carrier 8 | from .shared_params.shipping_address import ShippingAddress 9 | 10 | __all__ = ["CardConvertPhysicalParams"] 11 | 12 | 13 | class CardConvertPhysicalParams(TypedDict, total=False): 14 | shipping_address: Required[ShippingAddress] 15 | """The shipping address this card will be sent to.""" 16 | 17 | carrier: Carrier 18 | """If omitted, the previous carrier will be used.""" 19 | 20 | product_id: str 21 | """Specifies the configuration (e.g. 22 | 23 | physical card art) that the card should be manufactured with, and only applies 24 | to cards of type `PHYSICAL`. This must be configured with Lithic before use. 25 | """ 26 | 27 | shipping_method: Literal["2_DAY", "EXPEDITED", "EXPRESS", "PRIORITY", "STANDARD", "STANDARD_WITH_TRACKING"] 28 | """Shipping method for the card. 29 | 30 | Only applies to cards of type PHYSICAL. Use of options besides `STANDARD` 31 | require additional permissions. 32 | 33 | - `STANDARD` - USPS regular mail or similar international option, with no 34 | tracking 35 | - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, 36 | with tracking 37 | - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking 38 | - `EXPRESS` - FedEx Express, 3-day shipping, with tracking 39 | - `2_DAY` - FedEx 2-day shipping, with tracking 40 | - `EXPEDITED` - FedEx Standard Overnight or similar international option, with 41 | tracking 42 | """ 43 | -------------------------------------------------------------------------------- /src/lithic/types/card_embed_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["CardEmbedParams"] 8 | 9 | 10 | class CardEmbedParams(TypedDict, total=False): 11 | embed_request: Required[str] 12 | """A base64 encoded JSON string of an EmbedRequest to specify which card to load.""" 13 | 14 | hmac: Required[str] 15 | """SHA256 HMAC of the embed_request JSON string with base64 digest.""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/card_embed_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import TypeAlias 4 | 5 | __all__ = ["CardEmbedResponse"] 6 | 7 | CardEmbedResponse: TypeAlias = str 8 | -------------------------------------------------------------------------------- /src/lithic/types/card_get_embed_html_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["CardGetEmbedHTMLParams"] 12 | 13 | 14 | class CardGetEmbedHTMLParams(TypedDict, total=False): 15 | token: Required[str] 16 | """Globally unique identifier for the card to be displayed.""" 17 | 18 | css: str 19 | """ 20 | A publicly available URI, so the white-labeled card element can be styled with 21 | the client's branding. 22 | """ 23 | 24 | expiration: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 25 | """An RFC 3339 timestamp for when the request should expire. UTC time zone. 26 | 27 | If no timezone is specified, UTC will be used. If payload does not contain an 28 | expiration, the request will never expire. 29 | 30 | Using an `expiration` reduces the risk of a 31 | [replay attack](https://en.wikipedia.org/wiki/Replay_attack). Without supplying 32 | the `expiration`, in the event that a malicious user gets a copy of your request 33 | in transit, they will be able to obtain the response data indefinitely. 34 | """ 35 | 36 | target_origin: str 37 | """Required if you want to post the element clicked to the parent iframe. 38 | 39 | If you supply this param, you can also capture click events in the parent iframe 40 | by adding an event listener. 41 | """ 42 | -------------------------------------------------------------------------------- /src/lithic/types/card_get_embed_url_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["CardGetEmbedURLParams"] 12 | 13 | 14 | class CardGetEmbedURLParams(TypedDict, total=False): 15 | token: Required[str] 16 | """Globally unique identifier for the card to be displayed.""" 17 | 18 | css: str 19 | """ 20 | A publicly available URI, so the white-labeled card element can be styled with 21 | the client's branding. 22 | """ 23 | 24 | expiration: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 25 | """An RFC 3339 timestamp for when the request should expire. UTC time zone. 26 | 27 | If no timezone is specified, UTC will be used. If payload does not contain an 28 | expiration, the request will never expire. 29 | 30 | Using an `expiration` reduces the risk of a 31 | [replay attack](https://en.wikipedia.org/wiki/Replay_attack). Without supplying 32 | the `expiration`, in the event that a malicious user gets a copy of your request 33 | in transit, they will be able to obtain the response data indefinitely. 34 | """ 35 | 36 | target_origin: str 37 | """Required if you want to post the element clicked to the parent iframe. 38 | 39 | If you supply this param, you can also capture click events in the parent iframe 40 | by adding an event listener. 41 | """ 42 | -------------------------------------------------------------------------------- /src/lithic/types/card_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["CardListParams"] 12 | 13 | 14 | class CardListParams(TypedDict, total=False): 15 | account_token: str 16 | """Returns cards associated with the specified account.""" 17 | 18 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 19 | """Date string in RFC 3339 format. 20 | 21 | Only entries created after the specified time will be included. UTC time zone. 22 | """ 23 | 24 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 25 | """Date string in RFC 3339 format. 26 | 27 | Only entries created before the specified time will be included. UTC time zone. 28 | """ 29 | 30 | ending_before: str 31 | """A cursor representing an item's token before which a page of results should end. 32 | 33 | Used to retrieve the previous page of results before this item. 34 | """ 35 | 36 | memo: str 37 | """Returns cards containing the specified partial or full memo text.""" 38 | 39 | page_size: int 40 | """Page size (for pagination).""" 41 | 42 | starting_after: str 43 | """A cursor representing an item's token after which a page of results should 44 | begin. 45 | 46 | Used to retrieve the next page of results after this item. 47 | """ 48 | 49 | state: Literal["CLOSED", "OPEN", "PAUSED", "PENDING_ACTIVATION", "PENDING_FULFILLMENT"] 50 | """Returns cards with the specified state.""" 51 | -------------------------------------------------------------------------------- /src/lithic/types/card_program.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | from datetime import datetime 5 | 6 | from .._models import BaseModel 7 | 8 | __all__ = ["CardProgram"] 9 | 10 | 11 | class CardProgram(BaseModel): 12 | token: str 13 | """Globally unique identifier.""" 14 | 15 | created: datetime 16 | """Timestamp of when the card program was created.""" 17 | 18 | name: str 19 | """The name of the card program.""" 20 | 21 | pan_range_end: str 22 | """The first digits of the card number that this card program ends with.""" 23 | 24 | pan_range_start: str 25 | """The first digits of the card number that this card program starts with.""" 26 | 27 | cardholder_currency: Optional[str] = None 28 | """3-character alphabetic ISO 4217 code for the currency of the cardholder.""" 29 | 30 | settlement_currencies: Optional[List[str]] = None 31 | """ 32 | List of 3-character alphabetic ISO 4217 codes for the currencies that the card 33 | program supports for settlement. 34 | """ 35 | -------------------------------------------------------------------------------- /src/lithic/types/card_program_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["CardProgramListParams"] 8 | 9 | 10 | class CardProgramListParams(TypedDict, total=False): 11 | ending_before: str 12 | """A cursor representing an item's token before which a page of results should end. 13 | 14 | Used to retrieve the previous page of results before this item. 15 | """ 16 | 17 | page_size: int 18 | """Page size (for pagination).""" 19 | 20 | starting_after: str 21 | """A cursor representing an item's token after which a page of results should 22 | begin. 23 | 24 | Used to retrieve the next page of results after this item. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/card_provision_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["CardProvisionResponse"] 8 | 9 | 10 | class CardProvisionResponse(BaseModel): 11 | provisioning_payload: Optional[str] = None 12 | -------------------------------------------------------------------------------- /src/lithic/types/card_reissue_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | from .shared_params.carrier import Carrier 8 | from .shared_params.shipping_address import ShippingAddress 9 | 10 | __all__ = ["CardReissueParams"] 11 | 12 | 13 | class CardReissueParams(TypedDict, total=False): 14 | carrier: Carrier 15 | """If omitted, the previous carrier will be used.""" 16 | 17 | product_id: str 18 | """Specifies the configuration (e.g. 19 | 20 | physical card art) that the card should be manufactured with, and only applies 21 | to cards of type `PHYSICAL`. This must be configured with Lithic before use. 22 | """ 23 | 24 | shipping_address: ShippingAddress 25 | """If omitted, the previous shipping address will be used.""" 26 | 27 | shipping_method: Literal["2_DAY", "EXPEDITED", "EXPRESS", "PRIORITY", "STANDARD", "STANDARD_WITH_TRACKING"] 28 | """Shipping method for the card. 29 | 30 | Only applies to cards of type PHYSICAL. Use of options besides `STANDARD` 31 | require additional permissions. 32 | 33 | - `STANDARD` - USPS regular mail or similar international option, with no 34 | tracking 35 | - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, 36 | with tracking 37 | - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking 38 | - `EXPRESS` - FedEx Express, 3-day shipping, with tracking 39 | - `2_DAY` - FedEx 2-day shipping, with tracking 40 | - `EXPEDITED` - FedEx Standard Overnight or similar international option, with 41 | tracking 42 | """ 43 | -------------------------------------------------------------------------------- /src/lithic/types/card_search_by_pan_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["CardSearchByPanParams"] 8 | 9 | 10 | class CardSearchByPanParams(TypedDict, total=False): 11 | pan: Required[str] 12 | """The PAN for the card being retrieved.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/card_spend_limits.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["CardSpendLimits", "AvailableSpendLimit", "SpendLimit", "SpendVelocity"] 8 | 9 | 10 | class AvailableSpendLimit(BaseModel): 11 | annually: Optional[int] = None 12 | """ 13 | The available spend limit (in cents) relative to the annual limit configured on 14 | the Card (e.g. 100000 would be a $1,000 limit). 15 | """ 16 | 17 | forever: Optional[int] = None 18 | """ 19 | The available spend limit (in cents) relative to the forever limit configured on 20 | the Card. 21 | """ 22 | 23 | monthly: Optional[int] = None 24 | """ 25 | The available spend limit (in cents) relative to the monthly limit configured on 26 | the Card. 27 | """ 28 | 29 | 30 | class SpendLimit(BaseModel): 31 | annually: Optional[int] = None 32 | """The configured annual spend limit (in cents) on the Card.""" 33 | 34 | forever: Optional[int] = None 35 | """The configured forever spend limit (in cents) on the Card.""" 36 | 37 | monthly: Optional[int] = None 38 | """The configured monthly spend limit (in cents) on the Card.""" 39 | 40 | 41 | class SpendVelocity(BaseModel): 42 | annually: Optional[int] = None 43 | """Current annual spend velocity (in cents) on the Card. 44 | 45 | Present if annual spend limit is set. 46 | """ 47 | 48 | forever: Optional[int] = None 49 | """Current forever spend velocity (in cents) on the Card. 50 | 51 | Present if forever spend limit is set. 52 | """ 53 | 54 | monthly: Optional[int] = None 55 | """Current monthly spend velocity (in cents) on the Card. 56 | 57 | Present if monthly spend limit is set. 58 | """ 59 | 60 | 61 | class CardSpendLimits(BaseModel): 62 | available_spend_limit: AvailableSpendLimit 63 | 64 | spend_limit: Optional[SpendLimit] = None 65 | 66 | spend_velocity: Optional[SpendVelocity] = None 67 | -------------------------------------------------------------------------------- /src/lithic/types/card_web_provision_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["CardWebProvisionParams"] 8 | 9 | 10 | class CardWebProvisionParams(TypedDict, total=False): 11 | digital_wallet: Literal["APPLE_PAY"] 12 | """Name of digital wallet provider.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/card_web_provision_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["CardWebProvisionResponse", "Jws", "JwsHeader"] 8 | 9 | 10 | class JwsHeader(BaseModel): 11 | kid: Optional[str] = None 12 | """The ID for the JWS Public Key of the key pair used to generate the signature.""" 13 | 14 | 15 | class Jws(BaseModel): 16 | header: Optional[JwsHeader] = None 17 | """ 18 | JWS unprotected headers containing header parameters that aren't 19 | integrity-protected by the JWS signature. 20 | """ 21 | 22 | payload: Optional[str] = None 23 | """Base64url encoded JSON object containing the provisioning payload.""" 24 | 25 | protected: Optional[str] = None 26 | """ 27 | Base64url encoded JWS protected headers containing the header parameters that 28 | are integrity-protected by the JWS signature. 29 | """ 30 | 31 | signature: Optional[str] = None 32 | """Base64url encoded signature of the JWS object.""" 33 | 34 | 35 | class CardWebProvisionResponse(BaseModel): 36 | jws: Optional[Jws] = None 37 | """JWS object required for handoff to Apple's script.""" 38 | 39 | state: Optional[str] = None 40 | """A unique identifier for the JWS object.""" 41 | -------------------------------------------------------------------------------- /src/lithic/types/cards/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .balance_list_params import BalanceListParams as BalanceListParams 6 | from .balance_list_response import BalanceListResponse as BalanceListResponse 7 | from .aggregate_balance_list_params import AggregateBalanceListParams as AggregateBalanceListParams 8 | from .aggregate_balance_list_response import AggregateBalanceListResponse as AggregateBalanceListResponse 9 | from .financial_transaction_list_params import FinancialTransactionListParams as FinancialTransactionListParams 10 | -------------------------------------------------------------------------------- /src/lithic/types/cards/aggregate_balance_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["AggregateBalanceListParams"] 8 | 9 | 10 | class AggregateBalanceListParams(TypedDict, total=False): 11 | account_token: str 12 | """Cardholder to retrieve aggregate balances for.""" 13 | 14 | business_account_token: str 15 | """Business to retrieve aggregate balances for.""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/cards/aggregate_balance_list_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from datetime import datetime 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["AggregateBalanceListResponse"] 8 | 9 | 10 | class AggregateBalanceListResponse(BaseModel): 11 | available_amount: int 12 | """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" 13 | 14 | created: datetime 15 | """Date and time for when the balance was first created.""" 16 | 17 | currency: str 18 | """3-character alphabetic ISO 4217 code for the local currency of the balance.""" 19 | 20 | last_card_token: str 21 | """ 22 | Globally unique identifier for the card that had its balance updated most 23 | recently 24 | """ 25 | 26 | last_transaction_event_token: str 27 | """ 28 | Globally unique identifier for the last transaction event that impacted this 29 | balance 30 | """ 31 | 32 | last_transaction_token: str 33 | """Globally unique identifier for the last transaction that impacted this balance""" 34 | 35 | pending_amount: int 36 | """Funds not available for spend due to card authorizations or pending ACH release. 37 | 38 | Shown in the currency's smallest unit (e.g., cents for USD) 39 | """ 40 | 41 | total_amount: int 42 | """ 43 | The sum of available and pending balance in the currency's smallest unit (e.g., 44 | cents for USD) 45 | """ 46 | 47 | updated: datetime 48 | """Date and time for when the balance was last updated.""" 49 | -------------------------------------------------------------------------------- /src/lithic/types/cards/balance_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["BalanceListParams"] 12 | 13 | 14 | class BalanceListParams(TypedDict, total=False): 15 | balance_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """UTC date of the balance to retrieve. Defaults to latest available balance""" 17 | 18 | last_transaction_event_token: str 19 | """ 20 | Balance after a given financial event occured. For example, passing the 21 | event_token of a $5 CARD_CLEARING financial event will return a balance 22 | decreased by $5 23 | """ 24 | -------------------------------------------------------------------------------- /src/lithic/types/cards/balance_list_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from datetime import datetime 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["BalanceListResponse"] 9 | 10 | 11 | class BalanceListResponse(BaseModel): 12 | token: str 13 | """Globally unique identifier for the financial account that holds this balance.""" 14 | 15 | available_amount: int 16 | """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" 17 | 18 | created: datetime 19 | """Date and time for when the balance was first created.""" 20 | 21 | currency: str 22 | """3-character alphabetic ISO 4217 code for the local currency of the balance.""" 23 | 24 | last_transaction_event_token: str 25 | """ 26 | Globally unique identifier for the last financial transaction event that 27 | impacted this balance. 28 | """ 29 | 30 | last_transaction_token: str 31 | """ 32 | Globally unique identifier for the last financial transaction that impacted this 33 | balance. 34 | """ 35 | 36 | pending_amount: int 37 | """Funds not available for spend due to card authorizations or pending ACH release. 38 | 39 | Shown in the currency's smallest unit (e.g., cents for USD). 40 | """ 41 | 42 | total_amount: int 43 | """ 44 | The sum of available and pending balance in the currency's smallest unit (e.g., 45 | cents for USD). 46 | """ 47 | 48 | type: Literal["ISSUING", "OPERATING", "RESERVE"] 49 | """Type of financial account.""" 50 | 51 | updated: datetime 52 | """Date and time for when the balance was last updated.""" 53 | -------------------------------------------------------------------------------- /src/lithic/types/cards/financial_transaction_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["FinancialTransactionListParams"] 12 | 13 | 14 | class FinancialTransactionListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | category: Literal["CARD", "TRANSFER"] 22 | """Financial Transaction category to be returned.""" 23 | 24 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 25 | """Date string in RFC 3339 format. 26 | 27 | Only entries created before the specified time will be included. UTC time zone. 28 | """ 29 | 30 | ending_before: str 31 | """A cursor representing an item's token before which a page of results should end. 32 | 33 | Used to retrieve the previous page of results before this item. 34 | """ 35 | 36 | result: Literal["APPROVED", "DECLINED"] 37 | """Financial Transaction result to be returned.""" 38 | 39 | starting_after: str 40 | """A cursor representing an item's token after which a page of results should 41 | begin. 42 | 43 | Used to retrieve the next page of results after this item. 44 | """ 45 | 46 | status: Literal["DECLINED", "EXPIRED", "PENDING", "RETURNED", "SETTLED", "VOIDED"] 47 | """Financial Transaction status to be returned.""" 48 | -------------------------------------------------------------------------------- /src/lithic/types/credit_products/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .extended_credit import ExtendedCredit as ExtendedCredit 6 | from .prime_rate_create_params import PrimeRateCreateParams as PrimeRateCreateParams 7 | from .prime_rate_retrieve_params import PrimeRateRetrieveParams as PrimeRateRetrieveParams 8 | from .prime_rate_retrieve_response import PrimeRateRetrieveResponse as PrimeRateRetrieveResponse 9 | -------------------------------------------------------------------------------- /src/lithic/types/credit_products/extended_credit.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from ..._models import BaseModel 4 | 5 | __all__ = ["ExtendedCredit"] 6 | 7 | 8 | class ExtendedCredit(BaseModel): 9 | credit_extended: int 10 | -------------------------------------------------------------------------------- /src/lithic/types/credit_products/prime_rate_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["PrimeRateCreateParams"] 12 | 13 | 14 | class PrimeRateCreateParams(TypedDict, total=False): 15 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 16 | """Date the rate goes into effect""" 17 | 18 | rate: Required[str] 19 | """The rate in decimal format""" 20 | -------------------------------------------------------------------------------- /src/lithic/types/credit_products/prime_rate_retrieve_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["PrimeRateRetrieveParams"] 12 | 13 | 14 | class PrimeRateRetrieveParams(TypedDict, total=False): 15 | ending_before: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 16 | """The effective date that the prime rates ends before""" 17 | 18 | starting_after: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 19 | """The effective date that the prime rate starts after""" 20 | -------------------------------------------------------------------------------- /src/lithic/types/credit_products/prime_rate_retrieve_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from datetime import date 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["PrimeRateRetrieveResponse", "Data"] 9 | 10 | 11 | class Data(BaseModel): 12 | effective_date: date 13 | """Date the rate goes into effect""" 14 | 15 | rate: str 16 | """The rate in decimal format""" 17 | 18 | 19 | class PrimeRateRetrieveResponse(BaseModel): 20 | data: List[Data] 21 | """List of prime rates""" 22 | 23 | has_more: bool 24 | """Whether there are more prime rates""" 25 | -------------------------------------------------------------------------------- /src/lithic/types/digital_card_art.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from datetime import datetime 5 | from typing_extensions import Literal 6 | 7 | from .._models import BaseModel 8 | 9 | __all__ = ["DigitalCardArt"] 10 | 11 | 12 | class DigitalCardArt(BaseModel): 13 | token: str 14 | """Globally unique identifier for the card art.""" 15 | 16 | card_program_token: str 17 | """Globally unique identifier for the card program.""" 18 | 19 | created: datetime 20 | """Timestamp of when card art was created.""" 21 | 22 | description: str 23 | """Description of the card art.""" 24 | 25 | is_enabled: bool 26 | """Whether the card art is enabled.""" 27 | 28 | network: Literal["MASTERCARD", "VISA"] 29 | """Card network.""" 30 | 31 | is_card_program_default: Optional[bool] = None 32 | """Whether the card art is the default card art to be added upon tokenization.""" 33 | -------------------------------------------------------------------------------- /src/lithic/types/digital_card_art_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["DigitalCardArtListParams"] 8 | 9 | 10 | class DigitalCardArtListParams(TypedDict, total=False): 11 | ending_before: str 12 | """A cursor representing an item's token before which a page of results should end. 13 | 14 | Used to retrieve the previous page of results before this item. 15 | """ 16 | 17 | page_size: int 18 | """Page size (for pagination).""" 19 | 20 | starting_after: str 21 | """A cursor representing an item's token after which a page of results should 22 | begin. 23 | 24 | Used to retrieve the next page of results after this item. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/dispute_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["DisputeCreateParams"] 12 | 13 | 14 | class DisputeCreateParams(TypedDict, total=False): 15 | amount: Required[int] 16 | """Amount to dispute""" 17 | 18 | reason: Required[ 19 | Literal[ 20 | "ATM_CASH_MISDISPENSE", 21 | "CANCELLED", 22 | "DUPLICATED", 23 | "FRAUD_CARD_NOT_PRESENT", 24 | "FRAUD_CARD_PRESENT", 25 | "FRAUD_OTHER", 26 | "GOODS_SERVICES_NOT_AS_DESCRIBED", 27 | "GOODS_SERVICES_NOT_RECEIVED", 28 | "INCORRECT_AMOUNT", 29 | "MISSING_AUTH", 30 | "OTHER", 31 | "PROCESSING_ERROR", 32 | "RECURRING_TRANSACTION_NOT_CANCELLED", 33 | "REFUND_NOT_PROCESSED", 34 | ] 35 | ] 36 | """Reason for dispute""" 37 | 38 | transaction_token: Required[str] 39 | """Transaction to dispute""" 40 | 41 | customer_filed_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 42 | """Date the customer filed the dispute""" 43 | 44 | customer_note: str 45 | """Customer description of dispute""" 46 | -------------------------------------------------------------------------------- /src/lithic/types/dispute_evidence.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from datetime import datetime 5 | from typing_extensions import Literal 6 | 7 | from .._models import BaseModel 8 | 9 | __all__ = ["DisputeEvidence"] 10 | 11 | 12 | class DisputeEvidence(BaseModel): 13 | token: str 14 | """Globally unique identifier.""" 15 | 16 | created: datetime 17 | """Timestamp of when dispute evidence was created.""" 18 | 19 | dispute_token: str 20 | """Dispute token evidence is attached to.""" 21 | 22 | upload_status: Literal["DELETED", "ERROR", "PENDING", "REJECTED", "UPLOADED"] 23 | """Upload status types: 24 | 25 | - `DELETED` - Evidence was deleted. 26 | - `ERROR` - Evidence upload failed. 27 | - `PENDING` - Evidence is pending upload. 28 | - `REJECTED` - Evidence was rejected. 29 | - `UPLOADED` - Evidence was uploaded. 30 | """ 31 | 32 | download_url: Optional[str] = None 33 | """URL to download evidence. Only shown when `upload_status` is `UPLOADED`.""" 34 | 35 | filename: Optional[str] = None 36 | """File name of evidence. 37 | 38 | Recommended to give the dispute evidence a human-readable identifier. 39 | """ 40 | 41 | upload_url: Optional[str] = None 42 | """URL to upload evidence. Only shown when `upload_status` is `PENDING`.""" 43 | -------------------------------------------------------------------------------- /src/lithic/types/dispute_initiate_evidence_upload_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["DisputeInitiateEvidenceUploadParams"] 8 | 9 | 10 | class DisputeInitiateEvidenceUploadParams(TypedDict, total=False): 11 | filename: str 12 | """Filename of the evidence.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/dispute_list_evidences_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["DisputeListEvidencesParams"] 12 | 13 | 14 | class DisputeListEvidencesParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | -------------------------------------------------------------------------------- /src/lithic/types/dispute_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import List, Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["DisputeListParams"] 12 | 13 | 14 | class DisputeListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | 43 | status: Literal[ 44 | "ARBITRATION", 45 | "CASE_CLOSED", 46 | "CASE_WON", 47 | "NEW", 48 | "PENDING_CUSTOMER", 49 | "PREARBITRATION", 50 | "REPRESENTMENT", 51 | "SUBMITTED", 52 | ] 53 | """List disputes of a specific status.""" 54 | 55 | transaction_tokens: List[str] 56 | """Transaction tokens to filter by.""" 57 | -------------------------------------------------------------------------------- /src/lithic/types/dispute_update_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["DisputeUpdateParams"] 12 | 13 | 14 | class DisputeUpdateParams(TypedDict, total=False): 15 | amount: int 16 | """Amount to dispute""" 17 | 18 | customer_filed_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 19 | """Date the customer filed the dispute""" 20 | 21 | customer_note: str 22 | """Customer description of dispute""" 23 | 24 | reason: Literal[ 25 | "ATM_CASH_MISDISPENSE", 26 | "CANCELLED", 27 | "DUPLICATED", 28 | "FRAUD_CARD_NOT_PRESENT", 29 | "FRAUD_CARD_PRESENT", 30 | "FRAUD_OTHER", 31 | "GOODS_SERVICES_NOT_AS_DESCRIBED", 32 | "GOODS_SERVICES_NOT_RECEIVED", 33 | "INCORRECT_AMOUNT", 34 | "MISSING_AUTH", 35 | "OTHER", 36 | "PROCESSING_ERROR", 37 | "RECURRING_TRANSACTION_NOT_CANCELLED", 38 | "REFUND_NOT_PROCESSED", 39 | ] 40 | """Reason for dispute""" 41 | -------------------------------------------------------------------------------- /src/lithic/types/event_list_attempts_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["EventListAttemptsParams"] 12 | 13 | 14 | class EventListAttemptsParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | 43 | status: Literal["FAILED", "PENDING", "SENDING", "SUCCESS"] 44 | -------------------------------------------------------------------------------- /src/lithic/types/event_resend_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["EventResendParams"] 12 | 13 | 14 | class EventResendParams(TypedDict, total=False): 15 | token: Required[str] 16 | """Globally unique identifier for the card to be displayed.""" 17 | 18 | css: str 19 | """ 20 | A publicly available URI, so the white-labeled card element can be styled with 21 | the client's branding. 22 | """ 23 | 24 | expiration: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 25 | """An RFC 3339 timestamp for when the request should expire. UTC time zone. 26 | 27 | If no timezone is specified, UTC will be used. If payload does not contain an 28 | expiration, the request will never expire. 29 | 30 | Using an `expiration` reduces the risk of a 31 | [replay attack](https://en.wikipedia.org/wiki/Replay_attack). Without supplying 32 | the `expiration`, in the event that a malicious user gets a copy of your request 33 | in transit, they will be able to obtain the response data indefinitely. 34 | """ 35 | 36 | target_origin: str 37 | """Required if you want to post the element clicked to the parent iframe. 38 | 39 | If you supply this param, you can also capture click events in the parent iframe 40 | by adding an event listener. 41 | """ 42 | -------------------------------------------------------------------------------- /src/lithic/types/events/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .subscription_list_params import SubscriptionListParams as SubscriptionListParams 6 | from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams 7 | from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams 8 | from .subscription_recover_params import SubscriptionRecoverParams as SubscriptionRecoverParams 9 | from .subscription_list_attempts_params import SubscriptionListAttemptsParams as SubscriptionListAttemptsParams 10 | from .subscription_replay_missing_params import SubscriptionReplayMissingParams as SubscriptionReplayMissingParams 11 | from .subscription_retrieve_secret_response import ( 12 | SubscriptionRetrieveSecretResponse as SubscriptionRetrieveSecretResponse, 13 | ) 14 | from .subscription_send_simulated_example_params import ( 15 | SubscriptionSendSimulatedExampleParams as SubscriptionSendSimulatedExampleParams, 16 | ) 17 | -------------------------------------------------------------------------------- /src/lithic/types/events/subscription_list_attempts_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["SubscriptionListAttemptsParams"] 12 | 13 | 14 | class SubscriptionListAttemptsParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | 43 | status: Literal["FAILED", "PENDING", "SENDING", "SUCCESS"] 44 | -------------------------------------------------------------------------------- /src/lithic/types/events/subscription_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["SubscriptionListParams"] 8 | 9 | 10 | class SubscriptionListParams(TypedDict, total=False): 11 | ending_before: str 12 | """A cursor representing an item's token before which a page of results should end. 13 | 14 | Used to retrieve the previous page of results before this item. 15 | """ 16 | 17 | page_size: int 18 | """Page size (for pagination).""" 19 | 20 | starting_after: str 21 | """A cursor representing an item's token after which a page of results should 22 | begin. 23 | 24 | Used to retrieve the next page of results after this item. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/events/subscription_recover_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["SubscriptionRecoverParams"] 12 | 13 | 14 | class SubscriptionRecoverParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/events/subscription_replay_missing_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["SubscriptionReplayMissingParams"] 12 | 13 | 14 | class SubscriptionReplayMissingParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified time will be included. UTC time zone. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/events/subscription_retrieve_secret_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["SubscriptionRetrieveSecretResponse"] 8 | 9 | 10 | class SubscriptionRetrieveSecretResponse(BaseModel): 11 | secret: Optional[str] = None 12 | """The secret for the event subscription.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_account_address.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["ExternalBankAccountAddress"] 8 | 9 | 10 | class ExternalBankAccountAddress(BaseModel): 11 | address1: str 12 | 13 | city: str 14 | 15 | country: str 16 | 17 | postal_code: str 18 | 19 | state: str 20 | 21 | address2: Optional[str] = None 22 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_account_address_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["ExternalBankAccountAddressParam"] 8 | 9 | 10 | class ExternalBankAccountAddressParam(TypedDict, total=False): 11 | address1: Required[str] 12 | 13 | city: Required[str] 14 | 15 | country: Required[str] 16 | 17 | postal_code: Required[str] 18 | 19 | state: Required[str] 20 | 21 | address2: str 22 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_account_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import List 6 | from typing_extensions import Literal, TypedDict 7 | 8 | from .owner_type import OwnerType 9 | 10 | __all__ = ["ExternalBankAccountListParams"] 11 | 12 | 13 | class ExternalBankAccountListParams(TypedDict, total=False): 14 | account_token: str 15 | 16 | account_types: List[Literal["CHECKING", "SAVINGS"]] 17 | 18 | countries: List[str] 19 | 20 | ending_before: str 21 | """A cursor representing an item's token before which a page of results should end. 22 | 23 | Used to retrieve the previous page of results before this item. 24 | """ 25 | 26 | owner_types: List[OwnerType] 27 | 28 | page_size: int 29 | """Page size (for pagination).""" 30 | 31 | starting_after: str 32 | """A cursor representing an item's token after which a page of results should 33 | begin. 34 | 35 | Used to retrieve the next page of results after this item. 36 | """ 37 | 38 | states: List[Literal["ENABLED", "CLOSED", "PAUSED"]] 39 | 40 | verification_states: List[Literal["PENDING", "ENABLED", "FAILED_VERIFICATION", "INSUFFICIENT_FUNDS"]] 41 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_account_retry_micro_deposits_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["ExternalBankAccountRetryMicroDepositsParams"] 8 | 9 | 10 | class ExternalBankAccountRetryMicroDepositsParams(TypedDict, total=False): 11 | financial_account_token: str 12 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_account_retry_prenote_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["ExternalBankAccountRetryPrenoteParams"] 8 | 9 | 10 | class ExternalBankAccountRetryPrenoteParams(TypedDict, total=False): 11 | financial_account_token: str 12 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_account_update_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | from .owner_type import OwnerType 11 | from .external_bank_account_address_param import ExternalBankAccountAddressParam 12 | 13 | __all__ = ["ExternalBankAccountUpdateParams"] 14 | 15 | 16 | class ExternalBankAccountUpdateParams(TypedDict, total=False): 17 | address: ExternalBankAccountAddressParam 18 | """Address""" 19 | 20 | company_id: str 21 | """Optional field that helps identify bank accounts in receipts""" 22 | 23 | dob: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 24 | """Date of Birth of the Individual that owns the external bank account""" 25 | 26 | doing_business_as: str 27 | """Doing Business As""" 28 | 29 | name: str 30 | """The nickname for this External Bank Account""" 31 | 32 | owner: str 33 | """Legal Name of the business or individual who owns the external account. 34 | 35 | This will appear in statements 36 | """ 37 | 38 | owner_type: OwnerType 39 | """Owner Type""" 40 | 41 | type: Literal["CHECKING", "SAVINGS"] 42 | 43 | user_defined_id: str 44 | """User Defined ID""" 45 | 46 | 47 | ExternalBankAccountAddress = ExternalBankAccountAddressParam 48 | """This type is deprecated, please use ExternalBankAccountAddressParam instead""" 49 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_accounts/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .micro_deposit_create_params import MicroDepositCreateParams as MicroDepositCreateParams 6 | from .micro_deposit_create_response import MicroDepositCreateResponse as MicroDepositCreateResponse 7 | -------------------------------------------------------------------------------- /src/lithic/types/external_bank_accounts/micro_deposit_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Iterable 6 | from typing_extensions import Required, TypedDict 7 | 8 | __all__ = ["MicroDepositCreateParams"] 9 | 10 | 11 | class MicroDepositCreateParams(TypedDict, total=False): 12 | micro_deposits: Required[Iterable[int]] 13 | -------------------------------------------------------------------------------- /src/lithic/types/external_payment_cancel_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ExternalPaymentCancelParams"] 12 | 13 | 14 | class ExternalPaymentCancelParams(TypedDict, total=False): 15 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 16 | 17 | memo: str 18 | -------------------------------------------------------------------------------- /src/lithic/types/external_payment_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Literal, Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ExternalPaymentCreateParams"] 12 | 13 | 14 | class ExternalPaymentCreateParams(TypedDict, total=False): 15 | amount: Required[int] 16 | 17 | category: Required[Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]] 18 | 19 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 20 | 21 | financial_account_token: Required[str] 22 | 23 | payment_type: Required[Literal["DEPOSIT", "WITHDRAWAL"]] 24 | 25 | token: str 26 | 27 | memo: str 28 | 29 | progress_to: Literal["SETTLED", "RELEASED"] 30 | 31 | user_defined_id: str 32 | -------------------------------------------------------------------------------- /src/lithic/types/external_payment_release_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ExternalPaymentReleaseParams"] 12 | 13 | 14 | class ExternalPaymentReleaseParams(TypedDict, total=False): 15 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 16 | 17 | memo: str 18 | -------------------------------------------------------------------------------- /src/lithic/types/external_payment_reverse_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ExternalPaymentReverseParams"] 12 | 13 | 14 | class ExternalPaymentReverseParams(TypedDict, total=False): 15 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 16 | 17 | memo: str 18 | -------------------------------------------------------------------------------- /src/lithic/types/external_payment_settle_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Literal, Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ExternalPaymentSettleParams"] 12 | 13 | 14 | class ExternalPaymentSettleParams(TypedDict, total=False): 15 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 16 | 17 | memo: str 18 | 19 | progress_to: Literal["SETTLED", "RELEASED"] 20 | -------------------------------------------------------------------------------- /src/lithic/types/financial_account_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["FinancialAccountCreateParams"] 8 | 9 | 10 | class FinancialAccountCreateParams(TypedDict, total=False): 11 | nickname: Required[str] 12 | 13 | type: Required[Literal["OPERATING"]] 14 | 15 | account_token: str 16 | 17 | is_for_benefit_of: bool 18 | -------------------------------------------------------------------------------- /src/lithic/types/financial_account_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["FinancialAccountListParams"] 8 | 9 | 10 | class FinancialAccountListParams(TypedDict, total=False): 11 | account_token: str 12 | """List financial accounts for a given account_token or business_account_token""" 13 | 14 | business_account_token: str 15 | """List financial accounts for a given business_account_token""" 16 | 17 | type: Literal["ISSUING", "OPERATING", "RESERVE"] 18 | """List financial accounts of a given type""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/financial_account_update_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["FinancialAccountUpdateParams"] 8 | 9 | 10 | class FinancialAccountUpdateParams(TypedDict, total=False): 11 | nickname: str 12 | -------------------------------------------------------------------------------- /src/lithic/types/financial_account_update_status_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Optional 6 | from typing_extensions import Literal, Required, TypedDict 7 | 8 | __all__ = ["FinancialAccountUpdateStatusParams"] 9 | 10 | 11 | class FinancialAccountUpdateStatusParams(TypedDict, total=False): 12 | status: Required[Literal["OPEN", "CLOSED", "SUSPENDED", "PENDING"]] 13 | """Status of the financial account""" 14 | 15 | substatus: Required[ 16 | Optional[Literal["CHARGED_OFF_FRAUD", "END_USER_REQUEST", "BANK_REQUEST", "CHARGED_OFF_DELINQUENT"]] 17 | ] 18 | """Substatus for the financial account""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .loan_tape import LoanTape as LoanTape 6 | from .statement import Statement as Statement 7 | from .statements import Statements as Statements 8 | from .balance_list_params import BalanceListParams as BalanceListParams 9 | from .balance_list_response import BalanceListResponse as BalanceListResponse 10 | from .loan_tape_list_params import LoanTapeListParams as LoanTapeListParams 11 | from .statement_list_params import StatementListParams as StatementListParams 12 | from .financial_account_credit_config import FinancialAccountCreditConfig as FinancialAccountCreditConfig 13 | from .financial_transaction_list_params import FinancialTransactionListParams as FinancialTransactionListParams 14 | from .credit_configuration_update_params import CreditConfigurationUpdateParams as CreditConfigurationUpdateParams 15 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/balance_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["BalanceListParams"] 12 | 13 | 14 | class BalanceListParams(TypedDict, total=False): 15 | balance_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """UTC date of the balance to retrieve. Defaults to latest available balance""" 17 | 18 | last_transaction_event_token: str 19 | """ 20 | Balance after a given financial event occured. For example, passing the 21 | event_token of a $5 CARD_CLEARING financial event will return a balance 22 | decreased by $5 23 | """ 24 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/balance_list_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from datetime import datetime 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["BalanceListResponse"] 9 | 10 | 11 | class BalanceListResponse(BaseModel): 12 | token: str 13 | """Globally unique identifier for the financial account that holds this balance.""" 14 | 15 | available_amount: int 16 | """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" 17 | 18 | created: datetime 19 | """Date and time for when the balance was first created.""" 20 | 21 | currency: str 22 | """3-character alphabetic ISO 4217 code for the local currency of the balance.""" 23 | 24 | last_transaction_event_token: str 25 | """ 26 | Globally unique identifier for the last financial transaction event that 27 | impacted this balance. 28 | """ 29 | 30 | last_transaction_token: str 31 | """ 32 | Globally unique identifier for the last financial transaction that impacted this 33 | balance. 34 | """ 35 | 36 | pending_amount: int 37 | """Funds not available for spend due to card authorizations or pending ACH release. 38 | 39 | Shown in the currency's smallest unit (e.g., cents for USD). 40 | """ 41 | 42 | total_amount: int 43 | """ 44 | The sum of available and pending balance in the currency's smallest unit (e.g., 45 | cents for USD). 46 | """ 47 | 48 | type: Literal["ISSUING", "OPERATING", "RESERVE"] 49 | """Type of financial account.""" 50 | 51 | updated: datetime 52 | """Date and time for when the balance was last updated.""" 53 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/credit_configuration_update_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["CreditConfigurationUpdateParams"] 8 | 9 | 10 | class CreditConfigurationUpdateParams(TypedDict, total=False): 11 | credit_limit: int 12 | 13 | credit_product_token: str 14 | """Globally unique identifier for the credit product""" 15 | 16 | external_bank_account_token: str 17 | 18 | tier: str 19 | """Tier to assign to a financial account""" 20 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/financial_account_credit_config.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from ..._models import BaseModel 7 | 8 | __all__ = ["FinancialAccountCreditConfig"] 9 | 10 | 11 | class FinancialAccountCreditConfig(BaseModel): 12 | account_token: str 13 | """Globally unique identifier for the account""" 14 | 15 | charged_off_reason: Optional[Literal["DELINQUENT", "FRAUD"]] = None 16 | """Reason for the financial account being marked as Charged Off""" 17 | 18 | credit_limit: Optional[int] = None 19 | 20 | credit_product_token: Optional[str] = None 21 | """Globally unique identifier for the credit product""" 22 | 23 | external_bank_account_token: Optional[str] = None 24 | 25 | financial_account_state: Literal["PENDING", "CURRENT", "DELINQUENT", "CHARGED_OFF"] 26 | """State of the financial account""" 27 | 28 | is_spend_blocked: bool 29 | 30 | tier: Optional[str] = None 31 | """Tier assigned to the financial account""" 32 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/financial_transaction_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["FinancialTransactionListParams"] 12 | 13 | 14 | class FinancialTransactionListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | category: Literal["ACH", "CARD", "INTERNAL", "TRANSFER"] 22 | """Financial Transaction category to be returned.""" 23 | 24 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 25 | """Date string in RFC 3339 format. 26 | 27 | Only entries created before the specified time will be included. UTC time zone. 28 | """ 29 | 30 | ending_before: str 31 | """A cursor representing an item's token before which a page of results should end. 32 | 33 | Used to retrieve the previous page of results before this item. 34 | """ 35 | 36 | result: Literal["APPROVED", "DECLINED"] 37 | """Financial Transaction result to be returned.""" 38 | 39 | starting_after: str 40 | """A cursor representing an item's token after which a page of results should 41 | begin. 42 | 43 | Used to retrieve the next page of results after this item. 44 | """ 45 | 46 | status: Literal["DECLINED", "EXPIRED", "PENDING", "RETURNED", "SETTLED", "VOIDED"] 47 | """Financial Transaction status to be returned.""" 48 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/loan_tape_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["LoanTapeListParams"] 12 | 13 | 14 | class LoanTapeListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified date will be included. 19 | """ 20 | 21 | end: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified date will be included. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/statement_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Annotated, TypedDict 8 | 9 | from ..._utils import PropertyInfo 10 | 11 | __all__ = ["StatementListParams"] 12 | 13 | 14 | class StatementListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified date will be included. 19 | """ 20 | 21 | end: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 22 | """Date string in RFC 3339 format. 23 | 24 | Only entries created before the specified date will be included. 25 | """ 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | include_initial_statements: bool 34 | """Whether to include the initial statement. It is not included by default.""" 35 | 36 | page_size: int 37 | """Page size (for pagination).""" 38 | 39 | starting_after: str 40 | """A cursor representing an item's token after which a page of results should 41 | begin. 42 | 43 | Used to retrieve the next page of results after this item. 44 | """ 45 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/statements/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .statements import Statements as Statements 6 | from .statement_line_items import Data, StatementLineItems as StatementLineItems 7 | from .line_item_list_params import LineItemListParams as LineItemListParams 8 | 9 | # Here for back compat 10 | LineItemListResponse = Data 11 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/statements/line_item_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["LineItemListParams"] 8 | 9 | 10 | class LineItemListParams(TypedDict, total=False): 11 | financial_account_token: Required[str] 12 | """Globally unique identifier for financial account.""" 13 | 14 | ending_before: str 15 | """A cursor representing an item's token before which a page of results should end. 16 | 17 | Used to retrieve the previous page of results before this item. 18 | """ 19 | 20 | page_size: int 21 | """Page size (for pagination).""" 22 | 23 | starting_after: str 24 | """A cursor representing an item's token after which a page of results should 25 | begin. 26 | 27 | Used to retrieve the next page of results after this item. 28 | """ 29 | -------------------------------------------------------------------------------- /src/lithic/types/financial_accounts/statements/statements.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | 5 | from ...._models import BaseModel 6 | from ..statement import Statement 7 | 8 | __all__ = ["Statements"] 9 | 10 | 11 | class Statements(BaseModel): 12 | data: List[Statement] 13 | 14 | has_more: bool 15 | -------------------------------------------------------------------------------- /src/lithic/types/funding_event_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["FundingEventListParams"] 8 | 9 | 10 | class FundingEventListParams(TypedDict, total=False): 11 | ending_before: str 12 | """A cursor representing an item's token before which a page of results should end. 13 | 14 | Used to retrieve the previous page of results before this item. 15 | """ 16 | 17 | page_size: int 18 | """Page size (for pagination).""" 19 | 20 | starting_after: str 21 | """A cursor representing an item's token after which a page of results should 22 | begin. 23 | 24 | Used to retrieve the next page of results after this item. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/funding_event_list_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from datetime import date, datetime 5 | from typing_extensions import Literal 6 | 7 | from .._models import BaseModel 8 | 9 | __all__ = ["FundingEventListResponse", "SettlementBreakdown"] 10 | 11 | 12 | class SettlementBreakdown(BaseModel): 13 | amount: int 14 | 15 | settlement_date: date 16 | 17 | 18 | class FundingEventListResponse(BaseModel): 19 | token: str 20 | """Unique token ID""" 21 | 22 | collection_resource_type: Literal["BOOK_TRANSFER", "PAYMENT"] 23 | """Collection resource type""" 24 | 25 | collection_tokens: List[str] 26 | """IDs of collections""" 27 | 28 | created: datetime 29 | """Time of the creation""" 30 | 31 | high_watermark: datetime 32 | """Time of the high watermark""" 33 | 34 | previous_high_watermark: datetime 35 | """Time of the previous high watermark""" 36 | 37 | settlement_breakdowns: List[SettlementBreakdown] 38 | """List of settlements""" 39 | 40 | updated: datetime 41 | """Time of the update""" 42 | -------------------------------------------------------------------------------- /src/lithic/types/funding_event_retrieve_details_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .._models import BaseModel 4 | 5 | __all__ = ["FundingEventRetrieveDetailsResponse"] 6 | 7 | 8 | class FundingEventRetrieveDetailsResponse(BaseModel): 9 | token: str 10 | """Unique token ID""" 11 | 12 | settlement_details_url: str 13 | """URL of the settlement details""" 14 | 15 | settlement_summary_url: str 16 | """URL of the settlement summary""" 17 | -------------------------------------------------------------------------------- /src/lithic/types/funding_event_retrieve_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | from datetime import date, datetime 5 | from typing_extensions import Literal 6 | 7 | from .._models import BaseModel 8 | 9 | __all__ = ["FundingEventRetrieveResponse", "SettlementBreakdown"] 10 | 11 | 12 | class SettlementBreakdown(BaseModel): 13 | amount: int 14 | 15 | settlement_date: date 16 | 17 | 18 | class FundingEventRetrieveResponse(BaseModel): 19 | token: str 20 | """Unique token ID""" 21 | 22 | collection_resource_type: Literal["BOOK_TRANSFER", "PAYMENT"] 23 | """Collection resource type""" 24 | 25 | collection_tokens: List[str] 26 | """IDs of collections""" 27 | 28 | created: datetime 29 | """Time of the creation""" 30 | 31 | high_watermark: datetime 32 | """Time of the high watermark""" 33 | 34 | previous_high_watermark: datetime 35 | """Time of the previous high watermark""" 36 | 37 | settlement_breakdowns: List[SettlementBreakdown] 38 | """List of settlements""" 39 | 40 | updated: datetime 41 | """Time of the update""" 42 | -------------------------------------------------------------------------------- /src/lithic/types/kyc_exempt_param.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | from .shared_params.address import Address 8 | 9 | __all__ = ["KYCExemptParam"] 10 | 11 | 12 | class KYCExemptParam(TypedDict, total=False): 13 | address: Required[Address] 14 | """ 15 | KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not 16 | acceptable; APO/FPO are acceptable. 17 | """ 18 | 19 | email: Required[str] 20 | """The KYC Exempt user's email""" 21 | 22 | first_name: Required[str] 23 | """The KYC Exempt user's first name""" 24 | 25 | kyc_exemption_type: Required[Literal["AUTHORIZED_USER", "PREPAID_CARD_USER"]] 26 | """Specifies the type of KYC Exempt user""" 27 | 28 | last_name: Required[str] 29 | """The KYC Exempt user's last name""" 30 | 31 | phone_number: Required[str] 32 | """The KYC Exempt user's phone number, entered in E.164 format.""" 33 | 34 | workflow: Required[Literal["KYC_EXEMPT"]] 35 | """Specifies the workflow type. This must be 'KYC_EXEMPT'""" 36 | 37 | business_account_token: str 38 | """ 39 | Only applicable for customers using the KYC-Exempt workflow to enroll authorized 40 | users of businesses. Pass the account_token of the enrolled business associated 41 | with the AUTHORIZED_USER in this field. 42 | """ 43 | 44 | external_id: str 45 | """ 46 | A user provided id that can be used to link an account holder with an external 47 | system 48 | """ 49 | -------------------------------------------------------------------------------- /src/lithic/types/management_operation_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Literal, Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ManagementOperationCreateParams"] 12 | 13 | 14 | class ManagementOperationCreateParams(TypedDict, total=False): 15 | amount: Required[int] 16 | 17 | category: Required[ 18 | Literal[ 19 | "MANAGEMENT_FEE", 20 | "MANAGEMENT_DISPUTE", 21 | "MANAGEMENT_REWARD", 22 | "MANAGEMENT_ADJUSTMENT", 23 | "MANAGEMENT_DISBURSEMENT", 24 | ] 25 | ] 26 | 27 | direction: Required[Literal["CREDIT", "DEBIT"]] 28 | 29 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 30 | 31 | event_type: Required[ 32 | Literal[ 33 | "LOSS_WRITE_OFF", 34 | "CASH_BACK", 35 | "CASH_BACK_REVERSAL", 36 | "CURRENCY_CONVERSION", 37 | "CURRENCY_CONVERSION_REVERSAL", 38 | "INTEREST", 39 | "INTEREST_REVERSAL", 40 | "LATE_PAYMENT", 41 | "LATE_PAYMENT_REVERSAL", 42 | "BILLING_ERROR", 43 | "BILLING_ERROR_REVERSAL", 44 | "PROVISIONAL_CREDIT", 45 | "PROVISIONAL_CREDIT_REVERSAL", 46 | "RETURNED_PAYMENT", 47 | "RETURNED_PAYMENT_REVERSAL", 48 | "DISPUTE_WON", 49 | "DISPUTE_WON_REVERSAL", 50 | "DISBURSE", 51 | "DISBURSE_REVERSAL", 52 | ] 53 | ] 54 | 55 | financial_account_token: Required[str] 56 | 57 | token: str 58 | 59 | memo: str 60 | 61 | subtype: str 62 | 63 | user_defined_id: str 64 | -------------------------------------------------------------------------------- /src/lithic/types/management_operation_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ManagementOperationListParams"] 12 | 13 | 14 | class ManagementOperationListParams(TypedDict, total=False): 15 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 16 | """Date string in RFC 3339 format. 17 | 18 | Only entries created after the specified time will be included. UTC time zone. 19 | """ 20 | 21 | business_account_token: str 22 | 23 | category: Literal[ 24 | "MANAGEMENT_FEE", "MANAGEMENT_DISPUTE", "MANAGEMENT_REWARD", "MANAGEMENT_ADJUSTMENT", "MANAGEMENT_DISBURSEMENT" 25 | ] 26 | """Management operation category to be returned.""" 27 | 28 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 29 | """Date string in RFC 3339 format. 30 | 31 | Only entries created before the specified time will be included. UTC time zone. 32 | """ 33 | 34 | ending_before: str 35 | """A cursor representing an item's token before which a page of results should end. 36 | 37 | Used to retrieve the previous page of results before this item. 38 | """ 39 | 40 | financial_account_token: str 41 | """Globally unique identifier for the financial account. 42 | 43 | Accepted type dependent on the program's use case. 44 | """ 45 | 46 | page_size: int 47 | """Page size (for pagination).""" 48 | 49 | starting_after: str 50 | """A cursor representing an item's token after which a page of results should 51 | begin. 52 | 53 | Used to retrieve the next page of results after this item. 54 | """ 55 | 56 | status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"] 57 | """Management operation status to be returned.""" 58 | -------------------------------------------------------------------------------- /src/lithic/types/management_operation_reverse_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Required, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["ManagementOperationReverseParams"] 12 | 13 | 14 | class ManagementOperationReverseParams(TypedDict, total=False): 15 | effective_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] 16 | 17 | memo: str 18 | -------------------------------------------------------------------------------- /src/lithic/types/message_attempt.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from datetime import datetime 4 | from typing_extensions import Literal 5 | 6 | from .._models import BaseModel 7 | 8 | __all__ = ["MessageAttempt"] 9 | 10 | 11 | class MessageAttempt(BaseModel): 12 | token: str 13 | """Globally unique identifier.""" 14 | 15 | created: datetime 16 | """An RFC 3339 timestamp for when the event was created. UTC time zone. 17 | 18 | If no timezone is specified, UTC will be used. 19 | """ 20 | 21 | event_subscription_token: str 22 | """Globally unique identifier.""" 23 | 24 | event_token: str 25 | """Globally unique identifier.""" 26 | 27 | response: str 28 | """The response body from the event subscription's URL.""" 29 | 30 | response_status_code: int 31 | """The response status code from the event subscription's URL.""" 32 | 33 | status: Literal["FAILED", "PENDING", "SENDING", "SUCCESS"] 34 | """The status of the event attempt.""" 35 | 36 | url: str 37 | -------------------------------------------------------------------------------- /src/lithic/types/owner_type.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["OwnerType"] 6 | 7 | OwnerType: TypeAlias = Literal["INDIVIDUAL", "BUSINESS"] 8 | -------------------------------------------------------------------------------- /src/lithic/types/payment_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["PaymentCreateParams", "MethodAttributes"] 8 | 9 | 10 | class PaymentCreateParams(TypedDict, total=False): 11 | amount: Required[int] 12 | 13 | external_bank_account_token: Required[str] 14 | 15 | financial_account_token: Required[str] 16 | 17 | method: Required[Literal["ACH_NEXT_DAY", "ACH_SAME_DAY"]] 18 | 19 | method_attributes: Required[MethodAttributes] 20 | 21 | type: Required[Literal["COLLECTION", "PAYMENT"]] 22 | 23 | token: str 24 | """Customer-provided token that will serve as an idempotency token. 25 | 26 | This token will become the transaction token. 27 | """ 28 | 29 | memo: str 30 | 31 | user_defined_id: str 32 | 33 | 34 | class MethodAttributes(TypedDict, total=False): 35 | sec_code: Required[Literal["CCD", "PPD", "WEB"]] 36 | -------------------------------------------------------------------------------- /src/lithic/types/payment_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .balance import Balance 6 | from .payment import Payment 7 | 8 | __all__ = ["PaymentCreateResponse"] 9 | 10 | 11 | class PaymentCreateResponse(Payment): 12 | balance: Optional[Balance] = None 13 | """Balance""" 14 | -------------------------------------------------------------------------------- /src/lithic/types/payment_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["PaymentListParams"] 12 | 13 | 14 | class PaymentListParams(TypedDict, total=False): 15 | account_token: str 16 | 17 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 18 | """Date string in RFC 3339 format. 19 | 20 | Only entries created after the specified time will be included. UTC time zone. 21 | """ 22 | 23 | business_account_token: str 24 | 25 | category: Literal["ACH"] 26 | 27 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 28 | """Date string in RFC 3339 format. 29 | 30 | Only entries created before the specified time will be included. UTC time zone. 31 | """ 32 | 33 | ending_before: str 34 | """A cursor representing an item's token before which a page of results should end. 35 | 36 | Used to retrieve the previous page of results before this item. 37 | """ 38 | 39 | financial_account_token: str 40 | 41 | page_size: int 42 | """Page size (for pagination).""" 43 | 44 | result: Literal["APPROVED", "DECLINED"] 45 | 46 | starting_after: str 47 | """A cursor representing an item's token after which a page of results should 48 | begin. 49 | 50 | Used to retrieve the next page of results after this item. 51 | """ 52 | 53 | status: Literal["DECLINED", "PENDING", "RETURNED", "SETTLED"] 54 | -------------------------------------------------------------------------------- /src/lithic/types/payment_retry_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .balance import Balance 6 | from .payment import Payment 7 | 8 | __all__ = ["PaymentRetryResponse"] 9 | 10 | 11 | class PaymentRetryResponse(Payment): 12 | balance: Optional[Balance] = None 13 | """Balance""" 14 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_action_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["PaymentSimulateActionParams"] 8 | 9 | 10 | class PaymentSimulateActionParams(TypedDict, total=False): 11 | event_type: Required[ 12 | Literal[ 13 | "ACH_ORIGINATION_REVIEWED", 14 | "ACH_ORIGINATION_RELEASED", 15 | "ACH_ORIGINATION_PROCESSED", 16 | "ACH_ORIGINATION_SETTLED", 17 | "ACH_RECEIPT_SETTLED", 18 | "ACH_RETURN_INITIATED", 19 | "ACH_RETURN_PROCESSED", 20 | "ACH_RETURN_SETTLED", 21 | ] 22 | ] 23 | """Event Type""" 24 | 25 | decline_reason: Literal[ 26 | "PROGRAM_TRANSACTION_LIMIT_EXCEEDED", "PROGRAM_DAILY_LIMIT_EXCEEDED", "PROGRAM_MONTHLY_LIMIT_EXCEEDED" 27 | ] 28 | """Decline reason""" 29 | 30 | return_reason_code: str 31 | """Return Reason Code""" 32 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_action_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["PaymentSimulateActionResponse"] 8 | 9 | 10 | class PaymentSimulateActionResponse(BaseModel): 11 | debugging_request_id: str 12 | """Debugging Request Id""" 13 | 14 | result: Literal["APPROVED", "DECLINED"] 15 | """Request Result""" 16 | 17 | transaction_event_token: str 18 | """Transaction Event Token""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_receipt_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["PaymentSimulateReceiptParams"] 8 | 9 | 10 | class PaymentSimulateReceiptParams(TypedDict, total=False): 11 | token: Required[str] 12 | """ 13 | Customer-generated payment token used to uniquely identify the simulated payment 14 | """ 15 | 16 | amount: Required[int] 17 | """Amount""" 18 | 19 | financial_account_token: Required[str] 20 | """Financial Account Token""" 21 | 22 | receipt_type: Required[Literal["RECEIPT_CREDIT", "RECEIPT_DEBIT"]] 23 | """Receipt Type""" 24 | 25 | memo: str 26 | """Memo""" 27 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_receipt_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["PaymentSimulateReceiptResponse"] 8 | 9 | 10 | class PaymentSimulateReceiptResponse(BaseModel): 11 | debugging_request_id: str 12 | """Debugging Request Id""" 13 | 14 | result: Literal["APPROVED", "DECLINED"] 15 | """Request Result""" 16 | 17 | transaction_event_token: str 18 | """Transaction Event Token""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_release_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["PaymentSimulateReleaseParams"] 8 | 9 | 10 | class PaymentSimulateReleaseParams(TypedDict, total=False): 11 | payment_token: Required[str] 12 | """Payment Token""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_release_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["PaymentSimulateReleaseResponse"] 8 | 9 | 10 | class PaymentSimulateReleaseResponse(BaseModel): 11 | debugging_request_id: str 12 | """Debugging Request Id""" 13 | 14 | result: Literal["APPROVED", "DECLINED"] 15 | """Request Result""" 16 | 17 | transaction_event_token: str 18 | """Transaction Event Token""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_return_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["PaymentSimulateReturnParams"] 8 | 9 | 10 | class PaymentSimulateReturnParams(TypedDict, total=False): 11 | payment_token: Required[str] 12 | """Payment Token""" 13 | 14 | return_reason_code: str 15 | """Return Reason Code""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/payment_simulate_return_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["PaymentSimulateReturnResponse"] 8 | 9 | 10 | class PaymentSimulateReturnResponse(BaseModel): 11 | debugging_request_id: str 12 | """Debugging Request Id""" 13 | 14 | result: Literal["APPROVED", "DECLINED"] 15 | """Request Result""" 16 | 17 | transaction_event_token: str 18 | """Transaction Event Token""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/reports/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .settlement_list_details_params import SettlementListDetailsParams as SettlementListDetailsParams 6 | -------------------------------------------------------------------------------- /src/lithic/types/reports/settlement/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .network_total_list_params import NetworkTotalListParams as NetworkTotalListParams 6 | from .network_total_list_response import NetworkTotalListResponse as NetworkTotalListResponse 7 | from .network_total_retrieve_response import NetworkTotalRetrieveResponse as NetworkTotalRetrieveResponse 8 | -------------------------------------------------------------------------------- /src/lithic/types/reports/settlement_list_details_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["SettlementListDetailsParams"] 8 | 9 | 10 | class SettlementListDetailsParams(TypedDict, total=False): 11 | ending_before: str 12 | """A cursor representing an item's token before which a page of results should end. 13 | 14 | Used to retrieve the previous page of results before this item. 15 | """ 16 | 17 | page_size: int 18 | """Page size (for pagination).""" 19 | 20 | starting_after: str 21 | """A cursor representing an item's token after which a page of results should 22 | begin. 23 | 24 | Used to retrieve the next page of results after this item. 25 | """ 26 | -------------------------------------------------------------------------------- /src/lithic/types/required_document.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["RequiredDocument"] 8 | 9 | 10 | class RequiredDocument(BaseModel): 11 | entity_token: str 12 | """Globally unique identifier for an entity.""" 13 | 14 | status_reasons: List[str] 15 | """ 16 | rovides the status reasons that will be satisfied by providing one of the valid 17 | documents. 18 | """ 19 | 20 | valid_documents: List[str] 21 | """ 22 | A list of valid documents that will satisfy the KYC requirements for the 23 | specified entity. 24 | """ 25 | -------------------------------------------------------------------------------- /src/lithic/types/responder_endpoint_check_status_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponderEndpointCheckStatusParams"] 8 | 9 | 10 | class ResponderEndpointCheckStatusParams(TypedDict, total=False): 11 | type: Required[Literal["AUTH_STREAM_ACCESS", "THREE_DS_DECISIONING", "TOKENIZATION_DECISIONING"]] 12 | """The type of the endpoint.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/responder_endpoint_create_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["ResponderEndpointCreateParams"] 8 | 9 | 10 | class ResponderEndpointCreateParams(TypedDict, total=False): 11 | type: Literal["AUTH_STREAM_ACCESS", "THREE_DS_DECISIONING", "TOKENIZATION_DECISIONING"] 12 | """The type of the endpoint.""" 13 | 14 | url: str 15 | """The URL for the responder endpoint (must be http(s)).""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/responder_endpoint_create_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["ResponderEndpointCreateResponse"] 8 | 9 | 10 | class ResponderEndpointCreateResponse(BaseModel): 11 | enrolled: Optional[bool] = None 12 | """True if the endpoint was enrolled successfully.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/responder_endpoint_delete_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["ResponderEndpointDeleteParams"] 8 | 9 | 10 | class ResponderEndpointDeleteParams(TypedDict, total=False): 11 | type: Required[Literal["AUTH_STREAM_ACCESS", "THREE_DS_DECISIONING", "TOKENIZATION_DECISIONING"]] 12 | """The type of the endpoint.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/responder_endpoint_status.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["ResponderEndpointStatus"] 8 | 9 | 10 | class ResponderEndpointStatus(BaseModel): 11 | enrolled: Optional[bool] = None 12 | """True if the instance has an endpoint enrolled.""" 13 | 14 | url: Optional[str] = None 15 | """The URL of the currently enrolled endpoint or null.""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/settlement_summary_details.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | from typing_extensions import Literal 5 | 6 | from .._models import BaseModel 7 | 8 | __all__ = ["SettlementSummaryDetails"] 9 | 10 | 11 | class SettlementSummaryDetails(BaseModel): 12 | currency: Optional[str] = None 13 | """3-character alphabetic ISO 4217 code.""" 14 | 15 | disputes_gross_amount: Optional[int] = None 16 | """The total gross amount of disputes settlements.""" 17 | 18 | institution: Optional[str] = None 19 | """ 20 | The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE 21 | for Visa). 22 | """ 23 | 24 | interchange_gross_amount: Optional[int] = None 25 | """The total amount of interchange.""" 26 | 27 | network: Optional[Literal["INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"]] = None 28 | """Card network where the transaction took place""" 29 | 30 | other_fees_gross_amount: Optional[int] = None 31 | """Total amount of gross other fees outside of interchange.""" 32 | 33 | settled_net_amount: Optional[int] = None 34 | """The total net amount of cash moved. 35 | 36 | (net value of settled_gross_amount, interchange, fees). 37 | """ 38 | 39 | transactions_gross_amount: Optional[int] = None 40 | """ 41 | The total amount of settlement impacting transactions (excluding interchange, 42 | fees, and disputes). 43 | """ 44 | -------------------------------------------------------------------------------- /src/lithic/types/shared/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .address import Address as Address 4 | from .carrier import Carrier as Carrier 5 | from .currency import Currency as Currency 6 | from .document import Document as Document 7 | from .shipping_address import ShippingAddress as ShippingAddress 8 | from .account_financial_account_type import AccountFinancialAccountType as AccountFinancialAccountType 9 | from .instance_financial_account_type import InstanceFinancialAccountType as InstanceFinancialAccountType 10 | -------------------------------------------------------------------------------- /src/lithic/types/shared/account_financial_account_type.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["AccountFinancialAccountType"] 6 | 7 | AccountFinancialAccountType: TypeAlias = Literal["ISSUING", "OPERATING"] 8 | -------------------------------------------------------------------------------- /src/lithic/types/shared/address.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["Address"] 8 | 9 | 10 | class Address(BaseModel): 11 | address1: str 12 | """Valid deliverable address (no PO boxes).""" 13 | 14 | city: str 15 | """Name of city.""" 16 | 17 | country: str 18 | """ 19 | Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character 20 | format. Only USA is currently supported for all workflows. KYC_EXEMPT supports 21 | CAN additionally. 22 | """ 23 | 24 | postal_code: str 25 | """Valid postal code. 26 | 27 | USA postal codes (ZIP codes) are supported, entered as a five-digit postal code 28 | or nine-digit postal code (ZIP+4) using the format 12345-1234. KYC_EXEMPT 29 | supports Canadian postal codes. 30 | """ 31 | 32 | state: str 33 | """Valid state code. 34 | 35 | USA state codes are supported, entered in uppercase ISO 3166-2 two-character 36 | format. KYC_EXEMPT supports Canadian province codes. 37 | """ 38 | 39 | address2: Optional[str] = None 40 | """Unit or apartment number (if applicable).""" 41 | -------------------------------------------------------------------------------- /src/lithic/types/shared/carrier.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["Carrier"] 8 | 9 | 10 | class Carrier(BaseModel): 11 | qr_code_url: Optional[str] = None 12 | """QR code url to display on the card carrier""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/shared/currency.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import TypeAlias 4 | 5 | __all__ = ["Currency"] 6 | 7 | Currency: TypeAlias = str 8 | -------------------------------------------------------------------------------- /src/lithic/types/shared/instance_financial_account_type.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["InstanceFinancialAccountType"] 6 | 7 | InstanceFinancialAccountType: TypeAlias = Literal[ 8 | "ISSUING", 9 | "RESERVE", 10 | "OPERATING", 11 | "CHARGED_OFF_FEES", 12 | "CHARGED_OFF_INTEREST", 13 | "CHARGED_OFF_PRINCIPAL", 14 | "SECURITY", 15 | "PROGRAM_RECEIVABLES", 16 | ] 17 | -------------------------------------------------------------------------------- /src/lithic/types/shared/shipping_address.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["ShippingAddress"] 8 | 9 | 10 | class ShippingAddress(BaseModel): 11 | address1: str 12 | """Valid USPS routable address.""" 13 | 14 | city: str 15 | """City""" 16 | 17 | country: str 18 | """Uppercase ISO 3166-1 alpha-3 three character abbreviation.""" 19 | 20 | first_name: str 21 | """Customer's first name. 22 | 23 | This will be the first name printed on the physical card. The combined length of 24 | `first_name` and `last_name` may not exceed 25 characters. 25 | """ 26 | 27 | last_name: str 28 | """Customer's surname (family name). 29 | 30 | This will be the last name printed on the physical card. The combined length of 31 | `first_name` and `last_name` may not exceed 25 characters. 32 | """ 33 | 34 | postal_code: str 35 | """Postal code (formerly zipcode). 36 | 37 | For US addresses, either five-digit postal code or nine-digit postal code 38 | (ZIP+4) using the format 12345-1234. 39 | """ 40 | 41 | state: str 42 | """Uppercase ISO 3166-2 two character abbreviation for US and CA. 43 | 44 | Optional with a limit of 24 characters for other countries. 45 | """ 46 | 47 | address2: Optional[str] = None 48 | """Unit number (if applicable).""" 49 | 50 | email: Optional[str] = None 51 | """Email address to be contacted for expedited shipping process purposes. 52 | 53 | Required if `shipping_method` is `EXPEDITED`. 54 | """ 55 | 56 | line2_text: Optional[str] = None 57 | """Text to be printed on line two of the physical card. 58 | 59 | Use of this field requires additional permissions. 60 | """ 61 | 62 | phone_number: Optional[str] = None 63 | """ 64 | Cardholder's phone number in E.164 format to be contacted for expedited shipping 65 | process purposes. Required if `shipping_method` is `EXPEDITED`. 66 | """ 67 | -------------------------------------------------------------------------------- /src/lithic/types/shared_params/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from .address import Address as Address 4 | from .carrier import Carrier as Carrier 5 | from .shipping_address import ShippingAddress as ShippingAddress 6 | -------------------------------------------------------------------------------- /src/lithic/types/shared_params/address.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["Address"] 8 | 9 | 10 | class Address(TypedDict, total=False): 11 | address1: Required[str] 12 | """Valid deliverable address (no PO boxes).""" 13 | 14 | city: Required[str] 15 | """Name of city.""" 16 | 17 | country: Required[str] 18 | """ 19 | Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character 20 | format. Only USA is currently supported for all workflows. KYC_EXEMPT supports 21 | CAN additionally. 22 | """ 23 | 24 | postal_code: Required[str] 25 | """Valid postal code. 26 | 27 | USA postal codes (ZIP codes) are supported, entered as a five-digit postal code 28 | or nine-digit postal code (ZIP+4) using the format 12345-1234. KYC_EXEMPT 29 | supports Canadian postal codes. 30 | """ 31 | 32 | state: Required[str] 33 | """Valid state code. 34 | 35 | USA state codes are supported, entered in uppercase ISO 3166-2 two-character 36 | format. KYC_EXEMPT supports Canadian province codes. 37 | """ 38 | 39 | address2: str 40 | """Unit or apartment number (if applicable).""" 41 | -------------------------------------------------------------------------------- /src/lithic/types/shared_params/carrier.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["Carrier"] 8 | 9 | 10 | class Carrier(TypedDict, total=False): 11 | qr_code_url: str 12 | """QR code url to display on the card carrier""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/spend_limit_duration.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["SpendLimitDuration"] 6 | 7 | SpendLimitDuration: TypeAlias = Literal["ANNUALLY", "FOREVER", "MONTHLY", "TRANSACTION"] 8 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .challenge_result import ChallengeResult as ChallengeResult 6 | from .authentication_simulate_params import AuthenticationSimulateParams as AuthenticationSimulateParams 7 | from .authentication_retrieve_response import AuthenticationRetrieveResponse as AuthenticationRetrieveResponse 8 | from .authentication_simulate_response import AuthenticationSimulateResponse as AuthenticationSimulateResponse 9 | from .decisioning_retrieve_secret_response import DecisioningRetrieveSecretResponse as DecisioningRetrieveSecretResponse 10 | from .decisioning_challenge_response_params import ( 11 | DecisioningChallengeResponseParams as DecisioningChallengeResponseParams, 12 | ) 13 | from .authentication_simulate_otp_entry_params import ( 14 | AuthenticationSimulateOtpEntryParams as AuthenticationSimulateOtpEntryParams, 15 | ) 16 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/authentication_simulate_otp_entry_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["AuthenticationSimulateOtpEntryParams"] 8 | 9 | 10 | class AuthenticationSimulateOtpEntryParams(TypedDict, total=False): 11 | token: Required[str] 12 | """ 13 | A unique token returned as part of a /v1/three_ds_authentication/simulate call 14 | that resulted in PENDING_CHALLENGE authentication result. 15 | """ 16 | 17 | otp: Required[str] 18 | """The OTP entered by the cardholder""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/authentication_simulate_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["AuthenticationSimulateParams", "Merchant", "Transaction"] 8 | 9 | 10 | class AuthenticationSimulateParams(TypedDict, total=False): 11 | merchant: Required[Merchant] 12 | 13 | pan: Required[str] 14 | """Sixteen digit card number.""" 15 | 16 | transaction: Required[Transaction] 17 | 18 | card_expiry_check: Literal["MATCH", "MISMATCH", "NOT_PRESENT"] 19 | """When set will use the following values as part of the Simulated Authentication. 20 | 21 | When not set defaults to MATCH 22 | """ 23 | 24 | 25 | class Merchant(TypedDict, total=False): 26 | id: Required[str] 27 | """Unique identifier to identify the payment card acceptor. 28 | 29 | Corresponds to `merchant_acceptor_id` in authorization. 30 | """ 31 | 32 | country: Required[str] 33 | """ 34 | Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format 35 | (e.g. USA) 36 | """ 37 | 38 | mcc: Required[str] 39 | """Merchant category code for the transaction to be simulated. 40 | 41 | A four-digit number listed in ISO 18245. Supported merchant category codes can 42 | be found 43 | [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). 44 | """ 45 | 46 | name: Required[str] 47 | """Merchant descriptor, corresponds to `descriptor` in authorization. 48 | 49 | If CHALLENGE keyword is included, Lithic will trigger a challenge. 50 | """ 51 | 52 | 53 | class Transaction(TypedDict, total=False): 54 | amount: Required[int] 55 | """Amount (in cents) to authenticate.""" 56 | 57 | currency: Required[str] 58 | """3-character alphabetic ISO 4217 currency code.""" 59 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/authentication_simulate_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["AuthenticationSimulateResponse"] 8 | 9 | 10 | class AuthenticationSimulateResponse(BaseModel): 11 | token: Optional[str] = None 12 | """ 13 | A unique token to reference this transaction with later calls to void or clear 14 | the authorization. 15 | """ 16 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/challenge_result.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["ChallengeResult"] 6 | 7 | ChallengeResult: TypeAlias = Literal["APPROVE", "DECLINE_BY_CUSTOMER"] 8 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/decisioning_challenge_response_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | from .challenge_result import ChallengeResult 8 | 9 | __all__ = ["DecisioningChallengeResponseParams"] 10 | 11 | 12 | class DecisioningChallengeResponseParams(TypedDict, total=False): 13 | token: Required[str] 14 | """Globally unique identifier for the 3DS authentication. 15 | 16 | This token is sent as part of the initial 3DS Decisioning Request and as part of 17 | the 3DS Challenge Event in the 18 | [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) object 19 | """ 20 | 21 | challenge_response: Required[ChallengeResult] 22 | """Whether the Cardholder has Approved or Declined the issued Challenge""" 23 | -------------------------------------------------------------------------------- /src/lithic/types/three_ds/decisioning_retrieve_secret_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from ..._models import BaseModel 6 | 7 | __all__ = ["DecisioningRetrieveSecretResponse"] 8 | 9 | 10 | class DecisioningRetrieveSecretResponse(BaseModel): 11 | secret: Optional[str] = None 12 | """The 3DS Decisioning HMAC secret""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_decisioning_rotate_secret_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TokenizationDecisioningRotateSecretResponse"] 8 | 9 | 10 | class TokenizationDecisioningRotateSecretResponse(BaseModel): 11 | secret: Optional[str] = None 12 | """The new Tokenization Decisioning HMAC secret""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import date 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["TokenizationListParams"] 12 | 13 | 14 | class TokenizationListParams(TypedDict, total=False): 15 | account_token: str 16 | """Filters for tokenizations associated with a specific account.""" 17 | 18 | begin: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 19 | """Filter for tokenizations created after this date.""" 20 | 21 | card_token: str 22 | """Filters for tokenizations associated with a specific card.""" 23 | 24 | end: Annotated[Union[str, date], PropertyInfo(format="iso8601")] 25 | """Filter for tokenizations created before this date.""" 26 | 27 | ending_before: str 28 | """A cursor representing an item's token before which a page of results should end. 29 | 30 | Used to retrieve the previous page of results before this item. 31 | """ 32 | 33 | page_size: int 34 | """Page size (for pagination).""" 35 | 36 | starting_after: str 37 | """A cursor representing an item's token after which a page of results should 38 | begin. 39 | 40 | Used to retrieve the next page of results after this item. 41 | """ 42 | 43 | tokenization_channel: Literal["DIGITAL_WALLET", "MERCHANT", "ALL"] 44 | """Filter for tokenizations by tokenization channel. 45 | 46 | If this is not specified, only DIGITAL_WALLET tokenizations will be returned. 47 | """ 48 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_resend_activation_code_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, TypedDict 6 | 7 | __all__ = ["TokenizationResendActivationCodeParams"] 8 | 9 | 10 | class TokenizationResendActivationCodeParams(TypedDict, total=False): 11 | activation_method_type: Literal["EMAIL_TO_CARDHOLDER_ADDRESS", "TEXT_TO_CARDHOLDER_NUMBER"] 12 | """ 13 | The communication method that the user has selected to use to receive the 14 | authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email 15 | = "EMAIL_TO_CARDHOLDER_ADDRESS" 16 | """ 17 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_retrieve_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | from .tokenization import Tokenization 7 | 8 | __all__ = ["TokenizationRetrieveResponse"] 9 | 10 | 11 | class TokenizationRetrieveResponse(BaseModel): 12 | data: Optional[Tokenization] = None 13 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_secret.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TokenizationSecret"] 8 | 9 | 10 | class TokenizationSecret(BaseModel): 11 | secret: Optional[str] = None 12 | """The Tokenization Decisioning HMAC secret""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_simulate_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["TokenizationSimulateParams"] 8 | 9 | 10 | class TokenizationSimulateParams(TypedDict, total=False): 11 | cvv: Required[str] 12 | """The three digit cvv for the card.""" 13 | 14 | expiration_date: Required[str] 15 | """The expiration date of the card in 'MM/YY' format.""" 16 | 17 | pan: Required[str] 18 | """The sixteen digit card number.""" 19 | 20 | tokenization_source: Required[Literal["APPLE_PAY", "GOOGLE", "SAMSUNG_PAY", "MERCHANT"]] 21 | """The source of the tokenization request.""" 22 | 23 | account_score: int 24 | """ 25 | The account score (1-5) that represents how the Digital Wallet's view on how 26 | reputable an end user's account is. 27 | """ 28 | 29 | device_score: int 30 | """ 31 | The device score (1-5) that represents how the Digital Wallet's view on how 32 | reputable an end user's device is. 33 | """ 34 | 35 | entity: str 36 | """ 37 | Optional field to specify the token requestor name for a merchant token 38 | simulation. Ignored when tokenization_source is not MERCHANT. 39 | """ 40 | 41 | wallet_recommended_decision: Literal["APPROVED", "DECLINED", "REQUIRE_ADDITIONAL_AUTHENTICATION"] 42 | """The decision that the Digital Wallet's recommend""" 43 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_simulate_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List, Optional 4 | 5 | from .._models import BaseModel 6 | from .tokenization import Tokenization 7 | 8 | __all__ = ["TokenizationSimulateResponse"] 9 | 10 | 11 | class TokenizationSimulateResponse(BaseModel): 12 | data: Optional[List[Tokenization]] = None 13 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_update_digital_card_art_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import TypedDict 6 | 7 | __all__ = ["TokenizationUpdateDigitalCardArtParams"] 8 | 9 | 10 | class TokenizationUpdateDigitalCardArtParams(TypedDict, total=False): 11 | digital_card_art_token: str 12 | """ 13 | Specifies the digital card art to be displayed in the user’s digital wallet for 14 | a tokenization. This artwork must be approved by the network and configured by 15 | Lithic to use. See 16 | [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). 17 | """ 18 | -------------------------------------------------------------------------------- /src/lithic/types/tokenization_update_digital_card_art_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | from .tokenization import Tokenization 7 | 8 | __all__ = ["TokenizationUpdateDigitalCardArtResponse"] 9 | 10 | 11 | class TokenizationUpdateDigitalCardArtResponse(BaseModel): 12 | data: Optional[Tokenization] = None 13 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_list_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Union 6 | from datetime import datetime 7 | from typing_extensions import Literal, Annotated, TypedDict 8 | 9 | from .._utils import PropertyInfo 10 | 11 | __all__ = ["TransactionListParams"] 12 | 13 | 14 | class TransactionListParams(TypedDict, total=False): 15 | account_token: str 16 | """Filters for transactions associated with a specific account.""" 17 | 18 | begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 19 | """Date string in RFC 3339 format. 20 | 21 | Only entries created after the specified time will be included. UTC time zone. 22 | """ 23 | 24 | card_token: str 25 | """Filters for transactions associated with a specific card.""" 26 | 27 | end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] 28 | """Date string in RFC 3339 format. 29 | 30 | Only entries created before the specified time will be included. UTC time zone. 31 | """ 32 | 33 | ending_before: str 34 | """A cursor representing an item's token before which a page of results should end. 35 | 36 | Used to retrieve the previous page of results before this item. 37 | """ 38 | 39 | page_size: int 40 | """Page size (for pagination).""" 41 | 42 | result: Literal["APPROVED", "DECLINED"] 43 | """Filters for transactions using transaction result field. 44 | 45 | Can filter by `APPROVED`, and `DECLINED`. 46 | """ 47 | 48 | starting_after: str 49 | """A cursor representing an item's token after which a page of results should 50 | begin. 51 | 52 | Used to retrieve the next page of results after this item. 53 | """ 54 | 55 | status: Literal["PENDING", "VOIDED", "SETTLED", "DECLINED", "EXPIRED"] 56 | """Filters for transactions using transaction status field.""" 57 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_authorization_advice_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["TransactionSimulateAuthorizationAdviceParams"] 8 | 9 | 10 | class TransactionSimulateAuthorizationAdviceParams(TypedDict, total=False): 11 | token: Required[str] 12 | """The transaction token returned from the /v1/simulate/authorize. response.""" 13 | 14 | amount: Required[int] 15 | """Amount (in cents) to authorize. 16 | 17 | This amount will override the transaction's amount that was originally set by 18 | /v1/simulate/authorize. 19 | """ 20 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_authorization_advice_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateAuthorizationAdviceResponse"] 8 | 9 | 10 | class TransactionSimulateAuthorizationAdviceResponse(BaseModel): 11 | token: Optional[str] = None 12 | """A unique token to reference this transaction.""" 13 | 14 | debugging_request_id: Optional[str] = None 15 | """Debugging request ID to share with Lithic Support team.""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_authorization_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateAuthorizationResponse"] 8 | 9 | 10 | class TransactionSimulateAuthorizationResponse(BaseModel): 11 | token: Optional[str] = None 12 | """ 13 | A unique token to reference this transaction with later calls to void or clear 14 | the authorization. 15 | """ 16 | 17 | debugging_request_id: Optional[str] = None 18 | """Debugging request ID to share with Lithic Support team.""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_clearing_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["TransactionSimulateClearingParams"] 8 | 9 | 10 | class TransactionSimulateClearingParams(TypedDict, total=False): 11 | token: Required[str] 12 | """The transaction token returned from the /v1/simulate/authorize response.""" 13 | 14 | amount: int 15 | """Amount (in cents) to clear. 16 | 17 | Typically this will match the amount in the original authorization, but can be 18 | higher or lower. The sign of this amount will automatically match the sign of 19 | the original authorization's amount. For example, entering 100 in this field 20 | will result in a -100 amount in the transaction, if the original authorization 21 | is a credit authorization. 22 | 23 | If `amount` is not set, the full amount of the transaction will be cleared. 24 | Transactions that have already cleared, either partially or fully, cannot be 25 | cleared again using this endpoint. 26 | """ 27 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_clearing_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateClearingResponse"] 8 | 9 | 10 | class TransactionSimulateClearingResponse(BaseModel): 11 | debugging_request_id: Optional[str] = None 12 | """Debugging request ID to share with Lithic Support team.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_credit_authorization_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["TransactionSimulateCreditAuthorizationParams"] 8 | 9 | 10 | class TransactionSimulateCreditAuthorizationParams(TypedDict, total=False): 11 | amount: Required[int] 12 | """Amount (in cents). 13 | 14 | Any value entered will be converted into a negative amount in the simulated 15 | transaction. For example, entering 100 in this field will appear as a -100 16 | amount in the transaction. 17 | """ 18 | 19 | descriptor: Required[str] 20 | """Merchant descriptor.""" 21 | 22 | pan: Required[str] 23 | """Sixteen digit card number.""" 24 | 25 | mcc: str 26 | """Merchant category code for the transaction to be simulated. 27 | 28 | A four-digit number listed in ISO 18245. Supported merchant category codes can 29 | be found 30 | [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). 31 | """ 32 | 33 | merchant_acceptor_id: str 34 | """Unique identifier to identify the payment card acceptor.""" 35 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_credit_authorization_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateCreditAuthorizationResponse"] 8 | 9 | 10 | class TransactionSimulateCreditAuthorizationResponse(BaseModel): 11 | token: Optional[str] = None 12 | """A unique token to reference this transaction.""" 13 | 14 | debugging_request_id: Optional[str] = None 15 | """Debugging request ID to share with Lithic Support team.""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_return_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["TransactionSimulateReturnParams"] 8 | 9 | 10 | class TransactionSimulateReturnParams(TypedDict, total=False): 11 | amount: Required[int] 12 | """Amount (in cents) to authorize.""" 13 | 14 | descriptor: Required[str] 15 | """Merchant descriptor.""" 16 | 17 | pan: Required[str] 18 | """Sixteen digit card number.""" 19 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_return_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateReturnResponse"] 8 | 9 | 10 | class TransactionSimulateReturnResponse(BaseModel): 11 | token: Optional[str] = None 12 | """A unique token to reference this transaction.""" 13 | 14 | debugging_request_id: Optional[str] = None 15 | """Debugging request ID to share with Lithic Support team.""" 16 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_return_reversal_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Required, TypedDict 6 | 7 | __all__ = ["TransactionSimulateReturnReversalParams"] 8 | 9 | 10 | class TransactionSimulateReturnReversalParams(TypedDict, total=False): 11 | token: Required[str] 12 | """The transaction token returned from the /v1/simulate/authorize response.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_return_reversal_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateReturnReversalResponse"] 8 | 9 | 10 | class TransactionSimulateReturnReversalResponse(BaseModel): 11 | debugging_request_id: Optional[str] = None 12 | """Debugging request ID to share with Lithic Support team.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_void_params.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from typing_extensions import Literal, Required, TypedDict 6 | 7 | __all__ = ["TransactionSimulateVoidParams"] 8 | 9 | 10 | class TransactionSimulateVoidParams(TypedDict, total=False): 11 | token: Required[str] 12 | """The transaction token returned from the /v1/simulate/authorize response.""" 13 | 14 | amount: int 15 | """Amount (in cents) to void. 16 | 17 | Typically this will match the amount in the original authorization, but can be 18 | less. 19 | """ 20 | 21 | type: Literal["AUTHORIZATION_EXPIRY", "AUTHORIZATION_REVERSAL"] 22 | """Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. 23 | 24 | - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed 25 | by Lithic. 26 | - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. 27 | """ 28 | -------------------------------------------------------------------------------- /src/lithic/types/transaction_simulate_void_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import Optional 4 | 5 | from .._models import BaseModel 6 | 7 | __all__ = ["TransactionSimulateVoidResponse"] 8 | 9 | 10 | class TransactionSimulateVoidResponse(BaseModel): 11 | debugging_request_id: Optional[str] = None 12 | """Debugging request ID to share with Lithic Support team.""" 13 | -------------------------------------------------------------------------------- /src/lithic/types/transactions/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .enhanced_commercial_data_retrieve_response import ( 6 | EnhancedCommercialDataRetrieveResponse as EnhancedCommercialDataRetrieveResponse, 7 | ) 8 | -------------------------------------------------------------------------------- /src/lithic/types/transactions/enhanced_commercial_data_retrieve_response.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing import List 4 | 5 | from ..._models import BaseModel 6 | from .events.enhanced_data import EnhancedData 7 | 8 | __all__ = ["EnhancedCommercialDataRetrieveResponse"] 9 | 10 | 11 | class EnhancedCommercialDataRetrieveResponse(BaseModel): 12 | data: List[EnhancedData] 13 | -------------------------------------------------------------------------------- /src/lithic/types/transactions/events/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from __future__ import annotations 4 | 5 | from .enhanced_data import EnhancedData as EnhancedData 6 | -------------------------------------------------------------------------------- /src/lithic/types/verification_method.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | 3 | from typing_extensions import Literal, TypeAlias 4 | 5 | __all__ = ["VerificationMethod"] 6 | 7 | VerificationMethod: TypeAlias = Literal["MANUAL", "MICRO_DEPOSIT", "PLAID", "PRENOTE", "EXTERNALLY_VERIFIED"] 8 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/auth_rules/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/auth_rules/v2/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/cards/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/credit_products/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/events/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/external_bank_accounts/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/financial_accounts/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/financial_accounts/statements/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/reports/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/reports/settlement/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/three_ds/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/transactions/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/api_resources/transactions/events/__init__.py: -------------------------------------------------------------------------------- 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 2 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import os 4 | import logging 5 | from typing import TYPE_CHECKING, Iterator, AsyncIterator 6 | 7 | import pytest 8 | from pytest_asyncio import is_async_test 9 | 10 | from lithic import Lithic, AsyncLithic 11 | 12 | if TYPE_CHECKING: 13 | from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] 14 | 15 | pytest.register_assert_rewrite("tests.utils") 16 | 17 | logging.getLogger("lithic").setLevel(logging.DEBUG) 18 | 19 | 20 | # automatically add `pytest.mark.asyncio()` to all of our async tests 21 | # so we don't have to add that boilerplate everywhere 22 | def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: 23 | pytest_asyncio_tests = (item for item in items if is_async_test(item)) 24 | session_scope_marker = pytest.mark.asyncio(loop_scope="session") 25 | for async_test in pytest_asyncio_tests: 26 | async_test.add_marker(session_scope_marker, append=False) 27 | 28 | 29 | base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") 30 | 31 | api_key = "My Lithic API Key" 32 | 33 | 34 | @pytest.fixture(scope="session") 35 | def client(request: FixtureRequest) -> Iterator[Lithic]: 36 | strict = getattr(request, "param", True) 37 | if not isinstance(strict, bool): 38 | raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") 39 | 40 | with Lithic(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: 41 | yield client 42 | 43 | 44 | @pytest.fixture(scope="session") 45 | async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncLithic]: 46 | strict = getattr(request, "param", True) 47 | if not isinstance(strict, bool): 48 | raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") 49 | 50 | async with AsyncLithic(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: 51 | yield client 52 | -------------------------------------------------------------------------------- /tests/sample_file.txt: -------------------------------------------------------------------------------- 1 | Hello, world! 2 | -------------------------------------------------------------------------------- /tests/test_deepcopy.py: -------------------------------------------------------------------------------- 1 | from lithic._utils import deepcopy_minimal 2 | 3 | 4 | def assert_different_identities(obj1: object, obj2: object) -> None: 5 | assert obj1 == obj2 6 | assert id(obj1) != id(obj2) 7 | 8 | 9 | def test_simple_dict() -> None: 10 | obj1 = {"foo": "bar"} 11 | obj2 = deepcopy_minimal(obj1) 12 | assert_different_identities(obj1, obj2) 13 | 14 | 15 | def test_nested_dict() -> None: 16 | obj1 = {"foo": {"bar": True}} 17 | obj2 = deepcopy_minimal(obj1) 18 | assert_different_identities(obj1, obj2) 19 | assert_different_identities(obj1["foo"], obj2["foo"]) 20 | 21 | 22 | def test_complex_nested_dict() -> None: 23 | obj1 = {"foo": {"bar": [{"hello": "world"}]}} 24 | obj2 = deepcopy_minimal(obj1) 25 | assert_different_identities(obj1, obj2) 26 | assert_different_identities(obj1["foo"], obj2["foo"]) 27 | assert_different_identities(obj1["foo"]["bar"], obj2["foo"]["bar"]) 28 | assert_different_identities(obj1["foo"]["bar"][0], obj2["foo"]["bar"][0]) 29 | 30 | 31 | def test_simple_list() -> None: 32 | obj1 = ["a", "b", "c"] 33 | obj2 = deepcopy_minimal(obj1) 34 | assert_different_identities(obj1, obj2) 35 | 36 | 37 | def test_nested_list() -> None: 38 | obj1 = ["a", [1, 2, 3]] 39 | obj2 = deepcopy_minimal(obj1) 40 | assert_different_identities(obj1, obj2) 41 | assert_different_identities(obj1[1], obj2[1]) 42 | 43 | 44 | class MyObject: ... 45 | 46 | 47 | def test_ignores_other_types() -> None: 48 | # custom classes 49 | my_obj = MyObject() 50 | obj1 = {"foo": my_obj} 51 | obj2 = deepcopy_minimal(obj1) 52 | assert_different_identities(obj1, obj2) 53 | assert obj1["foo"] is my_obj 54 | 55 | # tuples 56 | obj3 = ("a", "b") 57 | obj4 = deepcopy_minimal(obj3) 58 | assert obj3 is obj4 59 | -------------------------------------------------------------------------------- /tests/test_files.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import anyio 4 | import pytest 5 | from dirty_equals import IsDict, IsList, IsBytes, IsTuple 6 | 7 | from lithic._files import to_httpx_files, async_to_httpx_files 8 | 9 | readme_path = Path(__file__).parent.parent.joinpath("README.md") 10 | 11 | 12 | def test_pathlib_includes_file_name() -> None: 13 | result = to_httpx_files({"file": readme_path}) 14 | print(result) 15 | assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) 16 | 17 | 18 | def test_tuple_input() -> None: 19 | result = to_httpx_files([("file", readme_path)]) 20 | print(result) 21 | assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) 22 | 23 | 24 | @pytest.mark.asyncio 25 | async def test_async_pathlib_includes_file_name() -> None: 26 | result = await async_to_httpx_files({"file": readme_path}) 27 | print(result) 28 | assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) 29 | 30 | 31 | @pytest.mark.asyncio 32 | async def test_async_supports_anyio_path() -> None: 33 | result = await async_to_httpx_files({"file": anyio.Path(readme_path)}) 34 | print(result) 35 | assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) 36 | 37 | 38 | @pytest.mark.asyncio 39 | async def test_async_tuple_input() -> None: 40 | result = await async_to_httpx_files([("file", readme_path)]) 41 | print(result) 42 | assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) 43 | 44 | 45 | def test_string_not_allowed() -> None: 46 | with pytest.raises(TypeError, match="Expected file types input to be a FileContent type or to be a tuple"): 47 | to_httpx_files( 48 | { 49 | "file": "foo", # type: ignore 50 | } 51 | ) 52 | -------------------------------------------------------------------------------- /tests/test_utils/test_proxy.py: -------------------------------------------------------------------------------- 1 | import operator 2 | from typing import Any 3 | from typing_extensions import override 4 | 5 | from lithic._utils import LazyProxy 6 | 7 | 8 | class RecursiveLazyProxy(LazyProxy[Any]): 9 | @override 10 | def __load__(self) -> Any: 11 | return self 12 | 13 | def __call__(self, *_args: Any, **_kwds: Any) -> Any: 14 | raise RuntimeError("This should never be called!") 15 | 16 | 17 | def test_recursive_proxy() -> None: 18 | proxy = RecursiveLazyProxy() 19 | assert repr(proxy) == "RecursiveLazyProxy" 20 | assert str(proxy) == "RecursiveLazyProxy" 21 | assert dir(proxy) == [] 22 | assert type(proxy).__name__ == "RecursiveLazyProxy" 23 | assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" 24 | 25 | 26 | def test_isinstance_does_not_error() -> None: 27 | class AlwaysErrorProxy(LazyProxy[Any]): 28 | @override 29 | def __load__(self) -> Any: 30 | raise RuntimeError("Mocking missing dependency") 31 | 32 | proxy = AlwaysErrorProxy() 33 | assert not isinstance(proxy, dict) 34 | assert isinstance(proxy, LazyProxy) 35 | --------------------------------------------------------------------------------