diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caa48e49..62c060cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' @@ -16,15 +18,15 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/lithic-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: '22' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap @@ -35,18 +37,18 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ${{ github.repository == 'stainless-sdks/lithic-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: '22' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap @@ -55,14 +57,18 @@ jobs: run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/lithic-typescript' + if: |- + github.repository == 'stainless-sdks/lithic-typescript' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/lithic-typescript' + if: |- + github.repository == 'stainless-sdks/lithic-typescript' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} @@ -70,7 +76,9 @@ jobs: run: ./scripts/utils/upload-artifact.sh - name: Upload MCP Server tarball - if: github.repository == 'stainless-sdks/lithic-typescript' + if: |- + github.repository == 'stainless-sdks/lithic-typescript' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s?subpackage=mcp-server AUTH: ${{ steps.github-oidc.outputs.github_token }} @@ -80,15 +88,15 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/lithic-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: '22' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 0cb165d0..531d4bc5 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -18,14 +18,15 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: - node-version: '20' + node-version: '24' - name: Install dependencies run: | @@ -33,14 +34,14 @@ jobs: - name: Publish to NPM run: | - if [ -n "${{ github.event.inputs.path }}" ]; then - PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]' + if [ -n "$INPUT_PATH" ]; then + PATHS_RELEASED="[\"$INPUT_PATH\"]" else PATHS_RELEASED='[\".\", \"packages/mcp-server\"]' fi yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }" env: - NPM_TOKEN: ${{ secrets.LITHIC_NPM_TOKEN || secrets.NPM_TOKEN }} + INPUT_PATH: ${{ github.event.inputs.path }} - name: Upload MCP Server DXT GitHub release asset run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 764a1778..b12956ad 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,10 +12,8 @@ jobs: if: github.repository == 'lithic-com/lithic-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | bash ./bin/check-release-environment - env: - NPM_TOKEN: ${{ secrets.LITHIC_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index d62bea50..ae4aa20e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log node_modules yarn-error.log codegen.log @@ -10,3 +11,4 @@ dist-deno .eslintcache dist-bundle *.mcpb +oidc diff --git a/.prettierignore b/.prettierignore index 7cc13dd1..36afd3b3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ CHANGELOG.md /ecosystem-tests/*/** /node_modules /deno +/packages/mcp-server/manifest.json # don't format tsc output, will break source maps dist diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e074c76b..80e5148f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.131.0" + ".": "0.145.0" } diff --git a/.stats.yml b/.stats.yml index 4f6a4f90..a5715819 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 185 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ee8607f0a2cdcaee420935050334a439db8dd097be83023fccdaf1d6f9a7de14.yml -openapi_spec_hash: 0f21c68cdddb7c5bd99f42356d507393 -config_hash: fb5070d41fcabdedbc084b83964b592a +configured_endpoints: 214 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-59c09c7355b21b663e001d2ee1086ebd0a70d9b5433823282bca296eedff9eb0.yml +openapi_spec_hash: d9c3b932c810809abc6e973d662ad376 +config_hash: 337a99d8cc30006358b7bc2531401669 diff --git a/CHANGELOG.md b/CHANGELOG.md index d2251d06..a5708a87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,361 @@ # Changelog +## 0.145.0 (2026-07-30) + +Full Changelog: [v0.144.0...v0.145.0](https://github.com/lithic-com/lithic-node/compare/v0.144.0...v0.145.0) + +### Features + +* **api:** add disposition_reasons to queues, change resolution to string in cases ([9c65c76](https://github.com/lithic-com/lithic-node/commit/9c65c76d0ef943edf94cf62f457a5335604012cb)) +* **api:** add embed.session_generated and embed.viewed webhook event types ([11b01a3](https://github.com/lithic-com/lithic-node/commit/11b01a39d4e6d861ec9d344c307bd93217a0e2ce)) +* **api:** add PAYMENT enum value to category in book-transfers ([5336e09](https://github.com/lithic-com/lithic-node/commit/5336e09f4a90efeb39a9f8491fe1a82be988efd1)) +* **api:** add program transfer types to account-activity/book-transfers/payments/statements ([d155fa9](https://github.com/lithic-com/lithic-node/commit/d155fa9be4a7651f4b78eded6f4767605404ff47)) +* **api:** add RECIPIENT_NAME attribute to auth_rules v2 ACH conditions ([8e4fabf](https://github.com/lithic-com/lithic-node/commit/8e4fabf684652eef7aceafa5c596789d847f7a67)) +* **api:** add recipient_name field to payments ACH method attributes ([bef9676](https://github.com/lithic-com/lithic-node/commit/bef9676f9671813de6635b6dc4c8034fa6b8649a)) +* **api:** add REVERSED status value to payments list method ([90fff93](https://github.com/lithic-com/lithic-node/commit/90fff936c58e73762751dc3748124a399fdff53e)) +* **api:** add stablecoin category and events to account-activity/payments/line-items ([ccf6dd6](https://github.com/lithic-com/lithic-node/commit/ccf6dd626e4ba0c02774dfcea004a0e7885a87b4)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([82e45d9](https://github.com/lithic-com/lithic-node/commit/82e45d9b890c8137b8bb6847a4728730b10d359f)) + + +### Bug Fixes + +* **ci:** bump @arethetypeswrong/cli to ^0.18.0 and run CI workflows on Node 24 ([26e94a9](https://github.com/lithic-com/lithic-node/commit/26e94a90083a853ff7ff5ec8ae0f45ef05e8ed20)) +* **types:** make comment, created_at, fraud_type, updated_at nullable in fraud transactions ([942f058](https://github.com/lithic-com/lithic-node/commit/942f0586ac274cebbe2a1e7f8ae194d1e42aa16f)) + + +### Chores + +* **internal:** codegen related update ([37e6a52](https://github.com/lithic-com/lithic-node/commit/37e6a52f3ed2e184da527a3a34b438819d26b43b)) + + +### Documentation + +* **api:** clarify last_transaction_event_token parameter in balances.list ([e58facc](https://github.com/lithic-com/lithic-node/commit/e58facc09ecf8111c2339deb9d9dcc6e243d9084)) +* **api:** expand dispute event descriptions in events resource ([6f33a7e](https://github.com/lithic-com/lithic-node/commit/6f33a7eac9ba69995d7cfdd4edba0e9844e0a2ec)) +* **api:** update category parameter description in externalPayments.list ([ffeabcb](https://github.com/lithic-com/lithic-node/commit/ffeabcba30c154d65bcf9c2fb3f74d8c90acd3cd)) +* **api:** update max duration in auth-rules v2 trailing window ([5185f3d](https://github.com/lithic-com/lithic-node/commit/5185f3dc6140363506626d135091e0a337f6ea79)) +* **api:** update simulate_clearing method documentation in transactions ([ce3f22c](https://github.com/lithic-com/lithic-node/commit/ce3f22c7e0a90684772cd4c82c361763c9fcc063)) + +## 0.144.0 (2026-06-29) + +Full Changelog: [v0.143.0...v0.144.0](https://github.com/lithic-com/lithic-node/compare/v0.143.0...v0.144.0) + +### Features + +* **api:** add category discriminator and payment fields to case transactions ([c9a95d6](https://github.com/lithic-com/lithic-node/commit/c9a95d61c333d322c161adec65b150ba2e642f2c)) + + +### Documentation + +* **api:** update cash_amount field description in card authorizations ([44ba106](https://github.com/lithic-com/lithic-node/commit/44ba1065817708a268b35164b90b83b5d577a223)) + +## 0.143.0 (2026-06-23) + +Full Changelog: [v0.142.0...v0.143.0](https://github.com/lithic-com/lithic-node/compare/v0.142.0...v0.143.0) + +### Features + +* **api:** add claim and claim_document webhook events ([0fa2723](https://github.com/lithic-com/lithic-node/commit/0fa2723a5ee4fe9dece58a2b43bb65a6b6b04958)) +* **api:** add external bank/payment velocity/decline history features to auth_rules.v2 ([36a5b96](https://github.com/lithic-com/lithic-node/commit/36a5b96edf49100892ca36d6dc3931eba1c99603)) + +## 0.142.0 (2026-06-22) + +Full Changelog: [v0.141.0...v0.142.0](https://github.com/lithic-com/lithic-node/compare/v0.141.0...v0.142.0) + +### Features + +* **api:** add ACH payment update support to auth_rules v2 ([de080ce](https://github.com/lithic-com/lithic-node/commit/de080ce7c0d196f5e338ed45241730a7a18606c1)) +* **api:** add ACH_EVENT_TYPE attribute to auth rules v2 conditional parameters ([6f32c28](https://github.com/lithic-com/lithic-node/commit/6f32c287533ea0238cd2564179f96b7eee218ab5)) + +## 0.141.0 (2026-06-16) + +Full Changelog: [v0.140.0...v0.141.0](https://github.com/lithic-com/lithic-node/compare/v0.140.0...v0.141.0) + +### Features + +* **api:** add CARD_TRANSACTION feature type to auth rules ([b0a0853](https://github.com/lithic-com/lithic-node/commit/b0a08535053d12a9ccfbdb087ca70877e180aee8)) +* **api:** add condition attributes and parameters to auth rules v2 ([7723499](https://github.com/lithic-com/lithic-node/commit/7723499e44b8191fa1b0b1738baac2b474e8e9c4)) +* **api:** Add created field and make completed_at nullable in latest_challenge ([a346991](https://github.com/lithic-com/lithic-node/commit/a346991c4221e91a0ca9745c8d16af4ed4c5cbd4)) +* **api:** add day_of_period field to loan tapes response ([68b8a9d](https://github.com/lithic-com/lithic-node/commit/68b8a9d3d1d1cd18d8adeb50546a5e805e6c05b4)) +* **api:** add hold adjustment action option to auth_rules.v2 ([a5646fa](https://github.com/lithic-com/lithic-node/commit/a5646face60183e7d600d5004d0e202b69152d00)) +* **api:** add name_validation field to card authorizations ([648f48a](https://github.com/lithic-com/lithic-node/commit/648f48aedafe4f636947ec86e70b5d1ab0e37426)) +* **api:** add route method to transactions ([543639a](https://github.com/lithic-com/lithic-node/commit/543639ac51ca316a0c2d5f23331dbbea1153aa82)) +* **api:** add tags field to payment responses ([527bd29](https://github.com/lithic-com/lithic-node/commit/527bd292b5baf8f564ba84abf27d40dd4227a937)) +* **api:** add transactionMonitoring resource with cases/queues/comments/files endpoints ([a156e4d](https://github.com/lithic-com/lithic-node/commit/a156e4d97d05084c8eefbb31da50a17a4e119bef)) + + +### Bug Fixes + +* **client:** send content-type header for requests with an omitted optional body ([7d5d03d](https://github.com/lithic-com/lithic-node/commit/7d5d03d08f8d686740cdda7888a14efcadc4f565)) +* **mcp:** use `pure-lockfile` when building mcp server ([52fcdae](https://github.com/lithic-com/lithic-node/commit/52fcdae2df3264e79c2a9550630f2cca1f3c563b)) + + +### Documentation + +* **api:** update support contact from email to URL ([6d084ee](https://github.com/lithic-com/lithic-node/commit/6d084ee96a3684fcb9bb70d08a5574193fa906ce)) + +## 0.140.0 (2026-05-26) + +Full Changelog: [v0.139.0...v0.140.0](https://github.com/lithic-com/lithic-node/compare/v0.139.0...v0.140.0) + +### Features + +* **api:** add card_authorization.challenge webhook event ([aa5e447](https://github.com/lithic-com/lithic-node/commit/aa5e44751b46b22055da3691529cae688f6d6ce5)) +* **api:** add INVALID_PAN decline reason to tokenizations ([f0eb327](https://github.com/lithic-com/lithic-node/commit/f0eb327cd86e7c7e30a638c21730ae8b66702462)) +* **api:** add method field, DECLINED status, OUT_OF_BAND support to card authorization challenges ([79c9536](https://github.com/lithic-com/lithic-node/commit/79c953636648586dfb86bec7af468ae36ca52a51)) +* **api:** add pause method to external_bank_accounts ([5f3dea5](https://github.com/lithic-com/lithic-node/commit/5f3dea57b07b6262adf87eb6e216e98f21b0cabf)) +* **api:** Add schemas for authorization adjustment rules ([d439bf0](https://github.com/lithic-com/lithic-node/commit/d439bf0501982f64dfcd3419e75397f2f7b0e6d3)) + + +### Bug Fixes + +* **api:** Change conditional value numeric type from integer to number ([6e86c29](https://github.com/lithic-com/lithic-node/commit/6e86c2959478dae721d835a3816b7cc599927131)) +* **types:** add null to parent_company, external_id, naics_code in account-holders ([4ef1a13](https://github.com/lithic-com/lithic-node/commit/4ef1a1308569bd8f1e6edb24ea7bb2a403a0edf6)) +* **typescript:** upgrade tsc-multi so that it works with Node 26 ([560e785](https://github.com/lithic-com/lithic-node/commit/560e785352d9abad5a580d4645330c77c23dad75)) +* **types:** expand enums and add nullability across balance/statement/report types ([cfdea1a](https://github.com/lithic-com/lithic-node/commit/cfdea1a9a1766656214a5ac8ed3e50ef50a497df)) +* **types:** make cardholder_currency nullable in CardProgram ([4367c8f](https://github.com/lithic-com/lithic-node/commit/4367c8f57b78dde57ce1524795629bd25584c111)) + + +### Chores + +* **tests:** remove redundant File import ([71e2edc](https://github.com/lithic-com/lithic-node/commit/71e2edcacfb63a0ecfb12ad7a953caffc1dd891c)) + + +### Documentation + +* **api:** clarify ACCOUNT_AGE attribute in auth rules v2 ([a492725](https://github.com/lithic-com/lithic-node/commit/a492725ac836e570ede0091904b38040d0b44446)) + +## 0.139.0 (2026-05-08) + +Full Changelog: [v0.138.0...v0.139.0](https://github.com/lithic-com/lithic-node/compare/v0.138.0...v0.139.0) + +### Features + +* **api:** add retrieveSignals methods to accounts and cards ([e5f850d](https://github.com/lithic-com/lithic-node/commit/e5f850d44eb9df6a5015f337954c287a294b7324)) +* **api:** add unit param and travel attributes to auth rules v2 conditions ([306ba11](https://github.com/lithic-com/lithic-node/commit/306ba11dc0e555f7d76c90eed21bd83a1e691458)) + + +### Chores + +* redact api-key headers in debug logs ([071bf9f](https://github.com/lithic-com/lithic-node/commit/071bf9fead1e4fd83819ccad85e1cffb6145ab03)) + +## 0.138.0 (2026-05-06) + +Full Changelog: [v0.137.0...v0.138.0](https://github.com/lithic-com/lithic-node/compare/v0.137.0...v0.138.0) + +### Features + +* **api:** add AMEX to network enum in settlement reports ([d0f5362](https://github.com/lithic-com/lithic-node/commit/d0f5362f7bc061d07058f1fd39cd5f843615ed7a)) +* **api:** add CARD_TRANSACTION_UPDATE support to auth rules v2 ([63b51b8](https://github.com/lithic-com/lithic-node/commit/63b51b81215e634bbfe0ec4e75155fa0f200e8f5)) +* **api:** add IS_NEW_MERCHANT metric to auth rules v2 ([f2b26de](https://github.com/lithic-com/lithic-node/commit/f2b26de0a41a087240c9214c2dc433f9a0cd85e4)) +* support setting headers via env ([2406cf7](https://github.com/lithic-com/lithic-node/commit/2406cf738dafa08c8c0e09a833c25b079c3c4887)) +* Update card expiration from 6 years to 5 years ([7031267](https://github.com/lithic-com/lithic-node/commit/7031267707c21414d050657426d5a0dcdfe7318e)) + + +### Bug Fixes + +* **types:** make fields nullable in account-holders, accounts, and cards ([c5475ef](https://github.com/lithic-com/lithic-node/commit/c5475ef1525294e6a50e47637e3479ae5b4c6866)) + + +### Chores + +* avoid formatting file that gets changed during releases ([062a350](https://github.com/lithic-com/lithic-node/commit/062a350217e39bf8b054c4bdfb3054cbfa7137ac)) +* **format:** run eslint and prettier separately ([10aa40f](https://github.com/lithic-com/lithic-node/commit/10aa40fd72fd0933d2bc331dfbec23ce97b6c62f)) +* **formatter:** run prettier and eslint separately ([d78245b](https://github.com/lithic-com/lithic-node/commit/d78245b7aad796549148adcf228d0077233d0419)) +* **internal:** codegen related update ([17f1170](https://github.com/lithic-com/lithic-node/commit/17f1170f306b327ae2766e6f55d0fa64cc9f7b62)) +* **internal:** codegen related update ([c38ad4c](https://github.com/lithic-com/lithic-node/commit/c38ad4c69e7bdaefbc8f6288b29206ec5157650a)) +* **internal:** more robust bootstrap script ([eb0bf7c](https://github.com/lithic-com/lithic-node/commit/eb0bf7c3e099e87bca8f2997d582fdb10a2b796c)) +* **internal:** update docs ordering ([bb95c1f](https://github.com/lithic-com/lithic-node/commit/bb95c1f529a85c3e04eab6783b1f7301e6085670)) +* restructure docs search code ([f64d754](https://github.com/lithic-com/lithic-node/commit/f64d75431f41bef55ed246bf3da3d8a1183fd327)) + + +### Documentation + +* **api:** improve SettlementDetail event_tokens and transaction_token descriptions ([4d4db79](https://github.com/lithic-com/lithic-node/commit/4d4db79662318ed08590ff8ab40e1f6d7ab0a8be)) +* clarify forwards compat behavior ([6d4c205](https://github.com/lithic-com/lithic-node/commit/6d4c205c664de06157fe7f8db7ed04fdab8625b2)) +* update http mcp docs ([e4ee6ee](https://github.com/lithic-com/lithic-node/commit/e4ee6ee7992ebca94156456cc8fc1e1dd904373c)) +* update logging docs ([0121676](https://github.com/lithic-com/lithic-node/commit/0121676332dd550c327a397f91b61aa7f7aff875)) +* update with proxy auth info ([ec4f6ca](https://github.com/lithic-com/lithic-node/commit/ec4f6ca8dfaefc3fe230109d3a09fdb53c1a3812)) + +## 0.137.0 (2026-04-20) + +Full Changelog: [v0.136.0...v0.137.0](https://github.com/lithic-com/lithic-node/compare/v0.136.0...v0.137.0) + +### Features + +* **api:** Add card/account/business account signals endpoints and behavioral rule attributes ([77e743c](https://github.com/lithic-com/lithic-node/commit/77e743c03583f477bd43aa1d600dd563912b53c4)) +* **api:** add CardAuthorizationChallengeResponseWebhookEvent to webhooks ([2e285c4](https://github.com/lithic-com/lithic-node/commit/2e285c4208849bab60afbc0036b5efdff77d6904)) +* **api:** add setVerificationMethod to externalBankAccounts ([fd9c676](https://github.com/lithic-com/lithic-node/commit/fd9c6762fc46e5da4e751e5d84a199356a374348)) + +## 0.136.0 (2026-04-13) + +Full Changelog: [v0.135.0...v0.136.0](https://github.com/lithic-com/lithic-node/compare/v0.135.0...v0.136.0) + +### Features + +* **api:** add decline count attributes to auth-rules v2 ([d004ede](https://github.com/lithic-com/lithic-node/commit/d004ede97fda3a5840c8843a648fe5a3977d2d30)) +* **api:** add DELINQUENT status value to financial accounts update params ([e40c1d9](https://github.com/lithic-com/lithic-node/commit/e40c1d908a6ca40e983df773bed1797dc894382e)) +* **api:** add INTERCHANGE, CHARGEBACK, PROVISIONAL_CREDIT_ACCOUNT to financial account type ([847706f](https://github.com/lithic-com/lithic-node/commit/847706f1adb413adcce81f7d1728109b699a6113)) +* **api:** add override_company_name parameter to payments ACH ([954b27e](https://github.com/lithic-com/lithic-node/commit/954b27e3fb8dd7b8c55ea57b42d878094efbe3d8)) +* **api:** add statement_totals field to Statement response ([e3813f7](https://github.com/lithic-com/lithic-node/commit/e3813f70cf8e408de65ec058a39b137cd74c2dfe)) +* **api:** add transaction_token field to auth rules v2 backtest and report responses ([20eedcc](https://github.com/lithic-com/lithic-node/commit/20eedccaeb35b01d243e136793834dec5b65dcb6)) +* **api:** add transaction_token field to auth rules v2 results response ([0f61795](https://github.com/lithic-com/lithic-node/commit/0f617957b0bd7b3ca6f75217b05ba4b3ff426ce3)) +* **types:** [breaking] remove deprecated fields from auth_rules v2 ReportStats ([3e9c80b](https://github.com/lithic-com/lithic-node/commit/3e9c80b8d44b870d024f8fa4d970fc59aed53d81)) + + +### Bug Fixes + +* **internal:** gitignore generated `oidc` dir ([08c0b61](https://github.com/lithic-com/lithic-node/commit/08c0b61957f3be0c9c52196cf5af017b136d64ee)) +* **types:** make credit_product_token optional in Statement ([17b829f](https://github.com/lithic-com/lithic-node/commit/17b829f64b633e5756eb186c390f19b4aabbb2db)) +* **types:** make fields required, remove hostname in card authorization approval webhook ([019491a](https://github.com/lithic-com/lithic-node/commit/019491ab1d75a48c2217a6979ac15484944dce6a)) +* **types:** remove INTERCHANGE/CHARGEBACK from FinancialAccount types ([d66715a](https://github.com/lithic-com/lithic-node/commit/d66715a88c2f6357b8fba7453d95970de855f277)) + + +### Chores + +* **ci:** escape input path in publish-npm workflow ([699d85e](https://github.com/lithic-com/lithic-node/commit/699d85e576bdb3d6c25f868c5b6bba2e3772598b)) +* **ci:** skip lint on metadata-only changes ([10dfba6](https://github.com/lithic-com/lithic-node/commit/10dfba6a8f96b1df7d76885f0a762f50b2ada322)) +* **internal:** codegen related update ([b35ca0b](https://github.com/lithic-com/lithic-node/commit/b35ca0bfac887f26f1639d750f3a3fc0388c8d4d)) +* **internal:** codegen related update ([b84877d](https://github.com/lithic-com/lithic-node/commit/b84877d5e9f041aee204663c7d57db835d29a3b7)) +* **internal:** codegen related update ([827a434](https://github.com/lithic-com/lithic-node/commit/827a4344ef5a4e6a47a58564a69373d1135dedcf)) +* **internal:** fix MCP docker image builds in yarn projects ([cd92ad7](https://github.com/lithic-com/lithic-node/commit/cd92ad7fd5d497ae09f9c90fb26171053f89a903)) +* **internal:** fix MCP server import ordering ([7c9afea](https://github.com/lithic-com/lithic-node/commit/7c9afea91945d7e2d6a1d0586f26b28b5fdec82e)) +* **internal:** improve local docs search for MCP servers ([f3658af](https://github.com/lithic-com/lithic-node/commit/f3658af5dfea2fa5b42c9471054945481153ef99)) +* **internal:** improve local docs search for MCP servers ([231f6a0](https://github.com/lithic-com/lithic-node/commit/231f6a037beea43f90512f3eb6bee560a0233a45)) +* **internal:** show error causes in MCP servers when running in local mode ([8f2eb65](https://github.com/lithic-com/lithic-node/commit/8f2eb65211100b293806548b520f5128b84ccf65)) +* **internal:** support custom-instructions-path flag in MCP servers ([21854f4](https://github.com/lithic-com/lithic-node/commit/21854f4bfde44d17f4f22a0f25913f7e91d87c21)) +* **internal:** support local docs search in MCP servers ([c7f9b6a](https://github.com/lithic-com/lithic-node/commit/c7f9b6a3ef5ebd16763c7f17b9c93b407e32a4b2)) +* **internal:** support type annotations when running MCP in local execution mode ([4f94af4](https://github.com/lithic-com/lithic-node/commit/4f94af4683c5c6116e230e95388685066063483b)) +* **internal:** use link instead of file in MCP server package.json files ([9c8e9af](https://github.com/lithic-com/lithic-node/commit/9c8e9af13c7acbda7f78121bd6097e8d0665e1e5)) +* **mcp-server:** add support for session id, forward client info ([9f3f1cb](https://github.com/lithic-com/lithic-node/commit/9f3f1cbbb34756d4d92ef000e9554a7580a775d8)) +* **mcp-server:** increase local docs search result count from 5 to 10 ([b95dd60](https://github.com/lithic-com/lithic-node/commit/b95dd6002ff69d5cc2b19a95c0b863572ad48480)) +* **mcp-server:** log client info ([2e1174a](https://github.com/lithic-com/lithic-node/commit/2e1174ac9aa88945719d45758ea713ebc5c8eaa8)) + + +### Documentation + +* **api:** clarify nature_of_business and qr_code_url field constraints ([c36c997](https://github.com/lithic-com/lithic-node/commit/c36c99779ede1d40967ed1763e5124e2f38c3db1)) +* improve examples ([5a40af5](https://github.com/lithic-com/lithic-node/commit/5a40af54023b5d717dbfce50088591f1246d88e9)) +* update examples ([4f9b19d](https://github.com/lithic-com/lithic-node/commit/4f9b19ded173c5e63fbde1c5228c621dff77dc64)) + +## 0.135.0 (2026-03-23) + +Full Changelog: [v0.134.0...v0.135.0](https://github.com/lithic-com/lithic-node/compare/v0.134.0...v0.135.0) + +### Features + +* **api:** add card_age/account_age attributes to auth rules v2 ([37971d6](https://github.com/lithic-com/lithic-node/commit/37971d6f89e503b4e7cdc0425ac7ae3c2ebf80c4)) +* **api:** add override_company_name parameter to external payments create ([868f064](https://github.com/lithic-com/lithic-node/commit/868f064eec2ebc0a5aaa1d22ee6aae5b860b9219)) +* **api:** add service location fields to auth rules v2 and merchant models ([c364f7b](https://github.com/lithic-com/lithic-node/commit/c364f7b5924ee351a1a30f65bd79abfec12848d2)) + + +### Chores + +* **internal:** fix MCP server TS errors that occur with required client options ([42fb3a8](https://github.com/lithic-com/lithic-node/commit/42fb3a8cd1fb71ab45617036d96a70e57cf1a7af)) +* **internal:** switch from steady to prism for mock server ([90699a3](https://github.com/lithic-com/lithic-node/commit/90699a32f04947398a9ca20308a477a88cf589c9)) +* **internal:** update gitignore ([b49bfc6](https://github.com/lithic-com/lithic-node/commit/b49bfc659568b0a11a097def35e053985144d386)) +* **tests:** bump steady to v0.19.4 ([9491eb7](https://github.com/lithic-com/lithic-node/commit/9491eb75d9b0618688f2dc66fb4d2930c959ad51)) +* **tests:** bump steady to v0.19.5 ([37b04df](https://github.com/lithic-com/lithic-node/commit/37b04dfd4ac5ef9fee33d19cfb396cd8dbccc1d4)) +* **tests:** bump steady to v0.19.6 ([f9125f0](https://github.com/lithic-com/lithic-node/commit/f9125f0c12d7b6d66c6ebb50a2f5f1ab96cfe70a)) + + +### Documentation + +* **api:** update nature_of_business and qr_code_url field descriptions ([3f262d6](https://github.com/lithic-com/lithic-node/commit/3f262d6318c01ab2c1535387bd8bc98361c615bb)) + + +### Refactors + +* **tests:** switch from prism to steady ([5d648e0](https://github.com/lithic-com/lithic-node/commit/5d648e0e62eb55e2c27e252d120054ec3878e37e)) + +## 0.134.0 (2026-03-17) + +Full Changelog: [v0.133.0...v0.134.0](https://github.com/lithic-com/lithic-node/compare/v0.133.0...v0.134.0) + +### Features + +* **api:** add remittance_information field to Payment ([133fe04](https://github.com/lithic-com/lithic-node/commit/133fe04e55a65208567a8056a96f8c5c91a641d1)) + + +### Bug Fixes + +* **types:** make address/dob/email/government_id optional in account-holders ([0966648](https://github.com/lithic-com/lithic-node/commit/0966648a478b19bff02dd8ee63cfa53f8db2454b)) + + +### Chores + +* **internal:** support x-stainless-mcp-client-permissions headers in MCP servers ([f5266e6](https://github.com/lithic-com/lithic-node/commit/f5266e6e139b91a9899b11f700c8ac0ca69b8d70)) +* **internal:** switch npm publishing from token authentication to OIDC ([2831ff1](https://github.com/lithic-com/lithic-node/commit/2831ff1d00c616a9ddac7bf9ea24ebc05cdd367b)) +* **internal:** tweak CI branches ([cb5acc3](https://github.com/lithic-com/lithic-node/commit/cb5acc3a9fe4ac157eb4876aab37345c39600e70)) + + +### Documentation + +* **api:** update supported file types in account holder document uploads ([dd26f0e](https://github.com/lithic-com/lithic-node/commit/dd26f0e7be9459b45b37fb3795c0522a6f1a81fc)) + +## 0.133.0 (2026-03-16) + +Full Changelog: [v0.132.1...v0.133.0](https://github.com/lithic-com/lithic-node/compare/v0.132.1...v0.133.0) + +### Features + +* **api:** add ACH_RECEIPT_RELEASED_EARLY event type to payments ([0bb4d95](https://github.com/lithic-com/lithic-node/commit/0bb4d953f34885a6803e4abfbee90d2839886f81)) +* **api:** add excluded_account_tokens to auth rules v2 ([30cfe26](https://github.com/lithic-com/lithic-node/commit/30cfe260a66896cab48aeb4f5c7abd884704dfce)) +* **api:** add mcp-server package, CI/CD workflows, build scripts, update README ([d942481](https://github.com/lithic-com/lithic-node/commit/d942481202af958f1a60a6584bec8803927b9a63)) +* **api:** add penalty_rates field to interest tier schedule ([aa412d0](https://github.com/lithic-com/lithic-node/commit/aa412d01a8256c187bf23275a5fb1a017793539e)) +* **api:** add versions field to auth rules v2 report response ([aa20bdb](https://github.com/lithic-com/lithic-node/commit/aa20bdbca0982173e9dff5f9fa56a5cc9162bdbb)) +* **api:** add WIRE category/events, remove remittance_information from payments ([8808ca2](https://github.com/lithic-com/lithic-node/commit/8808ca292e45a4a6e0479e8bfff9122fb58634b6)) + + +### Bug Fixes + +* **api:** [breaking] unify webhook schemas for digital_wallet.tokenization_approval_request webhooks ([4166fbc](https://github.com/lithic-com/lithic-node/commit/4166fbc084b226872d7418c5d086fc7a156f6797)) +* **types:** make start/end required, remove auth_rule_token from backtests ([f61f218](https://github.com/lithic-com/lithic-node/commit/f61f21812b7ea528969ac97ceb0e3bbb72570e3c)) + + +### Chores + +* **internal:** regenerate SDK with no functional changes ([1c21ea8](https://github.com/lithic-com/lithic-node/commit/1c21ea83d2d4e770561b18419da2f320a9cb6d69)) + + +### Documentation + +* **api:** update disputes terminology to chargeback request ([2128851](https://github.com/lithic-com/lithic-node/commit/2128851ca772d5405e62ca4ede55a942b976cf3e)) + +## 0.132.1 (2026-03-10) + +Full Changelog: [v0.132.0...v0.132.1](https://github.com/lithic-com/lithic-node/compare/v0.132.0...v0.132.1) + +### Features + +* **api:** Add event_subtype to statement line items ([82db0f8](https://github.com/lithic-com/lithic-node/commit/82db0f8a69ac22f76e969e4b823edf0bdf6b7902)) +* **api:** add loan_tape_date field to statement line items ([a3995b6](https://github.com/lithic-com/lithic-node/commit/a3995b63bb7e002ff75d394a46f0019016a835ba)) + + +### Chores + +* **ci:** updating publishing method ([02b0749](https://github.com/lithic-com/lithic-node/commit/02b0749de158843219bf095b34a5b5b1adb14a7d)) + +## 0.132.0 (2026-03-10) + +Full Changelog: [v0.131.0...v0.132.0](https://github.com/lithic-com/lithic-node/compare/v0.131.0...v0.132.0) + +### Features + +* **api:** add EARLY_DIRECT_DEPOSIT_FLOAT type to financial accounts ([20f0c4c](https://github.com/lithic-com/lithic-node/commit/20f0c4c6c467249ddea477e0bf4f5da955e48f4b)) +* **api:** add typescript rule type, draft state tracking to auth_rules v2 ([8f4eabb](https://github.com/lithic-com/lithic-node/commit/8f4eabbe9bf4783e2fb8d118ca8c37e84f7d8195)) + + +### Bug Fixes + +* **api:** Disable MCP server to fix TypeScript SDK package publishing ([8a4d2aa](https://github.com/lithic-com/lithic-node/commit/8a4d2aa3836e03a03de6aa83cb5ccf9a8ef74b59)) + + +### Chores + +* **internal:** update dependencies to address dependabot vulnerabilities ([fefdd61](https://github.com/lithic-com/lithic-node/commit/fefdd61fef00c32078fba74255eac7069c5025e7)) +* **mcp-server:** improve instructions ([8051570](https://github.com/lithic-com/lithic-node/commit/80515701dff9212cda75a39a5ef9dfd2a02a877e)) + ## 0.131.0 (2026-03-05) Full Changelog: [v0.130.0...v0.131.0](https://github.com/lithic-com/lithic-node/compare/v0.130.0...v0.131.0) diff --git a/MIGRATION.md b/MIGRATION.md index eb3794cb..0a144080 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -57,6 +57,10 @@ This affects the following methods: - `client.accountHolders.retrieveDocument()` - `client.accountHolders.entities.delete()` - `client.authRules.v2.backtests.retrieve()` +- `client.transactionMonitoring.cases.comments.update()` +- `client.transactionMonitoring.cases.comments.delete()` +- `client.transactionMonitoring.cases.files.retrieve()` +- `client.transactionMonitoring.cases.files.delete()` - `client.cards.financialTransactions.retrieve()` - `client.disputes.deleteEvidence()` - `client.disputes.retrieveEvidence()` @@ -105,6 +109,11 @@ client.example.list(undefined, { headers: { ... } }); - `client.authRules.v2.list()` - `client.authRules.v2.listResults()` - `client.authRules.v2.retrieveFeatures()` +- `client.transactionMonitoring.cases.list()` +- `client.transactionMonitoring.cases.listActivity()` +- `client.transactionMonitoring.cases.listTransactions()` +- `client.transactionMonitoring.cases.files.list()` +- `client.transactionMonitoring.queues.list()` - `client.tokenizations.list()` - `client.tokenizations.resendActivationCode()` - `client.tokenizations.updateDigitalCardArt()` @@ -147,6 +156,7 @@ client.example.list(undefined, { headers: { ... } }); - `client.managementOperations.list()` - `client.fundingEvents.list()` - `client.networkPrograms.list()` +- `client.holds.list()` - `client.accountActivity.list()` - `client.transferLimits.list()` diff --git a/api.md b/api.md index 405a5437..c0fb86ce 100644 --- a/api.md +++ b/api.md @@ -34,6 +34,7 @@ Methods: - client.accounts.retrieve(accountToken) -> Account - client.accounts.update(accountToken, { ...params }) -> Account - client.accounts.list({ ...params }) -> AccountsCursorPage +- client.accounts.retrieveSignals(accountToken) -> SignalsResponse - client.accounts.retrieveSpendLimits(accountToken) -> AccountSpendLimits # AccountHolders @@ -78,27 +79,42 @@ Methods: # AuthRules +Types: + +- SignalsResponse + ## V2 Types: +- ACHPaymentUpdateAction - AuthRule - AuthRuleCondition +- AuthRuleVersion - BacktestStats +- CardTransactionUpdateAction - Conditional3DSActionParameters - ConditionalACHActionParameters +- ConditionalACHPaymentUpdateActionParameters - ConditionalAttribute - ConditionalAuthorizationActionParameters +- ConditionalAuthorizationAdjustmentParameters - ConditionalBlockParameters +- ConditionalCardTransactionUpdateActionParameters - ConditionalOperation - ConditionalTokenizationActionParameters - ConditionalValue - EventStream - MerchantLockParameters - ReportStats +- RuleFeature +- SpendVelocityFilters +- TypescriptCodeParameters +- VelocityLimitFilters - VelocityLimitParams - VelocityLimitPeriod - V2ListResultsResponse +- V2ListVersionsResponse - V2RetrieveFeaturesResponse - V2RetrieveReportResponse @@ -111,6 +127,7 @@ Methods: - client.authRules.v2.delete(authRuleToken) -> void - client.authRules.v2.draft(authRuleToken, { ...params }) -> AuthRule - client.authRules.v2.listResults({ ...params }) -> V2ListResultsResponsesCursorPage +- client.authRules.v2.listVersions(authRuleToken) -> V2ListVersionsResponse - client.authRules.v2.promote(authRuleToken) -> AuthRule - client.authRules.v2.retrieveFeatures(authRuleToken, { ...params }) -> V2RetrieveFeaturesResponse - client.authRules.v2.retrieveReport(authRuleToken, { ...params }) -> V2RetrieveReportResponse @@ -127,6 +144,70 @@ Methods: - client.authRules.v2.backtests.create(authRuleToken, { ...params }) -> BacktestCreateResponse - client.authRules.v2.backtests.retrieve(authRuleBacktestToken, { ...params }) -> BacktestResults +# TransactionMonitoring + +## Cases + +Types: + +- CaseActivityEntry +- CaseActivityType +- CaseCard +- CaseEntity +- CasePriority +- CaseSortOrder +- CaseStatus +- CaseTransaction +- EntityType +- MonitoringCase +- CaseRetrieveCardsResponse + +Methods: + +- client.transactionMonitoring.cases.retrieve(caseToken) -> MonitoringCase +- client.transactionMonitoring.cases.update(caseToken, { ...params }) -> MonitoringCase +- client.transactionMonitoring.cases.list({ ...params }) -> MonitoringCasesCursorPage +- client.transactionMonitoring.cases.listActivity(caseToken, { ...params }) -> CaseActivityEntriesCursorPage +- client.transactionMonitoring.cases.listTransactions(caseToken, { ...params }) -> CaseTransactionsCursorPage +- client.transactionMonitoring.cases.retrieveCards(caseToken) -> CaseRetrieveCardsResponse + +### Comments + +Methods: + +- client.transactionMonitoring.cases.comments.create(caseToken, { ...params }) -> CaseActivityEntry +- client.transactionMonitoring.cases.comments.update(commentToken, { ...params }) -> CaseActivityEntry +- client.transactionMonitoring.cases.comments.delete(commentToken, { ...params }) -> void + +### Files + +Types: + +- CaseFile +- FileStatus +- UploadConstraints + +Methods: + +- client.transactionMonitoring.cases.files.create(caseToken, { ...params }) -> CaseFile +- client.transactionMonitoring.cases.files.retrieve(fileToken, { ...params }) -> CaseFile +- client.transactionMonitoring.cases.files.list(caseToken, { ...params }) -> CaseFilesCursorPage +- client.transactionMonitoring.cases.files.delete(fileToken, { ...params }) -> void + +## Queues + +Types: + +- Queue + +Methods: + +- client.transactionMonitoring.queues.create({ ...params }) -> Queue +- client.transactionMonitoring.queues.retrieve(queueToken) -> Queue +- client.transactionMonitoring.queues.update(queueToken, { ...params }) -> Queue +- client.transactionMonitoring.queues.list({ ...params }) -> QueuesCursorPage +- client.transactionMonitoring.queues.delete(queueToken) -> void + # AuthStreamEnrollment Types: @@ -198,6 +279,7 @@ Methods: - client.cards.provision(cardToken, { ...params }) -> CardProvisionResponse - client.cards.reissue(cardToken, { ...params }) -> Card - client.cards.renew(cardToken, { ...params }) -> Card +- client.cards.retrieveSignals(cardToken) -> SignalsResponse - client.cards.retrieveSpendLimits(cardToken) -> CardSpendLimits - client.cards.searchByPan({ ...params }) -> Card - client.cards.webProvision(cardToken, { ...params }) -> CardWebProvisionResponse @@ -217,6 +299,16 @@ Methods: - client.cards.financialTransactions.retrieve(financialTransactionToken, { ...params }) -> FinancialTransaction - client.cards.financialTransactions.list(cardToken, { ...params }) -> FinancialTransactionsSinglePage +# CardAuthorizations + +Types: + +- CardAuthorization + +Methods: + +- client.cardAuthorizations.challengeResponse(eventToken, { ...params }) -> void + # CardBulkOrders Types: @@ -446,6 +538,7 @@ Methods: - client.transactions.retrieve(transactionToken) -> Transaction - client.transactions.list({ ...params }) -> TransactionsCursorPage - client.transactions.expireAuthorization(transactionToken) -> void +- client.transactions.route(transactionToken, { ...params }) -> void - client.transactions.simulateAuthorization({ ...params }) -> TransactionSimulateAuthorizationResponse - client.transactions.simulateAuthorizationAdvice({ ...params }) -> TransactionSimulateAuthorizationAdviceResponse - client.transactions.simulateClearing({ ...params }) -> TransactionSimulateClearingResponse @@ -519,8 +612,10 @@ Methods: - client.externalBankAccounts.retrieve(externalBankAccountToken) -> ExternalBankAccountRetrieveResponse - client.externalBankAccounts.update(externalBankAccountToken, { ...params }) -> ExternalBankAccountUpdateResponse - client.externalBankAccounts.list({ ...params }) -> ExternalBankAccountListResponsesCursorPage +- client.externalBankAccounts.pause(externalBankAccountToken) -> ExternalBankAccount - client.externalBankAccounts.retryMicroDeposits(externalBankAccountToken, { ...params }) -> ExternalBankAccountRetryMicroDepositsResponse - client.externalBankAccounts.retryPrenote(externalBankAccountToken, { ...params }) -> ExternalBankAccount +- client.externalBankAccounts.setVerificationMethod(externalBankAccountToken, { ...params }) -> ExternalBankAccount - client.externalBankAccounts.unpause(externalBankAccountToken) -> ExternalBankAccount ## MicroDeposits @@ -746,6 +841,20 @@ Methods: - client.networkPrograms.retrieve(networkProgramToken) -> NetworkProgram - client.networkPrograms.list({ ...params }) -> NetworkProgramsSinglePage +# Holds + +Types: + +- Hold +- HoldEvent + +Methods: + +- client.holds.create(financialAccountToken, { ...params }) -> Hold +- client.holds.retrieve(holdToken) -> Hold +- client.holds.list(financialAccountToken, { ...params }) -> HoldsCursorPage +- client.holds.void(holdToken, { ...params }) -> Hold + # AccountActivity Types: @@ -778,7 +887,8 @@ Types: - AccountHolderVerificationWebhookEvent - AccountHolderDocumentUpdatedWebhookEvent - CardAuthorizationApprovalRequestWebhookEvent -- TokenizationDecisioningRequestWebhookEvent +- CardAuthorizationChallengeWebhookEvent +- CardAuthorizationChallengeResponseWebhookEvent - AuthRulesBacktestReportCreatedWebhookEvent - BalanceUpdatedWebhookEvent - BookTransferTransactionCreatedWebhookEvent @@ -792,6 +902,11 @@ Types: - CardTransactionUpdatedWebhookEvent - CardTransactionEnhancedDataCreatedWebhookEvent - CardTransactionEnhancedDataUpdatedWebhookEvent +- ClaimCreatedWebhookEvent +- ClaimUpdatedWebhookEvent +- ClaimDocumentUploadedWebhookEvent +- ClaimDocumentAcceptedWebhookEvent +- ClaimDocumentRejectedWebhookEvent - DigitalWalletTokenizationApprovalRequestWebhookEvent - DigitalWalletTokenizationResultWebhookEvent - DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent @@ -799,6 +914,8 @@ Types: - DigitalWalletTokenizationUpdatedWebhookEvent - DisputeUpdatedWebhookEvent - DisputeEvidenceUploadFailedWebhookEvent +- EmbedSessionGeneratedWebhookEvent +- EmbedViewedWebhookEvent - ExternalBankAccountCreatedWebhookEvent - ExternalBankAccountUpdatedWebhookEvent - ExternalPaymentCreatedWebhookEvent diff --git a/bin/check-release-environment b/bin/check-release-environment index e4b6d58e..6b43775a 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${NPM_TOKEN}" ]; then - errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/bin/migration-config.json b/bin/migration-config.json index 508a55ef..b9847fc8 100644 --- a/bin/migration-config.json +++ b/bin/migration-config.json @@ -102,6 +102,142 @@ } ] }, + { + "base": "transactionMonitoring.cases.comments", + "name": "update", + "params": [ + { + "type": "param", + "key": "comment_token", + "location": "path" + }, + { + "type": "params", + "maybeOverload": false + }, + { + "type": "options" + } + ], + "oldParams": [ + { + "type": "param", + "key": "case_token", + "location": "path" + }, + { + "type": "param", + "key": "comment_token", + "location": "path" + }, + { + "type": "params", + "maybeOverload": false + }, + { + "type": "options" + } + ] + }, + { + "base": "transactionMonitoring.cases.comments", + "name": "delete", + "params": [ + { + "type": "param", + "key": "comment_token", + "location": "path" + }, + { + "type": "params", + "maybeOverload": false + }, + { + "type": "options" + } + ], + "oldParams": [ + { + "type": "param", + "key": "case_token", + "location": "path" + }, + { + "type": "param", + "key": "comment_token", + "location": "path" + }, + { + "type": "options" + } + ] + }, + { + "base": "transactionMonitoring.cases.files", + "name": "retrieve", + "params": [ + { + "type": "param", + "key": "file_token", + "location": "path" + }, + { + "type": "params", + "maybeOverload": false + }, + { + "type": "options" + } + ], + "oldParams": [ + { + "type": "param", + "key": "case_token", + "location": "path" + }, + { + "type": "param", + "key": "file_token", + "location": "path" + }, + { + "type": "options" + } + ] + }, + { + "base": "transactionMonitoring.cases.files", + "name": "delete", + "params": [ + { + "type": "param", + "key": "file_token", + "location": "path" + }, + { + "type": "params", + "maybeOverload": false + }, + { + "type": "options" + } + ], + "oldParams": [ + { + "type": "param", + "key": "case_token", + "location": "path" + }, + { + "type": "param", + "key": "file_token", + "location": "path" + }, + { + "type": "options" + } + ] + }, { "base": "cards.financialTransactions", "name": "retrieve", diff --git a/bin/publish-npm b/bin/publish-npm index 45e8aa80..3d05c0bd 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,7 +2,12 @@ set -eux -npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +if [[ ${NPM_TOKEN:-} ]]; then + npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then + echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission" + exit 1 +fi yarn build cd dist @@ -57,5 +62,9 @@ else TAG="latest" fi +# Install OIDC compatible npm version +npm install --prefix ../oidc/ npm@11.6.2 + # Publish with the appropriate tag -yarn publish --tag "$TAG" +export npm_config_registry='https://registry.npmjs.org' +../oidc/node_modules/.bin/npm publish --tag "$TAG" diff --git a/eslint.config.mjs b/eslint.config.mjs index 0b625a58..271caeee 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,7 +1,6 @@ // @ts-check import tseslint from 'typescript-eslint'; import unusedImports from 'eslint-plugin-unused-imports'; -import prettier from 'eslint-plugin-prettier'; export default tseslint.config( { @@ -14,11 +13,9 @@ export default tseslint.config( plugins: { '@typescript-eslint': tseslint.plugin, 'unused-imports': unusedImports, - prettier, }, rules: { 'no-unused-vars': 'off', - 'prettier/prettier': 'error', 'unused-imports/no-unused-imports': 'error', 'no-restricted-imports': [ 'error', diff --git a/package.json b/package.json index 07f2a8e9..3b80a553 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lithic", - "version": "0.131.0", + "version": "0.145.0", "description": "The official TypeScript library for the Lithic API", "author": "Lithic ", "types": "dist/index.d.ts", @@ -30,7 +30,7 @@ "standardwebhooks": "^1.0.0" }, "devDependencies": { - "@arethetypeswrong/cli": "^0.17.0", + "@arethetypeswrong/cli": "^0.18.0", "@swc/core": "^1.3.102", "@swc/jest": "^0.2.29", "@types/jest": "^29.4.0", @@ -38,7 +38,6 @@ "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", "eslint": "^9.39.1", - "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-unused-imports": "^4.1.4", "iconv-lite": "^0.6.3", "jest": "^29.4.0", @@ -46,7 +45,7 @@ "publint": "^0.2.12", "ts-jest": "^29.1.0", "ts-node": "^10.5.0", - "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz", + "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz", "tsconfig-paths": "^4.0.0", "tslib": "^2.8.1", "typescript": "5.8.3", @@ -55,6 +54,17 @@ "bin": { "lithic": "bin/cli" }, + "overrides": { + "minimatch": "^9.0.5" + }, + "pnpm": { + "overrides": { + "minimatch": "^9.0.5" + } + }, + "resolutions": { + "minimatch": "^9.0.5" + }, "exports": { ".": { "import": "./dist/index.mjs", diff --git a/packages/mcp-server/Dockerfile b/packages/mcp-server/Dockerfile index 9529570b..f02d32a4 100644 --- a/packages/mcp-server/Dockerfile +++ b/packages/mcp-server/Dockerfile @@ -35,7 +35,9 @@ COPY . . # Install all dependencies and build everything RUN yarn install --frozen-lockfile && \ - yarn build + yarn build && \ + # Remove the symlink to the SDK so it doesn't interfere with the explicit COPY below + rm -Rf packages/mcp-server/node_modules/lithic FROM denoland/deno:alpine-2.7.1 diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index eea95564..ec896e8d 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -80,11 +80,10 @@ and repeatably. Launching the client with `--transport=http` launches the server as a remote server using Streamable HTTP transport. The `--port` setting can choose the port it will run on, and the `--socket` setting allows it to run on a Unix socket. -Authorization and base URL can be provided via the following headers: +Authorization can be provided via the following headers: | Header | Equivalent client option | Security scheme | | ------------------ | ------------------------ | --------------- | | `x-lithic-api-key` | `apiKey` | ApiKeyAuth | -| `x-base-url` | `baseUrl` | n/a | A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`: @@ -94,8 +93,7 @@ A configuration JSON for this server might look like this, assuming the server i "lithic_api": { "url": "http://localhost:3000", "headers": { - "x-lithic-api-key": "My Lithic API Key", - "x-base-url": "https://sandbox.lithic.com" + "x-lithic-api-key": "My Lithic API Key" } } } diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index 334377e5..7244cf48 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -1,7 +1,7 @@ { "dxt_version": "0.2", "name": "lithic-mcp", - "version": "0.131.0", + "version": "0.145.0", "description": "The official MCP Server for the Lithic API", "author": { "name": "Lithic", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 5d4a8b47..01bc6d53 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "lithic-mcp", - "version": "0.131.0", + "version": "0.145.0", "description": "The official MCP Server for the Lithic API", "author": "Lithic ", "types": "dist/index.d.ts", @@ -26,18 +26,22 @@ "format": "prettier --write --cache --cache-strategy metadata . !dist", "prepare": "npm run build", "tsn": "ts-node -r tsconfig-paths/register", - "lint": "eslint --ext ts,js .", - "fix": "eslint --fix --ext ts,js ." + "lint": "eslint .", + "fix": "eslint --fix ." }, "dependencies": { - "lithic": "file:../../dist/", + "lithic": "link:../../dist/", + "ajv": "^8.18.0", "@cloudflare/cabidela": "^0.2.4", - "@modelcontextprotocol/sdk": "^1.26.0", + "@hono/node-server": "^1.19.10", + "@modelcontextprotocol/sdk": "^1.27.1", + "hono": "^4.12.4", "@valtown/deno-http-worker": "^0.0.21", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "express": "^5.1.0", "fuse.js": "^7.1.0", + "minisearch": "^7.2.0", "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz", "pino": "^10.3.1", "pino-http": "^11.0.0", @@ -62,15 +66,15 @@ "@types/yargs": "^17.0.8", "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", - "eslint": "^8.49.0", - "eslint-plugin-prettier": "^5.0.1", - "eslint-plugin-unused-imports": "^3.0.0", + "eslint": "^9.39.1", + "eslint-plugin-prettier": "^5.4.1", + "eslint-plugin-unused-imports": "^4.1.4", "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", "ts-morph": "^19.0.0", "ts-node": "^10.5.0", - "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz", + "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz", "tsconfig-paths": "^4.0.0" }, "imports": { diff --git a/packages/mcp-server/src/auth.ts b/packages/mcp-server/src/auth.ts index a460108f..a0523482 100644 --- a/packages/mcp-server/src/auth.ts +++ b/packages/mcp-server/src/auth.ts @@ -12,12 +12,6 @@ export const parseClientAuthHeaders = (req: IncomingMessage, required?: boolean) return { apiKey }; }; -export const parseBaseUrlHeader = (req: IncomingMessage): Record => { - const baseUrl = - Array.isArray(req.headers['x-base-url']) ? req.headers['x-base-url'][0] : req.headers['x-base-url']; - return baseUrl ? { baseUrl } : {}; -}; - export const getStainlessApiKey = (req: IncomingMessage, mcpOptions: McpOptions): string | undefined => { // Try to get the key from the x-stainless-api-key header const headerKey = diff --git a/packages/mcp-server/src/code-tool-paths.cts b/packages/mcp-server/src/code-tool-paths.cts index 15ce7f55..78263e45 100644 --- a/packages/mcp-server/src/code-tool-paths.cts +++ b/packages/mcp-server/src/code-tool-paths.cts @@ -1,3 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export const workerPath = require.resolve('./code-tool-worker.mjs'); +export function getWorkerPath(): string { + return require.resolve('./code-tool-worker.mjs'); +} diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts index 695e54ac..837832ca 100644 --- a/packages/mcp-server/src/code-tool-worker.ts +++ b/packages/mcp-server/src/code-tool-worker.ts @@ -7,6 +7,10 @@ import ts from 'typescript'; import { WorkerOutput } from './code-tool-types'; import { Lithic, ClientOptions } from 'lithic'; +async function tseval(code: string) { + return import('data:application/typescript;charset=utf-8;base64,' + Buffer.from(code).toString('base64')); +} + function getRunFunctionSource(code: string): { type: 'declaration' | 'expression'; client: string | undefined; @@ -107,6 +111,7 @@ const fuse = new Fuse( 'client.apiStatus', 'client.accounts.list', 'client.accounts.retrieve', + 'client.accounts.retrieveSignals', 'client.accounts.retrieveSpendLimits', 'client.accounts.update', 'client.accountHolders.create', @@ -125,6 +130,7 @@ const fuse = new Fuse( 'client.authRules.v2.draft', 'client.authRules.v2.list', 'client.authRules.v2.listResults', + 'client.authRules.v2.listVersions', 'client.authRules.v2.promote', 'client.authRules.v2.retrieve', 'client.authRules.v2.retrieveFeatures', @@ -132,6 +138,24 @@ const fuse = new Fuse( 'client.authRules.v2.update', 'client.authRules.v2.backtests.create', 'client.authRules.v2.backtests.retrieve', + 'client.transactionMonitoring.cases.list', + 'client.transactionMonitoring.cases.listActivity', + 'client.transactionMonitoring.cases.listTransactions', + 'client.transactionMonitoring.cases.retrieve', + 'client.transactionMonitoring.cases.retrieveCards', + 'client.transactionMonitoring.cases.update', + 'client.transactionMonitoring.cases.comments.create', + 'client.transactionMonitoring.cases.comments.delete', + 'client.transactionMonitoring.cases.comments.update', + 'client.transactionMonitoring.cases.files.create', + 'client.transactionMonitoring.cases.files.delete', + 'client.transactionMonitoring.cases.files.list', + 'client.transactionMonitoring.cases.files.retrieve', + 'client.transactionMonitoring.queues.create', + 'client.transactionMonitoring.queues.delete', + 'client.transactionMonitoring.queues.list', + 'client.transactionMonitoring.queues.retrieve', + 'client.transactionMonitoring.queues.update', 'client.authStreamEnrollment.retrieveSecret', 'client.authStreamEnrollment.rotateSecret', 'client.tokenizationDecisioning.retrieveSecret', @@ -153,6 +177,7 @@ const fuse = new Fuse( 'client.cards.reissue', 'client.cards.renew', 'client.cards.retrieve', + 'client.cards.retrieveSignals', 'client.cards.retrieveSpendLimits', 'client.cards.searchByPan', 'client.cards.update', @@ -160,6 +185,7 @@ const fuse = new Fuse( 'client.cards.balances.list', 'client.cards.financialTransactions.list', 'client.cards.financialTransactions.retrieve', + 'client.cardAuthorizations.challengeResponse', 'client.cardBulkOrders.create', 'client.cardBulkOrders.list', 'client.cardBulkOrders.retrieve', @@ -217,6 +243,7 @@ const fuse = new Fuse( 'client.transactions.expireAuthorization', 'client.transactions.list', 'client.transactions.retrieve', + 'client.transactions.route', 'client.transactions.simulateAuthorization', 'client.transactions.simulateAuthorizationAdvice', 'client.transactions.simulateClearing', @@ -232,9 +259,11 @@ const fuse = new Fuse( 'client.responderEndpoints.delete', 'client.externalBankAccounts.create', 'client.externalBankAccounts.list', + 'client.externalBankAccounts.pause', 'client.externalBankAccounts.retrieve', 'client.externalBankAccounts.retryMicroDeposits', 'client.externalBankAccounts.retryPrenote', + 'client.externalBankAccounts.setVerificationMethod', 'client.externalBankAccounts.unpause', 'client.externalBankAccounts.update', 'client.externalBankAccounts.microDeposits.create', @@ -287,6 +316,10 @@ const fuse = new Fuse( 'client.fraud.transactions.retrieve', 'client.networkPrograms.list', 'client.networkPrograms.retrieve', + 'client.holds.create', + 'client.holds.list', + 'client.holds.retrieve', + 'client.holds.void', 'client.accountActivity.list', 'client.accountActivity.retrieveTransaction', 'client.transferLimits.list', @@ -367,7 +400,8 @@ function makeSdkProxy(obj: T, { path, isBelievedBad = false }: function parseError(code: string, error: unknown): string | undefined { if (!(error instanceof Error)) return; - const message = error.name ? `${error.name}: ${error.message}` : error.message; + const cause = error.cause instanceof Error ? `: ${error.cause.message}` : ''; + const message = error.name ? `${error.name}: ${error.message}${cause}` : `${error.message}${cause}`; try { // Deno uses V8; the first ":LINE:COLUMN" is the top of stack. const lineNumber = error.stack?.match(/:([0-9]+):[0-9]+/)?.[1]; @@ -423,7 +457,9 @@ const fetch = async (req: Request): Promise => { const log_lines: string[] = []; const err_lines: string[] = []; - const console = { + const originalConsole = globalThis.console; + globalThis.console = { + ...originalConsole, log: (...args: unknown[]) => { log_lines.push(util.format(...args)); }, @@ -433,7 +469,7 @@ const fetch = async (req: Request): Promise => { }; try { let run_ = async (client: any) => {}; - eval(`${code}\nrun_ = run;`); + run_ = (await tseval(`${code}\nexport default run;`)).default; const result = await run_(makeSdkProxy(client, { path: ['client'] })); return Response.json({ is_error: false, @@ -451,6 +487,8 @@ const fetch = async (req: Request): Promise => { } satisfies WorkerOutput, { status: 400, statusText: 'Code execution error' }, ); + } finally { + globalThis.console = originalConsole; } }; diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts index fe4376e8..cc08ae9e 100644 --- a/packages/mcp-server/src/code-tool.ts +++ b/packages/mcp-server/src/code-tool.ts @@ -1,10 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import fs from 'node:fs'; -import path from 'node:path'; -import url from 'node:url'; -import { newDenoHTTPWorker } from '@valtown/deno-http-worker'; -import { workerPath } from './code-tool-paths.cjs'; import { ContentBlock, McpRequestContext, @@ -149,23 +144,25 @@ const remoteStainlessHandler = async ({ const codeModeEndpoint = readEnv('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool'; + const localClientEnvs = { + LITHIC_API_KEY: requireValue( + readEnv('LITHIC_API_KEY') ?? client.apiKey, + 'set LITHIC_API_KEY environment variable or provide apiKey client option', + ), + LITHIC_WEBHOOK_SECRET: readEnv('LITHIC_WEBHOOK_SECRET') ?? client.webhookSecret ?? undefined, + LITHIC_BASE_URL: + readEnv('LITHIC_BASE_URL') ?? readEnv('LITHIC_ENVIRONMENT') ? undefined : client.baseURL ?? undefined, + }; + // Merge any upstream client envs from the request header, with upstream values taking precedence. + const mergedClientEnvs = { ...localClientEnvs, ...reqContext.upstreamClientEnvs }; + // Setting a Stainless API key authenticates requests to the code tool endpoint. const res = await fetch(codeModeEndpoint, { method: 'POST', headers: { ...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }), 'Content-Type': 'application/json', - 'x-stainless-mcp-client-envs': JSON.stringify({ - LITHIC_API_KEY: requireValue( - readEnv('LITHIC_API_KEY') ?? client.apiKey, - 'set LITHIC_API_KEY environment variable or provide apiKey client option', - ), - LITHIC_WEBHOOK_SECRET: readEnv('LITHIC_WEBHOOK_SECRET') ?? client.webhookSecret ?? undefined, - LITHIC_BASE_URL: - readEnv('LITHIC_BASE_URL') ?? readEnv('LITHIC_ENVIRONMENT') ? - undefined - : client.baseURL ?? undefined, - }), + 'x-stainless-mcp-client-envs': JSON.stringify(mergedClientEnvs), }, body: JSON.stringify({ project_name: 'lithic', @@ -208,6 +205,13 @@ const localDenoHandler = async ({ reqContext: McpRequestContext; args: unknown; }): Promise => { + const fs = await import('node:fs'); + const path = await import('node:path'); + const url = await import('node:url'); + const { newDenoHTTPWorker } = await import('@valtown/deno-http-worker'); + const { getWorkerPath } = await import('./code-tool-paths.cjs'); + const workerPath = getWorkerPath(); + const client = reqContext.client; const baseURLHostname = new URL(client.baseURL).hostname; const { code } = args as { code: string }; @@ -269,6 +273,9 @@ const localDenoHandler = async ({ printOutput: true, spawnOptions: { cwd: path.dirname(workerPath), + // Merge any upstream client envs into the Deno subprocess environment, + // with the upstream env vars taking precedence. + env: { ...process.env, ...reqContext.upstreamClientEnvs }, }, }); @@ -278,14 +285,16 @@ const localDenoHandler = async ({ reject(new Error(`Worker exited with code ${exitCode}`)); }); - const opts: ClientOptions = { - baseURL: client.baseURL, - apiKey: client.apiKey, - webhookSecret: client.webhookSecret, + // Strip null/undefined values so that the worker SDK client can fall back to + // reading from environment variables (including any upstreamClientEnvs). + const opts = { + ...(client.baseURL != null ? { baseURL: client.baseURL } : undefined), + ...(client.apiKey != null ? { apiKey: client.apiKey } : undefined), + ...(client.webhookSecret != null ? { webhookSecret: client.webhookSecret } : undefined), defaultHeaders: { 'X-Stainless-MCP': 'true', }, - }; + } satisfies Partial as ClientOptions; const req = worker.request( 'http://localhost', diff --git a/packages/mcp-server/src/docs-search-tool.ts b/packages/mcp-server/src/docs-search-tool.ts index 0fa5587f..e6387841 100644 --- a/packages/mcp-server/src/docs-search-tool.ts +++ b/packages/mcp-server/src/docs-search-tool.ts @@ -3,6 +3,7 @@ import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { Metadata, McpRequestContext, asTextContentResult } from './types'; import { getLogger } from './logger'; +import type { LocalDocsSearch } from './local-docs-search'; export const metadata: Metadata = { resource: 'all', @@ -13,7 +14,8 @@ export const metadata: Metadata = { export const tool: Tool = { name: 'search_docs', - description: 'Search for documentation for how to use the client to interact with the API.', + description: + 'Search SDK documentation to find methods, parameters, and usage examples for interacting with the API. Use this before writing code when you need to discover the right approach.', inputSchema: { type: 'object', properties: { @@ -42,13 +44,30 @@ export const tool: Tool = { const docsSearchURL = process.env['DOCS_SEARCH_URL'] || 'https://api.stainless.com/api/projects/lithic/docs/search'; -export const handler = async ({ - reqContext, - args, -}: { - reqContext: McpRequestContext; - args: Record | undefined; -}) => { +let _localSearch: LocalDocsSearch | undefined; + +export function setLocalSearch(search: LocalDocsSearch): void { + _localSearch = search; +} + +async function searchLocal(args: Record): Promise { + if (!_localSearch) { + throw new Error('Local search not initialized'); + } + + const query = (args['query'] as string) ?? ''; + const language = (args['language'] as string) ?? 'typescript'; + const detail = (args['detail'] as string) ?? 'default'; + + return _localSearch.search({ + query, + language, + detail, + maxResults: 10, + }).results; +} + +async function searchRemote(args: Record, reqContext: McpRequestContext): Promise { const body = args as any; const query = new URLSearchParams(body).toString(); @@ -56,6 +75,10 @@ export const handler = async ({ const result = await fetch(`${docsSearchURL}?${query}`, { headers: { ...(reqContext.stainlessApiKey && { Authorization: reqContext.stainlessApiKey }), + ...(reqContext.mcpSessionId && { 'x-stainless-mcp-session-id': reqContext.mcpSessionId }), + ...(reqContext.mcpClientInfo && { + 'x-stainless-mcp-client-info': JSON.stringify(reqContext.mcpClientInfo), + }), }, }); @@ -93,7 +116,23 @@ export const handler = async ({ }, 'Got docs search result', ); - return asTextContentResult(resultBody); + return resultBody; +} + +export const handler = async ({ + reqContext, + args, +}: { + reqContext: McpRequestContext; + args: Record | undefined; +}) => { + const body = args ?? {}; + + if (_localSearch) { + return asTextContentResult(await searchLocal(body)); + } + + return asTextContentResult(await searchRemote(body, reqContext)); }; export default { metadata, tool, handler }; diff --git a/packages/mcp-server/src/http.ts b/packages/mcp-server/src/http.ts index cbca4fd1..c07709d6 100644 --- a/packages/mcp-server/src/http.ts +++ b/packages/mcp-server/src/http.ts @@ -23,20 +23,74 @@ const newServer = async ({ res: express.Response; }): Promise => { const stainlessApiKey = getStainlessApiKey(req, mcpOptions); - const server = await newMcpServer(stainlessApiKey); + const customInstructionsPath = mcpOptions.customInstructionsPath; + const server = await newMcpServer({ stainlessApiKey, customInstructionsPath }); const authOptions = parseClientAuthHeaders(req, false); + let upstreamClientEnvs: Record | undefined; + const clientEnvsHeader = req.headers['x-stainless-mcp-client-envs']; + if (typeof clientEnvsHeader === 'string') { + try { + const parsed = JSON.parse(clientEnvsHeader); + if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) { + upstreamClientEnvs = parsed; + } + } catch { + // Ignore malformed header + } + } + + // Parse x-stainless-mcp-client-permissions header to override permission options + // + // Note: Permissions are best-effort and intended to prevent clients from doing unexpected things; + // they're not a hard security boundary, so we allow arbitrary, client-driven overrides. + // + // See the Stainless MCP documentation for more details. + let effectiveMcpOptions = mcpOptions; + const clientPermissionsHeader = req.headers['x-stainless-mcp-client-permissions']; + if (typeof clientPermissionsHeader === 'string') { + try { + const parsed = JSON.parse(clientPermissionsHeader); + if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) { + effectiveMcpOptions = { + ...mcpOptions, + ...(typeof parsed.allow_http_gets === 'boolean' && { codeAllowHttpGets: parsed.allow_http_gets }), + ...(Array.isArray(parsed.allowed_methods) && { codeAllowedMethods: parsed.allowed_methods }), + ...(Array.isArray(parsed.blocked_methods) && { codeBlockedMethods: parsed.blocked_methods }), + }; + getLogger().info( + { clientPermissions: parsed }, + 'Overriding code execution permissions from x-stainless-mcp-client-permissions header', + ); + } + } catch (error) { + getLogger().warn({ error }, 'Failed to parse x-stainless-mcp-client-permissions header'); + } + } + + const mcpClientInfo = + typeof req.body?.params?.clientInfo?.name === 'string' ? + { name: req.body.params.clientInfo.name, version: String(req.body.params.clientInfo.version ?? '') } + : undefined; + await initMcpServer({ server: server, - mcpOptions: mcpOptions, + mcpOptions: effectiveMcpOptions, clientOptions: { ...clientOptions, ...authOptions, }, stainlessApiKey: stainlessApiKey, + upstreamClientEnvs, + mcpSessionId: (req as any).mcpSessionId, + mcpClientInfo, }); + if (mcpClientInfo) { + getLogger().info({ mcpSessionId: (req as any).mcpSessionId, mcpClientInfo }, 'MCP client connected'); + } + return server; }; @@ -72,7 +126,7 @@ const del = async (req: express.Request, res: express.Response) => { }; const redactHeaders = (headers: Record) => { - const hiddenHeaders = /auth|cookie|key|token/i; + const hiddenHeaders = /auth|cookie|key|token|x-stainless-mcp-client-envs/i; const filtered = { ...headers }; Object.keys(filtered).forEach((key) => { if (hiddenHeaders.test(key)) { @@ -92,9 +146,23 @@ export const streamableHTTPApp = ({ const app = express(); app.set('query parser', 'extended'); app.use(express.json()); + app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { + const existing = req.headers['mcp-session-id']; + const sessionId = (Array.isArray(existing) ? existing[0] : existing) || crypto.randomUUID(); + (req as any).mcpSessionId = sessionId; + const origWriteHead = res.writeHead.bind(res); + res.writeHead = function (statusCode: number, ...rest: any[]) { + res.setHeader('mcp-session-id', sessionId); + return origWriteHead(statusCode, ...rest); + } as typeof res.writeHead; + next(); + }); app.use( pinoHttp({ logger: getLogger(), + customProps: (req) => ({ + mcpSessionId: (req as any).mcpSessionId, + }), customLogLevel: (req, res) => { if (res.statusCode >= 500) { return 'error'; diff --git a/packages/mcp-server/src/instructions.ts b/packages/mcp-server/src/instructions.ts index 2cfce0f5..d831ff4a 100644 --- a/packages/mcp-server/src/instructions.ts +++ b/packages/mcp-server/src/instructions.ts @@ -1,7 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { readEnv } from './util'; +import fs from 'fs/promises'; import { getLogger } from './logger'; +import { readEnv } from './util'; const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes @@ -12,33 +13,50 @@ interface InstructionsCacheEntry { const instructionsCache = new Map(); -// Periodically evict stale entries so the cache doesn't grow unboundedly. -const _cacheCleanupInterval = setInterval(() => { +export async function getInstructions({ + stainlessApiKey, + customInstructionsPath, +}: { + stainlessApiKey?: string | undefined; + customInstructionsPath?: string | undefined; +}): Promise { const now = Date.now(); + const cacheKey = customInstructionsPath ?? stainlessApiKey ?? ''; + const cached = instructionsCache.get(cacheKey); + + if (cached && now - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) { + return cached.fetchedInstructions; + } + + // Evict stale entries so the cache doesn't grow unboundedly. for (const [key, entry] of instructionsCache) { if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) { instructionsCache.delete(key); } } -}, INSTRUCTIONS_CACHE_TTL_MS); -// Don't keep the process alive just for cleanup. -_cacheCleanupInterval.unref(); + let fetchedInstructions: string; -export async function getInstructions(stainlessApiKey: string | undefined): Promise { - const cacheKey = stainlessApiKey ?? ''; - const cached = instructionsCache.get(cacheKey); - - if (cached && Date.now() - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) { - return cached.fetchedInstructions; + if (customInstructionsPath) { + fetchedInstructions = await fetchLatestInstructionsFromFile(customInstructionsPath); + } else { + fetchedInstructions = await fetchLatestInstructionsFromApi(stainlessApiKey); } - const fetchedInstructions = await fetchLatestInstructions(stainlessApiKey); - instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: Date.now() }); + instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now }); return fetchedInstructions; } -async function fetchLatestInstructions(stainlessApiKey: string | undefined): Promise { +async function fetchLatestInstructionsFromFile(path: string): Promise { + try { + return await fs.readFile(path, 'utf-8'); + } catch (error) { + getLogger().error({ error, path }, 'Error fetching instructions from file'); + throw error; + } +} + +async function fetchLatestInstructionsFromApi(stainlessApiKey: string | undefined): Promise { // Setting the stainless API key is optional, but may be required // to authenticate requests to the Stainless API. const response = await fetch( @@ -55,21 +73,11 @@ async function fetchLatestInstructions(stainlessApiKey: string | undefined): Pro 'Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...', ); - instructions = ` - This is the lithic MCP server. You will use Code Mode to help the user perform - actions. You can use search_docs tool to learn about how to take action with this server. Then, - you will write TypeScript code using the execute tool take action. It is CRITICAL that you be - thoughtful and deliberate when executing code. Always try to entirely solve the problem in code - block: it can be as long as you need to get the job done! - `; + instructions = + '\n This is the lithic MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n '; } instructions ??= ((await response.json()) as { instructions: string }).instructions; - instructions = ` - If needed, you can get the current time by executing Date.now(). - - ${instructions} - `; return instructions; } diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts new file mode 100644 index 00000000..b15a5878 --- /dev/null +++ b/packages/mcp-server/src/local-docs-search.ts @@ -0,0 +1,11737 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import MiniSearch from 'minisearch'; +import * as fs from 'node:fs/promises'; +import * as path from 'node:path'; +import { getLogger } from './logger'; + +type PerLanguageData = { + method?: string; + example?: string; +}; + +type MethodEntry = { + name: string; + endpoint: string; + httpMethod: string; + summary: string; + description: string; + stainlessPath: string; + qualified: string; + params?: string[]; + response?: string; + markdown?: string; + perLanguage?: Record; +}; + +type ProseChunk = { + content: string; + tag: string; + sectionContext?: string; + source?: string; +}; + +type MiniSearchDocument = { + id: string; + kind: 'http_method' | 'prose'; + name?: string; + endpoint?: string; + summary?: string; + description?: string; + qualified?: string; + stainlessPath?: string; + content?: string; + sectionContext?: string; + _original: Record; +}; + +type SearchResult = { + results: (string | Record)[]; +}; + +const EMBEDDED_METHODS: MethodEntry[] = [ + { + name: 'api_status', + endpoint: '/v1/status', + httpMethod: 'get', + summary: 'API status check', + description: 'Status of api', + stainlessPath: '(resource) $client > (method) api_status', + qualified: 'client.apiStatus', + response: '{ message?: string; }', + markdown: + "## api_status\n\n`client.apiStatus(): { message?: string; }`\n\n**get** `/v1/status`\n\nStatus of api\n\n### Returns\n\n- `{ message?: string; }`\n\n - `message?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst apiStatus = await client.apiStatus();\n\nconsole.log(apiStatus);\n```", + perLanguage: { + typescript: { + method: 'client.apiStatus', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst apiStatus = await client.apiStatus();\n\nconsole.log(apiStatus.message);", + }, + python: { + method: 'api_status', + example: + 'from lithic import Lithic\n\nclient = Lithic()\napi_status = client.api_status()\nprint(api_status.message)', + }, + java: { + method: 'apiStatus', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ApiStatus;\nimport com.lithic.api.models.ClientApiStatusParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ApiStatus apiStatus = client.apiStatus();\n }\n}', + }, + kotlin: { + method: 'apiStatus', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ApiStatus\nimport com.lithic.api.models.ClientApiStatusParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val apiStatus: ApiStatus = client.apiStatus()\n}', + }, + go: { + method: 'client.APIStatus', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tapiStatus, err := client.APIStatus(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiStatus.Message)\n}\n', + }, + ruby: { + method: 'api_status', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\napi_status = lithic.api_status\n\nputs(api_status)', + }, + http: { + example: 'curl https://api.lithic.com/v1/status \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/accounts', + httpMethod: 'get', + summary: 'List accounts', + description: 'List account configurations.\n', + stainlessPath: '(resource) accounts > (method) list', + qualified: 'client.accounts.list', + params: [ + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; created: string; spend_limit: { daily: number; lifetime: number; monthly: number; }; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; }", + markdown: + "## list\n\n`client.accounts.list(begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; created: string; spend_limit: object; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: object; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: object; }`\n\n**get** `/v1/accounts`\n\nList account configurations.\n\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; created: string; spend_limit: { daily: number; lifetime: number; monthly: number; }; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; }`\n\n - `token: string`\n - `created: string`\n - `spend_limit: { daily: number; lifetime: number; monthly: number; }`\n - `state: 'ACTIVE' | 'PAUSED' | 'CLOSED'`\n - `account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }`\n - `auth_rule_tokens?: string[]`\n - `cardholder_currency?: string`\n - `comment?: string`\n - `substatus?: string`\n - `verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const account of client.accounts.list()) {\n console.log(account);\n}\n```", + perLanguage: { + typescript: { + method: 'client.accounts.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const account of client.accounts.list()) {\n console.log(account.token);\n}", + }, + python: { + method: 'accounts.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.accounts.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'accounts().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountListPage;\nimport com.lithic.api.models.AccountListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountListPage page = client.accounts().list();\n }\n}', + }, + kotlin: { + method: 'accounts().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountListPage\nimport com.lithic.api.models.AccountListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: AccountListPage = client.accounts().list()\n}', + }, + go: { + method: 'client.Accounts.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Accounts.List(context.TODO(), lithic.AccountListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'accounts.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.accounts.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/accounts \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/accounts/{account_token}', + httpMethod: 'get', + summary: 'Get account', + description: 'Get account configuration such as spend limits.', + stainlessPath: '(resource) accounts > (method) retrieve', + qualified: 'client.accounts.retrieve', + params: ['account_token: string;'], + response: + "{ token: string; created: string; spend_limit: { daily: number; lifetime: number; monthly: number; }; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; }", + markdown: + "## retrieve\n\n`client.accounts.retrieve(account_token: string): { token: string; created: string; spend_limit: object; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: object; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: object; }`\n\n**get** `/v1/accounts/{account_token}`\n\nGet account configuration such as spend limits.\n\n### Parameters\n\n- `account_token: string`\n\n### Returns\n\n- `{ token: string; created: string; spend_limit: { daily: number; lifetime: number; monthly: number; }; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; }`\n\n - `token: string`\n - `created: string`\n - `spend_limit: { daily: number; lifetime: number; monthly: number; }`\n - `state: 'ACTIVE' | 'PAUSED' | 'CLOSED'`\n - `account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }`\n - `auth_rule_tokens?: string[]`\n - `cardholder_currency?: string`\n - `comment?: string`\n - `substatus?: string`\n - `verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst account = await client.accounts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(account);\n```", + perLanguage: { + typescript: { + method: 'client.accounts.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst account = await client.accounts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(account.token);", + }, + python: { + method: 'accounts.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount = client.accounts.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(account.token)', + }, + java: { + method: 'accounts().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Account;\nimport com.lithic.api.models.AccountRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Account account = client.accounts().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accounts().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Account\nimport com.lithic.api.models.AccountRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val account: Account = client.accounts().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Accounts.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccount, err := client.Accounts.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", account.Token)\n}\n', + }, + ruby: { + method: 'accounts.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount = lithic.accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/accounts/$ACCOUNT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/accounts/{account_token}', + httpMethod: 'patch', + summary: 'Update account', + description: + 'Update account configuration such as state or spend limits. Can only be run on accounts that are part of the program managed by this API key.\nAccounts that are in the `PAUSED` state will not be able to transact or create new cards.\n', + stainlessPath: '(resource) accounts > (method) update', + qualified: 'client.accounts.update', + params: [ + 'account_token: string;', + 'comment?: string;', + 'daily_spend_limit?: number;', + 'lifetime_spend_limit?: number;', + 'monthly_spend_limit?: number;', + "state?: 'ACTIVE' | 'PAUSED' | 'CLOSED';", + 'substatus?: string;', + 'verification_address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; };', + ], + response: + "{ token: string; created: string; spend_limit: { daily: number; lifetime: number; monthly: number; }; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; }", + markdown: + "## update\n\n`client.accounts.update(account_token: string, comment?: string, daily_spend_limit?: number, lifetime_spend_limit?: number, monthly_spend_limit?: number, state?: 'ACTIVE' | 'PAUSED' | 'CLOSED', substatus?: string, verification_address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }): { token: string; created: string; spend_limit: object; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: object; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: object; }`\n\n**patch** `/v1/accounts/{account_token}`\n\nUpdate account configuration such as state or spend limits. Can only be run on accounts that are part of the program managed by this API key.\nAccounts that are in the `PAUSED` state will not be able to transact or create new cards.\n\n\n### Parameters\n\n- `account_token: string`\n\n- `comment?: string`\n Additional context or information related to the account.\n\n- `daily_spend_limit?: number`\n Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a $1,000 limit).\nBy default the daily spend limit is set to $1,250.\n\n\n- `lifetime_spend_limit?: number`\n Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a $1,000 limit). Once this limit is reached, no transactions will be accepted on any card created for this account until the limit is updated.\nNote that a spend limit of 0 is effectively no limit, and should only be used to reset or remove a prior limit. Only a limit of 1 or above will result in declined transactions due to checks against the account limit. This behavior differs from the daily spend limit and the monthly spend limit.\n\n\n- `monthly_spend_limit?: number`\n Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a $1,000 limit).\nBy default the monthly spend limit is set to $5,000.\n\n\n- `state?: 'ACTIVE' | 'PAUSED' | 'CLOSED'`\n Account states.\n\n- `substatus?: string`\n Account state substatus values:\n* `FRAUD_IDENTIFIED` - The account has been recognized as being created or used with stolen or fabricated identity information, encompassing both true identity theft and synthetic identities.\n* `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as unauthorized access or fraudulent transactions, necessitating further investigation.\n* `RISK_VIOLATION` - The account has been involved in deliberate misuse by the legitimate account holder. Examples include disputing valid transactions without cause, falsely claiming non-receipt of goods, or engaging in intentional bust-out schemes to exploit account services.\n* `END_USER_REQUEST` - The account holder has voluntarily requested the closure of the account for personal reasons. This encompasses situations such as bankruptcy, other financial considerations, or the account holder's death.\n* `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to business strategy, risk management, inactivity, product changes, regulatory concerns, or violations of terms and conditions.\n* `NOT_ACTIVE` - The account has not had any transactions or payment activity within a specified period. This status applies to accounts that are paused or closed due to inactivity.\n* `INTERNAL_REVIEW` - The account is temporarily paused pending further internal review. In future implementations, this status may prevent clients from activating the account via APIs until the review is completed.\n* `OTHER` - The reason for the account's current status does not fall into any of the above categories. A comment should be provided to specify the particular reason.\n\n- `verification_address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }`\n Address used during Address Verification Service (AVS) checks during transactions if enabled via Auth Rules. This field is deprecated as AVS checks are no longer supported by Auth Rules. The field will be removed from the schema in a future release.\n - `address1?: string`\n - `address2?: string`\n - `city?: string`\n - `country?: string`\n - `postal_code?: string`\n - `state?: string`\n\n### Returns\n\n- `{ token: string; created: string; spend_limit: { daily: number; lifetime: number; monthly: number; }; state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }; auth_rule_tokens?: string[]; cardholder_currency?: string; comment?: string; substatus?: string; verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; }`\n\n - `token: string`\n - `created: string`\n - `spend_limit: { daily: number; lifetime: number; monthly: number; }`\n - `state: 'ACTIVE' | 'PAUSED' | 'CLOSED'`\n - `account_holder?: { token: string; business_account_token: string; email: string; phone_number: string; }`\n - `auth_rule_tokens?: string[]`\n - `cardholder_currency?: string`\n - `comment?: string`\n - `substatus?: string`\n - `verification_address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst account = await client.accounts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(account);\n```", + perLanguage: { + typescript: { + method: 'client.accounts.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst account = await client.accounts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n daily_spend_limit: 1000,\n});\n\nconsole.log(account.token);", + }, + python: { + method: 'accounts.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount = client.accounts.update(\n account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n daily_spend_limit=1000,\n)\nprint(account.token)', + }, + java: { + method: 'accounts().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Account;\nimport com.lithic.api.models.AccountUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Account account = client.accounts().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accounts().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Account\nimport com.lithic.api.models.AccountUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val account: Account = client.accounts().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Accounts.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccount, err := client.Accounts.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AccountUpdateParams{\n\t\t\tDailySpendLimit: lithic.F(int64(1000)),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", account.Token)\n}\n', + }, + ruby: { + method: 'accounts.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount = lithic.accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/accounts/$ACCOUNT_TOKEN \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "daily_spend_limit": 1000\n }\'', + }, + }, + }, + { + name: 'retrieve_spend_limits', + endpoint: '/v1/accounts/{account_token}/spend_limits', + httpMethod: 'get', + summary: "Get account's available spend limits", + description: + "Get an Account's available spend limits, which is based on the spend limit configured on the Account and the amount already spent over the spend limit's duration. For example, if the Account has a daily spend limit of $1000 configured, and has spent $600 in the last 24 hours, the available spend limit returned would be $400.", + stainlessPath: '(resource) accounts > (method) retrieve_spend_limits', + qualified: 'client.accounts.retrieveSpendLimits', + params: ['account_token: string;'], + response: + '{ available_spend_limit: { daily?: number; lifetime?: number; monthly?: number; }; spend_limit?: { daily?: number; lifetime?: number; monthly?: number; }; spend_velocity?: { daily?: number; lifetime?: number; monthly?: number; }; }', + markdown: + "## retrieve_spend_limits\n\n`client.accounts.retrieveSpendLimits(account_token: string): { available_spend_limit: object; spend_limit?: object; spend_velocity?: object; }`\n\n**get** `/v1/accounts/{account_token}/spend_limits`\n\nGet an Account's available spend limits, which is based on the spend limit configured on the Account and the amount already spent over the spend limit's duration. For example, if the Account has a daily spend limit of $1000 configured, and has spent $600 in the last 24 hours, the available spend limit returned would be $400.\n\n### Parameters\n\n- `account_token: string`\n\n### Returns\n\n- `{ available_spend_limit: { daily?: number; lifetime?: number; monthly?: number; }; spend_limit?: { daily?: number; lifetime?: number; monthly?: number; }; spend_velocity?: { daily?: number; lifetime?: number; monthly?: number; }; }`\n\n - `available_spend_limit: { daily?: number; lifetime?: number; monthly?: number; }`\n - `spend_limit?: { daily?: number; lifetime?: number; monthly?: number; }`\n - `spend_velocity?: { daily?: number; lifetime?: number; monthly?: number; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst accountSpendLimits = await client.accounts.retrieveSpendLimits('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(accountSpendLimits);\n```", + perLanguage: { + typescript: { + method: 'client.accounts.retrieveSpendLimits', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst accountSpendLimits = await client.accounts.retrieveSpendLimits(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(accountSpendLimits.available_spend_limit);", + }, + python: { + method: 'accounts.retrieve_spend_limits', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount_spend_limits = client.accounts.retrieve_spend_limits(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(account_spend_limits.available_spend_limit)', + }, + java: { + method: 'accounts().retrieveSpendLimits', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountRetrieveSpendLimitsParams;\nimport com.lithic.api.models.AccountSpendLimits;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountSpendLimits accountSpendLimits = client.accounts().retrieveSpendLimits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accounts().retrieveSpendLimits', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountRetrieveSpendLimitsParams\nimport com.lithic.api.models.AccountSpendLimits\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val accountSpendLimits: AccountSpendLimits = client.accounts().retrieveSpendLimits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Accounts.GetSpendLimits', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccountSpendLimits, err := client.Accounts.GetSpendLimits(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accountSpendLimits.AvailableSpendLimit)\n}\n', + }, + ruby: { + method: 'accounts.retrieve_spend_limits', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount_spend_limits = lithic.accounts.retrieve_spend_limits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(account_spend_limits)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/accounts/$ACCOUNT_TOKEN/spend_limits \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_signals', + endpoint: '/v1/accounts/{account_token}/signals', + httpMethod: 'get', + summary: 'Fetch account signals', + description: + "Returns behavioral feature state derived from an account's transaction history.\n\nThese signals expose the same data used by behavioral rule attributes (e.g. `AMOUNT_Z_SCORE`\nwith `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`) and custom code\n`TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect feature values before\nwriting rules and debug rule behavior.\n\nNote: 3DS fields are not available at the account scope and will be null.\n", + stainlessPath: '(resource) accounts > (method) retrieve_signals', + qualified: 'client.accounts.retrieveSignals', + params: ['account_token: string;'], + response: + '{ approved_txn_amount_m2: number; approved_txn_amount_m2_30d: number; approved_txn_amount_m2_7d: number; approved_txn_amount_m2_90d: number; approved_txn_count: number; approved_txn_count_30d: number; approved_txn_count_7d: number; approved_txn_count_90d: number; avg_transaction_amount: number; avg_transaction_amount_30d: number; avg_transaction_amount_7d: number; avg_transaction_amount_90d: number; distinct_country_count: number; distinct_mcc_count: number; first_txn_at: string; is_first_transaction: boolean; last_cp_country: string; last_cp_postal_code: string; last_cp_timestamp: string; last_txn_approved_at: string; seen_countries: string[]; seen_mccs: string[]; seen_merchants: string[]; stdev_transaction_amount: number; stdev_transaction_amount_30d: number; stdev_transaction_amount_7d: number; stdev_transaction_amount_90d: number; three_ds_success_count: number; three_ds_success_rate: number; three_ds_total_count: number; time_since_last_transaction_days: number; }', + markdown: + "## retrieve_signals\n\n`client.accounts.retrieveSignals(account_token: string): { approved_txn_amount_m2: number; approved_txn_amount_m2_30d: number; approved_txn_amount_m2_7d: number; approved_txn_amount_m2_90d: number; approved_txn_count: number; approved_txn_count_30d: number; approved_txn_count_7d: number; approved_txn_count_90d: number; avg_transaction_amount: number; avg_transaction_amount_30d: number; avg_transaction_amount_7d: number; avg_transaction_amount_90d: number; distinct_country_count: number; distinct_mcc_count: number; first_txn_at: string; is_first_transaction: boolean; last_cp_country: string; last_cp_postal_code: string; last_cp_timestamp: string; last_txn_approved_at: string; seen_countries: string[]; seen_mccs: string[]; seen_merchants: string[]; stdev_transaction_amount: number; stdev_transaction_amount_30d: number; stdev_transaction_amount_7d: number; stdev_transaction_amount_90d: number; three_ds_success_count: number; three_ds_success_rate: number; three_ds_total_count: number; time_since_last_transaction_days: number; }`\n\n**get** `/v1/accounts/{account_token}/signals`\n\nReturns behavioral feature state derived from an account's transaction history.\n\nThese signals expose the same data used by behavioral rule attributes (e.g. `AMOUNT_Z_SCORE`\nwith `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`) and custom code\n`TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect feature values before\nwriting rules and debug rule behavior.\n\nNote: 3DS fields are not available at the account scope and will be null.\n\n\n### Parameters\n\n- `account_token: string`\n\n### Returns\n\n- `{ approved_txn_amount_m2: number; approved_txn_amount_m2_30d: number; approved_txn_amount_m2_7d: number; approved_txn_amount_m2_90d: number; approved_txn_count: number; approved_txn_count_30d: number; approved_txn_count_7d: number; approved_txn_count_90d: number; avg_transaction_amount: number; avg_transaction_amount_30d: number; avg_transaction_amount_7d: number; avg_transaction_amount_90d: number; distinct_country_count: number; distinct_mcc_count: number; first_txn_at: string; is_first_transaction: boolean; last_cp_country: string; last_cp_postal_code: string; last_cp_timestamp: string; last_txn_approved_at: string; seen_countries: string[]; seen_mccs: string[]; seen_merchants: string[]; stdev_transaction_amount: number; stdev_transaction_amount_30d: number; stdev_transaction_amount_7d: number; stdev_transaction_amount_90d: number; three_ds_success_count: number; three_ds_success_rate: number; three_ds_total_count: number; time_since_last_transaction_days: number; }`\n Behavioral feature state for a card or account derived from its transaction history.\n\nDerived statistical features (averages, standard deviations, z-scores) are computed using Welford's online algorithm over approved transactions. Average fields are null when fewer than 5 approved transactions have been recorded. Standard deviation fields are null when fewer than 30 approved transactions have been recorded.\n\n3DS fields (`three_ds_success_rate`, `three_ds_success_count`, `three_ds_total_count`) are card-scoped and will be null for account responses.\n\nRaw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are included so clients can compute their own transaction-specific derivations, such as checking whether a new transaction's country is in `seen_countries` to determine `is_new_country`, or computing a z-score using the raw mean and M2 values.\n\n - `approved_txn_amount_m2: number`\n - `approved_txn_amount_m2_30d: number`\n - `approved_txn_amount_m2_7d: number`\n - `approved_txn_amount_m2_90d: number`\n - `approved_txn_count: number`\n - `approved_txn_count_30d: number`\n - `approved_txn_count_7d: number`\n - `approved_txn_count_90d: number`\n - `avg_transaction_amount: number`\n - `avg_transaction_amount_30d: number`\n - `avg_transaction_amount_7d: number`\n - `avg_transaction_amount_90d: number`\n - `distinct_country_count: number`\n - `distinct_mcc_count: number`\n - `first_txn_at: string`\n - `is_first_transaction: boolean`\n - `last_cp_country: string`\n - `last_cp_postal_code: string`\n - `last_cp_timestamp: string`\n - `last_txn_approved_at: string`\n - `seen_countries: string[]`\n - `seen_mccs: string[]`\n - `seen_merchants: string[]`\n - `stdev_transaction_amount: number`\n - `stdev_transaction_amount_30d: number`\n - `stdev_transaction_amount_7d: number`\n - `stdev_transaction_amount_90d: number`\n - `three_ds_success_count: number`\n - `three_ds_success_rate: number`\n - `three_ds_total_count: number`\n - `time_since_last_transaction_days: number`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst signalsResponse = await client.accounts.retrieveSignals('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(signalsResponse);\n```", + perLanguage: { + typescript: { + method: 'client.accounts.retrieveSignals', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst signalsResponse = await client.accounts.retrieveSignals(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(signalsResponse.approved_txn_amount_m2);", + }, + python: { + method: 'accounts.retrieve_signals', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nsignals_response = client.accounts.retrieve_signals(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(signals_response.approved_txn_amount_m2)', + }, + java: { + method: 'accounts().retrieveSignals', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountRetrieveSignalsParams;\nimport com.lithic.api.models.SignalsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n SignalsResponse signalsResponse = client.accounts().retrieveSignals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accounts().retrieveSignals', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountRetrieveSignalsParams\nimport com.lithic.api.models.SignalsResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val signalsResponse: SignalsResponse = client.accounts().retrieveSignals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Accounts.GetSignals', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tsignalsResponse, err := client.Accounts.GetSignals(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", signalsResponse.ApprovedTxnAmountM2)\n}\n', + }, + ruby: { + method: 'accounts.retrieve_signals', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nsignals_response = lithic.accounts.retrieve_signals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(signals_response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/accounts/$ACCOUNT_TOKEN/signals \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/account_holders', + httpMethod: 'post', + summary: 'Create an individual or business account holder', + description: + 'Create an account holder and initiate the appropriate onboarding workflow. Account holders and accounts have a 1:1 relationship. When an account holder is successfully created an associated account is also created.\nAll calls to this endpoint will return a synchronous response. The response time will depend on the workflow. In some cases, the response may indicate the workflow is under review or further action will be needed to complete the account creation process.\nThis endpoint can only be used on accounts that are part of the program that the calling API key manages.', + stainlessPath: '(resource) account_holders > (method) create', + qualified: 'client.accountHolders.create', + params: [ + "{ beneficial_owner_individuals: { address: object; dob: string; email: string; first_name: string; government_id: string; last_name: string; phone_number?: string; }[]; business_entity: { address: object; government_id: string; legal_business_name: string; phone_numbers: string[]; dba_business_name?: string; parent_company?: string; }; control_person: { address: object; dob: string; email: string; first_name: string; government_id: string; last_name: string; phone_number?: string; }; nature_of_business: string; tos_timestamp: string; workflow: 'KYB_BASIC' | 'KYB_BYO'; external_id?: string; kyb_passed_timestamp?: string; naics_code?: string; website_url?: string; } | { business_entity: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; legal_business_name: string; dba_business_name?: string; government_id?: string; parent_company?: string; phone_numbers?: string[]; }; beneficial_owner_individuals?: { first_name: string; last_name: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; government_id?: string; phone_number?: string; }[]; control_person?: { first_name: string; last_name: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; government_id?: string; phone_number?: string; }; external_id?: string; naics_code?: string; nature_of_business?: string; tos_timestamp?: string; website_url?: string; workflow?: 'KYB_DELEGATED'; } | { individual: { address: object; dob: string; email: string; first_name: string; government_id: string; last_name: string; phone_number: string; }; tos_timestamp: string; workflow: 'KYC_BASIC' | 'KYC_BYO'; external_id?: string; kyc_passed_timestamp?: string; } | { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; email: string; first_name: string; kyc_exemption_type: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; last_name: string; phone_number: string; workflow: 'KYC_EXEMPT'; business_account_token?: string; external_id?: string; };", + ], + response: + "{ token: string; account_token: string; status: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons: string[]; created?: string; external_id?: string; required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]; }", + perLanguage: { + typescript: { + method: 'client.accountHolders.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst accountHolder = await client.accountHolders.create({\n beneficial_owner_individuals: [\n {\n address: {\n address1: '300 Normal Forest Way',\n city: 'Portland',\n country: 'USA',\n postal_code: '90210',\n state: 'OR',\n },\n dob: '1991-03-08T08:00:00Z',\n email: 'tim@left-earth.com',\n first_name: 'Timmy',\n government_id: '211-23-1412',\n last_name: 'Turner',\n phone_number: '+15555555555',\n },\n ],\n business_entity: {\n address: {\n address1: '123 Old Forest Way',\n city: 'Omaha',\n country: 'USA',\n postal_code: '61022',\n state: 'NE',\n },\n dba_business_name: 'Example Business Solutions',\n government_id: '12-3456789',\n legal_business_name: 'Busy Business, Inc.',\n phone_numbers: ['+15555555555'],\n },\n control_person: {\n address: {\n address1: '451 New Forest Way',\n city: 'Springfield',\n country: 'USA',\n postal_code: '68022',\n state: 'IL',\n },\n dob: '1991-03-08T08:00:00Z',\n email: 'tom@middle-pluto.com',\n first_name: 'Tom',\n government_id: '111-23-1412',\n last_name: 'Timothy',\n phone_number: '+15555555555',\n },\n nature_of_business: 'Software company selling solutions to the restaurant industry',\n tos_timestamp: '2022-03-08T08:00:00Z',\n workflow: 'KYB_BYO',\n kyb_passed_timestamp: '2022-03-08T08:00:00Z',\n naics_code: '541512',\n website_url: 'https://www.mybusiness.com',\n});\n\nconsole.log(accountHolder.external_id);", + }, + python: { + method: 'account_holders.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount_holder = client.account_holders.create(\n beneficial_owner_individuals=[{\n "address": {\n "address1": "300 Normal Forest Way",\n "city": "Portland",\n "country": "USA",\n "postal_code": "90210",\n "state": "OR",\n },\n "dob": "1991-03-08T08:00:00Z",\n "email": "tim@left-earth.com",\n "first_name": "Timmy",\n "government_id": "211-23-1412",\n "last_name": "Turner",\n "phone_number": "+15555555555",\n }],\n business_entity={\n "address": {\n "address1": "123 Old Forest Way",\n "city": "Omaha",\n "country": "USA",\n "postal_code": "61022",\n "state": "NE",\n },\n "dba_business_name": "Example Business Solutions",\n "government_id": "12-3456789",\n "legal_business_name": "Busy Business, Inc.",\n "phone_numbers": ["+15555555555"],\n },\n control_person={\n "address": {\n "address1": "451 New Forest Way",\n "city": "Springfield",\n "country": "USA",\n "postal_code": "68022",\n "state": "IL",\n },\n "dob": "1991-03-08T08:00:00Z",\n "email": "tom@middle-pluto.com",\n "first_name": "Tom",\n "government_id": "111-23-1412",\n "last_name": "Timothy",\n "phone_number": "+15555555555",\n },\n nature_of_business="Software company selling solutions to the restaurant industry",\n tos_timestamp="2022-03-08T08:00:00Z",\n workflow="KYB_BYO",\n kyb_passed_timestamp="2022-03-08T08:00:00Z",\n naics_code="541512",\n website_url="https://www.mybusiness.com",\n)\nprint(account_holder.external_id)', + }, + java: { + method: 'accountHolders().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderCreateParams;\nimport com.lithic.api.models.AccountHolderCreateResponse;\nimport com.lithic.api.models.Address;\nimport com.lithic.api.models.Kyb;\nimport com.lithic.api.models.Kyc;\nimport com.lithic.api.models.KycExempt;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Kyb params = Kyb.builder()\n .addBeneficialOwnerIndividual(Kyb.KybIndividual.builder()\n .address(Address.builder()\n .address1("300 Normal Forest Way")\n .city("Portland")\n .country("USA")\n .postalCode("90210")\n .state("OR")\n .build())\n .dob("1991-03-08T08:00:00Z")\n .email("tim@left-earth.com")\n .firstName("Timmy")\n .governmentId("211-23-1412")\n .lastName("Turner")\n .build())\n .businessEntity(Kyb.BusinessEntity.builder()\n .address(Address.builder()\n .address1("123 Old Forest Way")\n .city("Omaha")\n .country("USA")\n .postalCode("61022")\n .state("NE")\n .build())\n .governmentId("12-3456789")\n .legalBusinessName("Busy Business, Inc.")\n .addPhoneNumber("+15555555555")\n .build())\n .controlPerson(Kyb.KybIndividual.builder()\n .address(Address.builder()\n .address1("451 New Forest Way")\n .city("Springfield")\n .country("USA")\n .postalCode("68022")\n .state("IL")\n .build())\n .dob("1991-03-08T08:00:00Z")\n .email("tom@middle-pluto.com")\n .firstName("Tom")\n .governmentId("111-23-1412")\n .lastName("Timothy")\n .build())\n .natureOfBusiness("Software company selling solutions to the restaurant industry")\n .tosTimestamp("2022-03-08T08:00:00Z")\n .workflow(Kyb.Workflow.KYB_BYO)\n .build();\n AccountHolderCreateResponse accountHolder = client.accountHolders().create(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderCreateResponse\nimport com.lithic.api.models.Address\nimport com.lithic.api.models.Kyb\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: Kyb = Kyb.builder()\n .addBeneficialOwnerIndividual(Kyb.KybIndividual.builder()\n .address(Address.builder()\n .address1("300 Normal Forest Way")\n .city("Portland")\n .country("USA")\n .postalCode("90210")\n .state("OR")\n .build())\n .dob("1991-03-08T08:00:00Z")\n .email("tim@left-earth.com")\n .firstName("Timmy")\n .governmentId("211-23-1412")\n .lastName("Turner")\n .build())\n .businessEntity(Kyb.BusinessEntity.builder()\n .address(Address.builder()\n .address1("123 Old Forest Way")\n .city("Omaha")\n .country("USA")\n .postalCode("61022")\n .state("NE")\n .build())\n .governmentId("12-3456789")\n .legalBusinessName("Busy Business, Inc.")\n .addPhoneNumber("+15555555555")\n .build())\n .controlPerson(Kyb.KybIndividual.builder()\n .address(Address.builder()\n .address1("451 New Forest Way")\n .city("Springfield")\n .country("USA")\n .postalCode("68022")\n .state("IL")\n .build())\n .dob("1991-03-08T08:00:00Z")\n .email("tom@middle-pluto.com")\n .firstName("Tom")\n .governmentId("111-23-1412")\n .lastName("Timothy")\n .build())\n .natureOfBusiness("Software company selling solutions to the restaurant industry")\n .tosTimestamp("2022-03-08T08:00:00Z")\n .workflow(Kyb.Workflow.KYB_BYO)\n .build()\n val accountHolder: AccountHolderCreateResponse = client.accountHolders().create(params)\n}', + }, + go: { + method: 'client.AccountHolders.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n\t"github.com/lithic-com/lithic-go/shared"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccountHolder, err := client.AccountHolders.New(context.TODO(), lithic.AccountHolderNewParams{\n\t\tBody: lithic.KYBParam{\n\t\t\tBeneficialOwnerIndividuals: lithic.F([]lithic.KYBBeneficialOwnerIndividualParam{{\n\t\t\t\tAddress: lithic.F(shared.AddressParam{\n\t\t\t\t\tAddress1: lithic.F("300 Normal Forest Way"),\n\t\t\t\t\tCity: lithic.F("Portland"),\n\t\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\t\tPostalCode: lithic.F("90210"),\n\t\t\t\t\tState: lithic.F("OR"),\n\t\t\t\t}),\n\t\t\t\tDob: lithic.F("1991-03-08T08:00:00Z"),\n\t\t\t\tEmail: lithic.F("tim@left-earth.com"),\n\t\t\t\tFirstName: lithic.F("Timmy"),\n\t\t\t\tGovernmentID: lithic.F("211-23-1412"),\n\t\t\t\tLastName: lithic.F("Turner"),\n\t\t\t}}),\n\t\t\tBusinessEntity: lithic.F(lithic.KYBBusinessEntityParam{\n\t\t\t\tAddress: lithic.F(shared.AddressParam{\n\t\t\t\t\tAddress1: lithic.F("123 Old Forest Way"),\n\t\t\t\t\tCity: lithic.F("Omaha"),\n\t\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\t\tPostalCode: lithic.F("61022"),\n\t\t\t\t\tState: lithic.F("NE"),\n\t\t\t\t}),\n\t\t\t\tGovernmentID: lithic.F("12-3456789"),\n\t\t\t\tLegalBusinessName: lithic.F("Busy Business, Inc."),\n\t\t\t\tPhoneNumbers: lithic.F([]string{"+15555555555"}),\n\t\t\t}),\n\t\t\tControlPerson: lithic.F(lithic.KYBControlPersonParam{\n\t\t\t\tAddress: lithic.F(shared.AddressParam{\n\t\t\t\t\tAddress1: lithic.F("451 New Forest Way"),\n\t\t\t\t\tCity: lithic.F("Springfield"),\n\t\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\t\tPostalCode: lithic.F("68022"),\n\t\t\t\t\tState: lithic.F("IL"),\n\t\t\t\t}),\n\t\t\t\tDob: lithic.F("1991-03-08T08:00:00Z"),\n\t\t\t\tEmail: lithic.F("tom@middle-pluto.com"),\n\t\t\t\tFirstName: lithic.F("Tom"),\n\t\t\t\tGovernmentID: lithic.F("111-23-1412"),\n\t\t\t\tLastName: lithic.F("Timothy"),\n\t\t\t}),\n\t\t\tNatureOfBusiness: lithic.F("Software company selling solutions to the restaurant industry"),\n\t\t\tTosTimestamp: lithic.F("2022-03-08T08:00:00Z"),\n\t\t\tWorkflow: lithic.F(lithic.KYBWorkflowKYBByo),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accountHolder.ExternalID)\n}\n', + }, + ruby: { + method: 'account_holders.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount_holder = lithic.account_holders.create(\n body: {\n beneficial_owner_individuals: [\n {\n address: {address1: "300 Normal Forest Way", city: "Portland", country: "USA", postal_code: "90210", state: "OR"},\n dob: "1991-03-08T08:00:00Z",\n email: "tim@left-earth.com",\n first_name: "Timmy",\n government_id: "211-23-1412",\n last_name: "Turner"\n }\n ],\n business_entity: {\n address: {address1: "123 Old Forest Way", city: "Omaha", country: "USA", postal_code: "61022", state: "NE"},\n government_id: "12-3456789",\n legal_business_name: "Busy Business, Inc.",\n phone_numbers: ["+15555555555"]\n },\n control_person: {\n address: {address1: "451 New Forest Way", city: "Springfield", country: "USA", postal_code: "68022", state: "IL"},\n dob: "1991-03-08T08:00:00Z",\n email: "tom@middle-pluto.com",\n first_name: "Tom",\n government_id: "111-23-1412",\n last_name: "Timothy"\n },\n nature_of_business: "Software company selling solutions to the restaurant industry",\n tos_timestamp: "2022-03-08T08:00:00Z",\n workflow: :KYB_BYO\n }\n)\n\nputs(account_holder)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n --max-time 300 \\\n -d \'{\n "beneficial_owner_individuals": [\n {\n "address": {\n "address1": "123 Old Forest Way",\n "city": "Omaha",\n "country": "USA",\n "postal_code": "68022",\n "state": "NE"\n },\n "dob": "1991-03-08 08:00:00",\n "email": "tom@middle-earth.com",\n "first_name": "Tom",\n "government_id": "111-23-1412",\n "last_name": "Bombadil"\n }\n ],\n "business_entity": {\n "address": {\n "address1": "123 Old Forest Way",\n "city": "Omaha",\n "country": "USA",\n "postal_code": "68022",\n "state": "NE"\n },\n "government_id": "114-123-1513",\n "legal_business_name": "Acme, Inc.",\n "phone_numbers": [\n "+15555555555"\n ]\n },\n "control_person": {\n "address": {\n "address1": "123 Old Forest Way",\n "city": "Omaha",\n "country": "USA",\n "postal_code": "68022",\n "state": "NE"\n },\n "dob": "1991-03-08 08:00:00",\n "email": "tom@middle-earth.com",\n "first_name": "Tom",\n "government_id": "111-23-1412",\n "last_name": "Bombadil"\n },\n "nature_of_business": "Software company selling solutions to the restaurant industry",\n "tos_timestamp": "2018-05-29T21:16:05Z",\n "workflow": "KYB_BASIC",\n "kyb_passed_timestamp": "2018-05-29T21:16:05Z",\n "naics_code": "541512",\n "website_url": "www.mybusiness.com"\n }\'', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/account_holders/{account_holder_token}', + httpMethod: 'patch', + summary: 'Update account holder information and possibly resubmit for evaluation', + description: + "Update the information associated with a particular account holder (including business owners and control persons associated to a business account).\nIf Lithic is performing KYB or KYC and additional verification is required we will run the individual's or business's updated information again and return whether the status is accepted or pending (i.e., further action required).\nAll calls to this endpoint will return a synchronous response. The response time will depend on the workflow. In some cases, the response may indicate the workflow is under review or further action will be needed to complete the account creation process.\nThis endpoint can only be used on existing accounts that are part of the program that the calling API key manages.", + stainlessPath: '(resource) account_holders > (method) update', + qualified: 'client.accountHolders.update', + params: [ + 'account_holder_token: string;', + 'body: { beneficial_owner_individuals?: { entity_token: string; address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }[]; business_entity?: { entity_token: string; address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }; dba_business_name?: string; government_id?: string; legal_business_name?: string; parent_company?: string; phone_numbers?: string[]; }; control_person?: { entity_token: string; address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }; external_id?: string; naics_code?: string; nature_of_business?: string; website_url?: string; } | { external_id?: string; individual?: { entity_token: string; address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }; } | { address?: { address1?: string; address2?: string; city?: string; country?: string; postal_code?: string; state?: string; }; business_account_token?: string; email?: string; first_name?: string; last_name?: string; legal_business_name?: string; phone_number?: string; };', + ], + response: + "{ token?: string; account_token?: string; beneficial_owner_individuals?: object[]; business_account_token?: string; business_entity?: kyb_business_entity; control_person?: object; created?: string; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: object; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: required_document[]; status?: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: object; website_url?: string; } | { token?: string; address?: object; business_account_token?: string; email?: string; first_name?: string; last_name?: string; legal_business_name?: string; phone_number?: string; }", + perLanguage: { + typescript: { + method: 'client.accountHolders.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst accountHolder = await client.accountHolders.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n business_entity: {\n entity_token: '83cf25ae-c14f-4d10-9fa2-0119f36c7286',\n address: { postal_code: '61023' },\n },\n control_person: {\n entity_token: 'fd771a07-c5c2-42f3-a53c-a6c79c6c0d07',\n address: { postal_code: '68023' },\n },\n naics_code: '541512',\n website_url: 'https://www.mynewbusiness.com',\n});\n\nconsole.log(accountHolder);", + }, + python: { + method: 'account_holders.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount_holder = client.account_holders.update(\n account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n business_entity={\n "entity_token": "83cf25ae-c14f-4d10-9fa2-0119f36c7286",\n "address": {\n "postal_code": "61023"\n },\n },\n control_person={\n "entity_token": "fd771a07-c5c2-42f3-a53c-a6c79c6c0d07",\n "address": {\n "postal_code": "68023"\n },\n },\n naics_code="541512",\n website_url="https://www.mynewbusiness.com",\n)\nprint(account_holder)', + }, + java: { + method: 'accountHolders().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderUpdateParams;\nimport com.lithic.api.models.AccountHolderUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderUpdateParams params = AccountHolderUpdateParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .body(AccountHolderUpdateParams.Body.KybPatchRequest.builder().build())\n .build();\n AccountHolderUpdateResponse accountHolder = client.accountHolders().update(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderUpdateParams\nimport com.lithic.api.models.AccountHolderUpdateResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AccountHolderUpdateParams = AccountHolderUpdateParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .body(AccountHolderUpdateParams.Body.KybPatchRequest.builder().build())\n .build()\n val accountHolder: AccountHolderUpdateResponse = client.accountHolders().update(params)\n}', + }, + go: { + method: 'client.AccountHolders.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccountHolder, err := client.AccountHolders.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AccountHolderUpdateParams{\n\t\t\tBody: lithic.AccountHolderUpdateParamsBodyKYBPatchRequest{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accountHolder)\n}\n', + }, + ruby: { + method: 'account_holders.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount_holder = lithic.account_holders.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body: {})\n\nputs(account_holder)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "naics_code": "541512",\n "nature_of_business": "Software company selling solutions to the restaurant industry",\n "website_url": "www.mybusiness.com"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/account_holders/{account_holder_token}', + httpMethod: 'get', + summary: 'Get an individual or business account holder', + description: 'Get an Individual or Business Account Holder and/or their KYC or KYB evaluation status.', + stainlessPath: '(resource) account_holders > (method) retrieve', + qualified: 'client.accountHolders.retrieve', + params: ['account_holder_token: string;'], + response: + "{ token: string; created: string; account_token?: string; beneficial_owner_individuals?: object[]; business_account_token?: string; business_entity?: object; control_person?: object; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: object; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: required_document[]; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: object; website_url?: string; }", + markdown: + "## retrieve\n\n`client.accountHolders.retrieve(account_holder_token: string): { token: string; created: string; account_token?: string; beneficial_owner_individuals?: object[]; business_account_token?: string; business_entity?: object; control_person?: object; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: object; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: required_document[]; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: object; website_url?: string; }`\n\n**get** `/v1/account_holders/{account_holder_token}`\n\nGet an Individual or Business Account Holder and/or their KYC or KYB evaluation status.\n\n### Parameters\n\n- `account_holder_token: string`\n\n### Returns\n\n- `{ token: string; created: string; account_token?: string; beneficial_owner_individuals?: { address: object; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }[]; business_account_token?: string; business_entity?: { address: object; dba_business_name: string; entity_token: string; government_id: string; legal_business_name: string; phone_numbers: string[]; parent_company?: string; }; control_person?: { address: object; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: { address: object; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: { created?: string; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; updated?: string; }; website_url?: string; }`\n\n - `token: string`\n - `created: string`\n - `account_token?: string`\n - `beneficial_owner_individuals?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }[]`\n - `business_account_token?: string`\n - `business_entity?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dba_business_name: string; entity_token: string; government_id: string; legal_business_name: string; phone_numbers: string[]; parent_company?: string; }`\n - `control_person?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }`\n - `email?: string`\n - `exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'`\n - `external_id?: string`\n - `individual?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }`\n - `naics_code?: string`\n - `nature_of_business?: string`\n - `phone_number?: string`\n - `required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]`\n - `status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'`\n - `status_reasons?: string[]`\n - `user_type?: 'BUSINESS' | 'INDIVIDUAL'`\n - `verification_application?: { created?: string; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; updated?: string; }`\n - `website_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst accountHolder = await client.accountHolders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(accountHolder);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst accountHolder = await client.accountHolders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(accountHolder.beneficial_owner_individuals);", + }, + python: { + method: 'account_holders.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount_holder = client.account_holders.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(account_holder.beneficial_owner_individuals)', + }, + java: { + method: 'accountHolders().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolder;\nimport com.lithic.api.models.AccountHolderRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolder accountHolder = client.accountHolders().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accountHolders().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolder\nimport com.lithic.api.models.AccountHolderRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val accountHolder: AccountHolder = client.accountHolders().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AccountHolders.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccountHolder, err := client.AccountHolders.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accountHolder.BeneficialOwnerIndividuals)\n}\n', + }, + ruby: { + method: 'account_holders.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount_holder = lithic.account_holders.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(account_holder)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'upload_document', + endpoint: '/v1/account_holders/{account_holder_token}/documents', + httpMethod: 'post', + summary: 'Initiate account holder document upload', + description: + 'Use this endpoint to identify which type of supported government-issued documentation you will upload for further verification.\nIt will return two URLs to upload your document images to - one for the front image and one for the back image.\n\nThis endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state.\n\nSupported file types include `jpg`, `png`, and `pdf`. Each file must be less than 15 MiB. Once both required uploads have been successfully completed, your document will be run through KYC verification.\n\nIf you have registered a webhook, you will receive evaluation updates for any document submission evaluations, as well as for any failed document uploads.\n\nTwo document submission attempts are permitted via this endpoint before a `REJECTED` status is returned and the account creation process is ended. Currently only one type of\naccount holder document is supported per KYC verification.\n', + stainlessPath: '(resource) account_holders > (method) upload_document', + qualified: 'client.accountHolders.uploadDocument', + params: ['account_holder_token: string;', 'document_type: string;', 'entity_token: string;'], + response: + "{ token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }", + markdown: + "## upload_document\n\n`client.accountHolders.uploadDocument(account_holder_token: string, document_type: string, entity_token: string): { token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: object[]; }`\n\n**post** `/v1/account_holders/{account_holder_token}/documents`\n\nUse this endpoint to identify which type of supported government-issued documentation you will upload for further verification.\nIt will return two URLs to upload your document images to - one for the front image and one for the back image.\n\nThis endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state.\n\nSupported file types include `jpg`, `png`, and `pdf`. Each file must be less than 15 MiB. Once both required uploads have been successfully completed, your document will be run through KYC verification.\n\nIf you have registered a webhook, you will receive evaluation updates for any document submission evaluations, as well as for any failed document uploads.\n\nTwo document submission attempts are permitted via this endpoint before a `REJECTED` status is returned and the account creation process is ended. Currently only one type of\naccount holder document is supported per KYC verification.\n\n\n### Parameters\n\n- `account_holder_token: string`\n\n- `document_type: string`\n The type of document to upload\n\n- `entity_token: string`\n Globally unique identifier for the entity.\n\n### Returns\n\n- `{ token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }`\n Describes the document and the required document image uploads\nrequired to re-run KYC\n\n - `token: string`\n - `account_holder_token: string`\n - `document_type: string`\n - `entity_token: string`\n - `required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst document = await client.accountHolders.uploadDocument('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { document_type: 'EIN_LETTER', entity_token: '83cf25ae-c14f-4d10-9fa2-0119f36c7286' });\n\nconsole.log(document);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.uploadDocument', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst document = await client.accountHolders.uploadDocument(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { document_type: 'EIN_LETTER', entity_token: '83cf25ae-c14f-4d10-9fa2-0119f36c7286' },\n);\n\nconsole.log(document.token);", + }, + python: { + method: 'account_holders.upload_document', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndocument = client.account_holders.upload_document(\n account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n document_type="EIN_LETTER",\n entity_token="83cf25ae-c14f-4d10-9fa2-0119f36c7286",\n)\nprint(document.token)', + }, + java: { + method: 'accountHolders().uploadDocument', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderUploadDocumentParams;\nimport com.lithic.api.models.Document;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderUploadDocumentParams params = AccountHolderUploadDocumentParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .documentType(AccountHolderUploadDocumentParams.DocumentType.EIN_LETTER)\n .entityToken("83cf25ae-c14f-4d10-9fa2-0119f36c7286")\n .build();\n Document document = client.accountHolders().uploadDocument(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().uploadDocument', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderUploadDocumentParams\nimport com.lithic.api.models.Document\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AccountHolderUploadDocumentParams = AccountHolderUploadDocumentParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .documentType(AccountHolderUploadDocumentParams.DocumentType.EIN_LETTER)\n .entityToken("83cf25ae-c14f-4d10-9fa2-0119f36c7286")\n .build()\n val document: Document = client.accountHolders().uploadDocument(params)\n}', + }, + go: { + method: 'client.AccountHolders.UploadDocument', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdocument, err := client.AccountHolders.UploadDocument(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AccountHolderUploadDocumentParams{\n\t\t\tDocumentType: lithic.F(lithic.AccountHolderUploadDocumentParamsDocumentTypeEinLetter),\n\t\t\tEntityToken: lithic.F("83cf25ae-c14f-4d10-9fa2-0119f36c7286"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", document.Token)\n}\n', + }, + ruby: { + method: 'account_holders.upload_document', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndocument = lithic.account_holders.upload_document(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n document_type: :EIN_LETTER,\n entity_token: "83cf25ae-c14f-4d10-9fa2-0119f36c7286"\n)\n\nputs(document)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN/documents \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "document_type": "EIN_LETTER",\n "entity_token": "83cf25ae-c14f-4d10-9fa2-0119f36c7286"\n }\'', + }, + }, + }, + { + name: 'list_documents', + endpoint: '/v1/account_holders/{account_holder_token}/documents', + httpMethod: 'get', + summary: 'Get account holder document uploads', + description: + 'Retrieve the status of account holder document uploads, or retrieve the upload URLs to process your image uploads.\n\nNote that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).\n\nIn the event your upload URLs have expired, calling this endpoint will refresh them.\nSimilarly, in the event a previous account holder document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.\n\nWhen a new document upload is generated for a failed attempt, the response will show an additional entry in the `required_document_uploads` list\nin a `PENDING` state for the corresponding `image_type`.\n', + stainlessPath: '(resource) account_holders > (method) list_documents', + qualified: 'client.accountHolders.listDocuments', + params: ['account_holder_token: string;'], + response: + '{ data?: { token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: object[]; }[]; }', + markdown: + "## list_documents\n\n`client.accountHolders.listDocuments(account_holder_token: string): { data?: document[]; }`\n\n**get** `/v1/account_holders/{account_holder_token}/documents`\n\nRetrieve the status of account holder document uploads, or retrieve the upload URLs to process your image uploads.\n\nNote that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).\n\nIn the event your upload URLs have expired, calling this endpoint will refresh them.\nSimilarly, in the event a previous account holder document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.\n\nWhen a new document upload is generated for a failed attempt, the response will show an additional entry in the `required_document_uploads` list\nin a `PENDING` state for the corresponding `image_type`.\n\n\n### Parameters\n\n- `account_holder_token: string`\n\n### Returns\n\n- `{ data?: { token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: object[]; }[]; }`\n\n - `data?: { token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.accountHolders.listDocuments('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.listDocuments', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.accountHolders.listDocuments('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);", + }, + python: { + method: 'account_holders.list_documents', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.account_holders.list_documents(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)', + }, + java: { + method: 'accountHolders().listDocuments', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderListDocumentsParams;\nimport com.lithic.api.models.AccountHolderListDocumentsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderListDocumentsResponse response = client.accountHolders().listDocuments("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accountHolders().listDocuments', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderListDocumentsParams\nimport com.lithic.api.models.AccountHolderListDocumentsResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: AccountHolderListDocumentsResponse = client.accountHolders().listDocuments("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AccountHolders.ListDocuments', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.AccountHolders.ListDocuments(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', + }, + ruby: { + method: 'account_holders.list_documents', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.account_holders.list_documents("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN/documents \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_document', + endpoint: '/v1/account_holders/{account_holder_token}/documents/{document_token}', + httpMethod: 'get', + summary: 'Get account holder document upload status', + description: + 'Check the status of an account holder document upload, or retrieve the upload URLs to process your image uploads.\n\nNote that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).\n\nIn the event your upload URLs have expired, calling this endpoint will refresh them.\nSimilarly, in the event a document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.\n\nWhen a new account holder document upload is generated for a failed attempt, the response will show an additional entry in the `required_document_uploads` array\nin a `PENDING` state for the corresponding `image_type`.\n', + stainlessPath: '(resource) account_holders > (method) retrieve_document', + qualified: 'client.accountHolders.retrieveDocument', + params: ['account_holder_token: string;', 'document_token: string;'], + response: + "{ token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }", + markdown: + "## retrieve_document\n\n`client.accountHolders.retrieveDocument(account_holder_token: string, document_token: string): { token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: object[]; }`\n\n**get** `/v1/account_holders/{account_holder_token}/documents/{document_token}`\n\nCheck the status of an account holder document upload, or retrieve the upload URLs to process your image uploads.\n\nNote that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).\n\nIn the event your upload URLs have expired, calling this endpoint will refresh them.\nSimilarly, in the event a document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.\n\nWhen a new account holder document upload is generated for a failed attempt, the response will show an additional entry in the `required_document_uploads` array\nin a `PENDING` state for the corresponding `image_type`.\n\n\n### Parameters\n\n- `account_holder_token: string`\n\n- `document_token: string`\n\n### Returns\n\n- `{ token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }`\n Describes the document and the required document image uploads\nrequired to re-run KYC\n\n - `token: string`\n - `account_holder_token: string`\n - `document_type: string`\n - `entity_token: string`\n - `required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst document = await client.accountHolders.retrieveDocument('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_holder_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(document);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.retrieveDocument', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst document = await client.accountHolders.retrieveDocument(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { account_holder_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(document.token);", + }, + python: { + method: 'account_holders.retrieve_document', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndocument = client.account_holders.retrieve_document(\n document_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(document.token)', + }, + java: { + method: 'accountHolders().retrieveDocument', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderRetrieveDocumentParams;\nimport com.lithic.api.models.Document;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderRetrieveDocumentParams params = AccountHolderRetrieveDocumentParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .documentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n Document document = client.accountHolders().retrieveDocument(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().retrieveDocument', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderRetrieveDocumentParams\nimport com.lithic.api.models.Document\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AccountHolderRetrieveDocumentParams = AccountHolderRetrieveDocumentParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .documentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val document: Document = client.accountHolders().retrieveDocument(params)\n}', + }, + go: { + method: 'client.AccountHolders.GetDocument', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdocument, err := client.AccountHolders.GetDocument(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", document.Token)\n}\n', + }, + ruby: { + method: 'account_holders.retrieve_document', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndocument = lithic.account_holders.retrieve_document(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n account_holder_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(document)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN/documents/$DOCUMENT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/account_holders', + httpMethod: 'get', + summary: 'Get a list of individual or business account holders', + description: + 'Get a list of individual or business account holders and their KYC or KYB evaluation status.', + stainlessPath: '(resource) account_holders > (method) list', + qualified: 'client.accountHolders.list', + params: [ + 'begin?: string;', + 'email?: string;', + 'end?: string;', + 'ending_before?: string;', + 'external_id?: string;', + 'first_name?: string;', + 'last_name?: string;', + 'legal_business_name?: string;', + 'limit?: number;', + 'phone_number?: string;', + 'starting_after?: string;', + ], + response: + "{ token: string; created: string; account_token?: string; beneficial_owner_individuals?: object[]; business_account_token?: string; business_entity?: object; control_person?: object; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: object; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: required_document[]; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: object; website_url?: string; }", + markdown: + "## list\n\n`client.accountHolders.list(begin?: string, email?: string, end?: string, ending_before?: string, external_id?: string, first_name?: string, last_name?: string, legal_business_name?: string, limit?: number, phone_number?: string, starting_after?: string): { token: string; created: string; account_token?: string; beneficial_owner_individuals?: object[]; business_account_token?: string; business_entity?: object; control_person?: object; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: object; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: required_document[]; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: object; website_url?: string; }`\n\n**get** `/v1/account_holders`\n\nGet a list of individual or business account holders and their KYC or KYB evaluation status.\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `email?: string`\n Email address of the account holder. The query must be an exact match, case insensitive.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `external_id?: string`\n If applicable, represents the external_id associated with the account_holder.\n\n- `first_name?: string`\n (Individual Account Holders only) The first name of the account holder. The query is case insensitive and supports partial matches.\n\n- `last_name?: string`\n (Individual Account Holders only) The last name of the account holder. The query is case insensitive and supports partial matches.\n\n- `legal_business_name?: string`\n (Business Account Holders only) The legal business name of the account holder. The query is case insensitive and supports partial matches.\n\n- `limit?: number`\n The number of account_holders to limit the response to.\n\n- `phone_number?: string`\n Phone number of the account holder. The query must be an exact match.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; created: string; account_token?: string; beneficial_owner_individuals?: { address: object; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }[]; business_account_token?: string; business_entity?: { address: object; dba_business_name: string; entity_token: string; government_id: string; legal_business_name: string; phone_numbers: string[]; parent_company?: string; }; control_person?: { address: object; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: { address: object; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: { created?: string; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; updated?: string; }; website_url?: string; }`\n\n - `token: string`\n - `created: string`\n - `account_token?: string`\n - `beneficial_owner_individuals?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }[]`\n - `business_account_token?: string`\n - `business_entity?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dba_business_name: string; entity_token: string; government_id: string; legal_business_name: string; phone_numbers: string[]; parent_company?: string; }`\n - `control_person?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }`\n - `email?: string`\n - `exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'`\n - `external_id?: string`\n - `individual?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; entity_token: string; first_name: string; last_name: string; phone_number: string; }`\n - `naics_code?: string`\n - `nature_of_business?: string`\n - `phone_number?: string`\n - `required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]`\n - `status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'`\n - `status_reasons?: string[]`\n - `user_type?: 'BUSINESS' | 'INDIVIDUAL'`\n - `verification_application?: { created?: string; status?: 'ACCEPTED' | 'PENDING_REVIEW' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; updated?: string; }`\n - `website_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const accountHolder of client.accountHolders.list()) {\n console.log(accountHolder);\n}\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const accountHolder of client.accountHolders.list()) {\n console.log(accountHolder.beneficial_owner_individuals);\n}", + }, + python: { + method: 'account_holders.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.account_holders.list()\npage = page.data[0]\nprint(page.beneficial_owner_individuals)', + }, + java: { + method: 'accountHolders().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderListPage;\nimport com.lithic.api.models.AccountHolderListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderListPage page = client.accountHolders().list();\n }\n}', + }, + kotlin: { + method: 'accountHolders().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderListPage\nimport com.lithic.api.models.AccountHolderListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: AccountHolderListPage = client.accountHolders().list()\n}', + }, + go: { + method: 'client.AccountHolders.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.AccountHolders.List(context.TODO(), lithic.AccountHolderListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'account_holders.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.account_holders.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/account_holders \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'simulate_enrollment_review', + endpoint: '/v1/simulate/account_holders/enrollment_review', + httpMethod: 'post', + summary: "Simulate an account holder's enrollment review", + description: + ' Simulates an enrollment review for an account holder. This endpoint is only applicable for workflows that may required intervention such as `KYB_BASIC`. ', + stainlessPath: '(resource) account_holders > (method) simulate_enrollment_review', + qualified: 'client.accountHolders.simulateEnrollmentReview', + params: [ + 'account_holder_token?: string;', + "status?: 'ACCEPTED' | 'REJECTED' | 'PENDING_REVIEW';", + 'status_reasons?: string[];', + ], + response: + "{ token?: string; account_token?: string; beneficial_owner_individuals?: { address?: object; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }[]; business_account_token?: string; business_entity?: object; control_person?: { address?: object; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }; created?: string; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: { address?: object; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: object[]; status?: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: { created: string; status: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons: string[]; updated: string; ky_passed_at?: string; }; website_url?: string; }", + markdown: + "## simulate_enrollment_review\n\n`client.accountHolders.simulateEnrollmentReview(account_holder_token?: string, status?: 'ACCEPTED' | 'REJECTED' | 'PENDING_REVIEW', status_reasons?: string[]): { token?: string; account_token?: string; beneficial_owner_individuals?: object[]; business_account_token?: string; business_entity?: kyb_business_entity; control_person?: object; created?: string; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: object; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: required_document[]; status?: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: object; website_url?: string; }`\n\n**post** `/v1/simulate/account_holders/enrollment_review`\n\n Simulates an enrollment review for an account holder. This endpoint is only applicable for workflows that may required intervention such as `KYB_BASIC`. \n\n### Parameters\n\n- `account_holder_token?: string`\n The account holder which to perform the simulation upon.\n\n- `status?: 'ACCEPTED' | 'REJECTED' | 'PENDING_REVIEW'`\n An account holder's status for use within the simulation.\n\n- `status_reasons?: string[]`\n Status reason that will be associated with the simulated account holder status. Only required for a `REJECTED` status.\n\n### Returns\n\n- `{ token?: string; account_token?: string; beneficial_owner_individuals?: { address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }[]; business_account_token?: string; business_entity?: { address: object; government_id: string; legal_business_name: string; phone_numbers: string[]; dba_business_name?: string; parent_company?: string; }; control_person?: { address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }; created?: string; email?: string; exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; external_id?: string; individual?: { address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }; naics_code?: string; nature_of_business?: string; phone_number?: string; required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]; status?: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons?: string[]; user_type?: 'BUSINESS' | 'INDIVIDUAL'; verification_application?: { created: string; status: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons: string[]; updated: string; ky_passed_at?: string; }; website_url?: string; }`\n\n - `token?: string`\n - `account_token?: string`\n - `beneficial_owner_individuals?: { address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }[]`\n - `business_account_token?: string`\n - `business_entity?: { address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; government_id: string; legal_business_name: string; phone_numbers: string[]; dba_business_name?: string; parent_company?: string; }`\n - `control_person?: { address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }`\n - `created?: string`\n - `email?: string`\n - `exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'`\n - `external_id?: string`\n - `individual?: { address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob?: string; email?: string; first_name?: string; government_id?: string; last_name?: string; phone_number?: string; }`\n - `naics_code?: string`\n - `nature_of_business?: string`\n - `phone_number?: string`\n - `required_documents?: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]`\n - `status?: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'`\n - `status_reasons?: string[]`\n - `user_type?: 'BUSINESS' | 'INDIVIDUAL'`\n - `verification_application?: { created: string; status: 'ACCEPTED' | 'PENDING_DOCUMENT' | 'PENDING_RESUBMIT' | 'REJECTED'; status_reasons: string[]; updated: string; ky_passed_at?: string; }`\n - `website_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.accountHolders.simulateEnrollmentReview();\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.simulateEnrollmentReview', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.accountHolders.simulateEnrollmentReview({\n account_holder_token: '1415964d-4400-4d79-9fb3-eee0faaee4e4',\n status: 'ACCEPTED',\n status_reasons: [],\n});\n\nconsole.log(response.beneficial_owner_individuals);", + }, + python: { + method: 'account_holders.simulate_enrollment_review', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.account_holders.simulate_enrollment_review(\n account_holder_token="1415964d-4400-4d79-9fb3-eee0faaee4e4",\n status="ACCEPTED",\n status_reasons=[],\n)\nprint(response.beneficial_owner_individuals)', + }, + java: { + method: 'accountHolders().simulateEnrollmentReview', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderSimulateEnrollmentReviewParams;\nimport com.lithic.api.models.AccountHolderSimulateEnrollmentReviewResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderSimulateEnrollmentReviewResponse response = client.accountHolders().simulateEnrollmentReview();\n }\n}', + }, + kotlin: { + method: 'accountHolders().simulateEnrollmentReview', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderSimulateEnrollmentReviewParams\nimport com.lithic.api.models.AccountHolderSimulateEnrollmentReviewResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: AccountHolderSimulateEnrollmentReviewResponse = client.accountHolders().simulateEnrollmentReview()\n}', + }, + go: { + method: 'client.AccountHolders.SimulateEnrollmentReview', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.AccountHolders.SimulateEnrollmentReview(context.TODO(), lithic.AccountHolderSimulateEnrollmentReviewParams{\n\t\tAccountHolderToken: lithic.F("1415964d-4400-4d79-9fb3-eee0faaee4e4"),\n\t\tStatus: lithic.F(lithic.AccountHolderSimulateEnrollmentReviewParamsStatusAccepted),\n\t\tStatusReasons: lithic.F([]lithic.AccountHolderSimulateEnrollmentReviewParamsStatusReason{}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.BeneficialOwnerIndividuals)\n}\n', + }, + ruby: { + method: 'account_holders.simulate_enrollment_review', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.account_holders.simulate_enrollment_review\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/account_holders/enrollment_review \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "account_holder_token": "1415964d-4400-4d79-9fb3-eee0faaee4e4",\n "status": "ACCEPTED",\n "status_reasons": [\n "PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE"\n ]\n }\'', + }, + }, + }, + { + name: 'simulate_enrollment_document_review', + endpoint: '/v1/simulate/account_holders/enrollment_document_review', + httpMethod: 'post', + summary: "Simulate an account holder document upload's review", + description: 'Simulates a review for an account holder document upload.', + stainlessPath: '(resource) account_holders > (method) simulate_enrollment_document_review', + qualified: 'client.accountHolders.simulateEnrollmentDocumentReview', + params: [ + 'document_upload_token: string;', + "status: 'UPLOADED' | 'ACCEPTED' | 'REJECTED' | 'PARTIAL_APPROVAL';", + 'accepted_entity_status_reasons?: string[];', + 'status_reason?: string;', + ], + response: + "{ token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }", + markdown: + "## simulate_enrollment_document_review\n\n`client.accountHolders.simulateEnrollmentDocumentReview(document_upload_token: string, status: 'UPLOADED' | 'ACCEPTED' | 'REJECTED' | 'PARTIAL_APPROVAL', accepted_entity_status_reasons?: string[], status_reason?: string): { token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: object[]; }`\n\n**post** `/v1/simulate/account_holders/enrollment_document_review`\n\nSimulates a review for an account holder document upload.\n\n### Parameters\n\n- `document_upload_token: string`\n The account holder document upload which to perform the simulation upon.\n\n- `status: 'UPLOADED' | 'ACCEPTED' | 'REJECTED' | 'PARTIAL_APPROVAL'`\n An account holder document's upload status for use within the simulation.\n\n- `accepted_entity_status_reasons?: string[]`\n A list of status reasons associated with a KYB account holder in PENDING_REVIEW\n\n- `status_reason?: string`\n Status reason that will be associated with the simulated account holder status. Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status.\n\n### Returns\n\n- `{ token: string; account_holder_token: string; document_type: string; entity_token: string; required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]; }`\n Describes the document and the required document image uploads\nrequired to re-run KYC\n\n - `token: string`\n - `account_holder_token: string`\n - `document_type: string`\n - `entity_token: string`\n - `required_document_uploads: { token: string; accepted_entity_status_reasons: string[]; created: string; image_type: 'FRONT' | 'BACK'; rejected_entity_status_reasons: string[]; status: 'ACCEPTED' | 'REJECTED' | 'PENDING_UPLOAD' | 'UPLOADED' | 'PARTIAL_APPROVAL'; status_reasons: string[]; updated: string; upload_url: string; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst document = await client.accountHolders.simulateEnrollmentDocumentReview({ document_upload_token: 'b11cd67b-0a52-4180-8365-314f3def5426', status: 'UPLOADED' });\n\nconsole.log(document);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.simulateEnrollmentDocumentReview', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst document = await client.accountHolders.simulateEnrollmentDocumentReview({\n document_upload_token: 'b11cd67b-0a52-4180-8365-314f3def5426',\n status: 'UPLOADED',\n});\n\nconsole.log(document.token);", + }, + python: { + method: 'account_holders.simulate_enrollment_document_review', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndocument = client.account_holders.simulate_enrollment_document_review(\n document_upload_token="b11cd67b-0a52-4180-8365-314f3def5426",\n status="UPLOADED",\n)\nprint(document.token)', + }, + java: { + method: 'accountHolders().simulateEnrollmentDocumentReview', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderSimulateEnrollmentDocumentReviewParams;\nimport com.lithic.api.models.Document;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderSimulateEnrollmentDocumentReviewParams params = AccountHolderSimulateEnrollmentDocumentReviewParams.builder()\n .documentUploadToken("b11cd67b-0a52-4180-8365-314f3def5426")\n .status(AccountHolderSimulateEnrollmentDocumentReviewParams.Status.UPLOADED)\n .build();\n Document document = client.accountHolders().simulateEnrollmentDocumentReview(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().simulateEnrollmentDocumentReview', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderSimulateEnrollmentDocumentReviewParams\nimport com.lithic.api.models.Document\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AccountHolderSimulateEnrollmentDocumentReviewParams = AccountHolderSimulateEnrollmentDocumentReviewParams.builder()\n .documentUploadToken("b11cd67b-0a52-4180-8365-314f3def5426")\n .status(AccountHolderSimulateEnrollmentDocumentReviewParams.Status.UPLOADED)\n .build()\n val document: Document = client.accountHolders().simulateEnrollmentDocumentReview(params)\n}', + }, + go: { + method: 'client.AccountHolders.SimulateEnrollmentDocumentReview', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdocument, err := client.AccountHolders.SimulateEnrollmentDocumentReview(context.TODO(), lithic.AccountHolderSimulateEnrollmentDocumentReviewParams{\n\t\tDocumentUploadToken: lithic.F("b11cd67b-0a52-4180-8365-314f3def5426"),\n\t\tStatus: lithic.F(lithic.AccountHolderSimulateEnrollmentDocumentReviewParamsStatusUploaded),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", document.Token)\n}\n', + }, + ruby: { + method: 'account_holders.simulate_enrollment_document_review', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndocument = lithic.account_holders.simulate_enrollment_document_review(\n document_upload_token: "b11cd67b-0a52-4180-8365-314f3def5426",\n status: :UPLOADED\n)\n\nputs(document)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/account_holders/enrollment_document_review \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "document_upload_token": "b11cd67b-0a52-4180-8365-314f3def5426",\n "status": "UPLOADED"\n }\'', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/account_holders/{account_holder_token}/entities', + httpMethod: 'post', + summary: 'Create a new beneficial owner individual or replace the existing control person entity', + description: + 'Create a new beneficial owner individual or replace the control person entity on an existing KYB account holder. This endpoint is only applicable for account holders enrolled through a KYB workflow with the Persona KYB provider.\nA new control person can only replace the existing one. A maximum of 4 beneficial owners can be associated with an account holder.', + stainlessPath: '(resource) account_holders.entities > (method) create', + qualified: 'client.accountHolders.entities.create', + params: [ + 'account_holder_token: string;', + 'address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; };', + 'dob: string;', + 'email: string;', + 'first_name: string;', + 'government_id: string;', + 'last_name: string;', + 'phone_number: string;', + "type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON';", + ], + response: + "{ token: string; account_holder_token: string; created: string; required_documents: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]; status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'; status_reasons: string[]; }", + markdown: + "## create\n\n`client.accountHolders.entities.create(account_holder_token: string, address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }, dob: string, email: string, first_name: string, government_id: string, last_name: string, phone_number: string, type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'): { token: string; account_holder_token: string; created: string; required_documents: required_document[]; status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'; status_reasons: string[]; }`\n\n**post** `/v1/account_holders/{account_holder_token}/entities`\n\nCreate a new beneficial owner individual or replace the control person entity on an existing KYB account holder. This endpoint is only applicable for account holders enrolled through a KYB workflow with the Persona KYB provider.\nA new control person can only replace the existing one. A maximum of 4 beneficial owners can be associated with an account holder.\n\n### Parameters\n\n- `account_holder_token: string`\n\n- `address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n Individual's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; APO/FPO are acceptable. Only USA addresses are currently supported.\n - `address1: string`\n Valid deliverable address (no PO boxes).\n - `city: string`\n Name of city.\n - `country: string`\n Valid country code. Only USA is currently supported, entered in uppercase ISO 3166-1 alpha-3 three-character format.\n - `postal_code: string`\n Valid postal code. Only USA ZIP codes are currently supported, entered as a five-digit ZIP or nine-digit ZIP+4.\n - `state: string`\n Valid state code. Only USA state codes are currently supported, entered in uppercase ISO 3166-2 two-character format.\n - `address2?: string`\n Unit or apartment number (if applicable).\n\n- `dob: string`\n Individual's date of birth, as an RFC 3339 date.\n\n- `email: string`\n Individual's email address. If utilizing Lithic for chargeback processing, this customer email address may be used to communicate dispute status and resolution.\n\n- `first_name: string`\n Individual's first name, as it appears on government-issued identity documents.\n\n- `government_id: string`\n Government-issued identification number (required for identity verification and compliance with banking regulations). Social Security Numbers (SSN) and Individual Taxpayer Identification Numbers (ITIN) are currently supported, entered as full nine-digits, with or without hyphens\n\n- `last_name: string`\n Individual's last name, as it appears on government-issued identity documents.\n\n- `phone_number: string`\n Individual's phone number, entered in E.164 format.\n\n- `type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'`\n The type of entity to create on the account holder\n\n### Returns\n\n- `{ token: string; account_holder_token: string; created: string; required_documents: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]; status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'; status_reasons: string[]; }`\n Response body for creating a new beneficial owner or replacing the control person entity on an existing KYB account holder.\n\n - `token: string`\n - `account_holder_token: string`\n - `created: string`\n - `required_documents: { entity_token: string; status_reasons: string[]; valid_documents: string[]; }[]`\n - `status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'`\n - `status_reasons: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst entity = await client.accountHolders.entities.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n address: {\n address1: '300 Normal Forest Way',\n city: 'Portland',\n country: 'USA',\n postal_code: '90210',\n state: 'OR',\n},\n dob: '1991-03-08T08:00:00Z',\n email: 'tim@left-earth.com',\n first_name: 'Timmy',\n government_id: '211-23-1412',\n last_name: 'Turner',\n phone_number: '+15555555555',\n type: 'BENEFICIAL_OWNER_INDIVIDUAL',\n});\n\nconsole.log(entity);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.entities.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst entity = await client.accountHolders.entities.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n address: {\n address1: '300 Normal Forest Way',\n city: 'Portland',\n country: 'USA',\n postal_code: '90210',\n state: 'OR',\n },\n dob: '1991-03-08T08:00:00Z',\n email: 'tim@left-earth.com',\n first_name: 'Timmy',\n government_id: '211-23-1412',\n last_name: 'Turner',\n phone_number: '+15555555555',\n type: 'BENEFICIAL_OWNER_INDIVIDUAL',\n});\n\nconsole.log(entity.token);", + }, + python: { + method: 'account_holders.entities.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nentity = client.account_holders.entities.create(\n account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n address={\n "address1": "300 Normal Forest Way",\n "city": "Portland",\n "country": "USA",\n "postal_code": "90210",\n "state": "OR",\n },\n dob="1991-03-08T08:00:00Z",\n email="tim@left-earth.com",\n first_name="Timmy",\n government_id="211-23-1412",\n last_name="Turner",\n phone_number="+15555555555",\n type="BENEFICIAL_OWNER_INDIVIDUAL",\n)\nprint(entity.token)', + }, + java: { + method: 'accountHolders().entities().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderEntityCreateParams;\nimport com.lithic.api.models.EntityCreateResponse;\nimport com.lithic.api.models.EntityType;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderEntityCreateParams params = AccountHolderEntityCreateParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .address(AccountHolderEntityCreateParams.Address.builder()\n .address1("300 Normal Forest Way")\n .city("Portland")\n .country("USA")\n .postalCode("90210")\n .state("OR")\n .build())\n .dob("1991-03-08T08:00:00Z")\n .email("tim@left-earth.com")\n .firstName("Timmy")\n .governmentId("211-23-1412")\n .lastName("Turner")\n .phoneNumber("+15555555555")\n .type(EntityType.BENEFICIAL_OWNER_INDIVIDUAL)\n .build();\n EntityCreateResponse entity = client.accountHolders().entities().create(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().entities().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderEntityCreateParams\nimport com.lithic.api.models.EntityCreateResponse\nimport com.lithic.api.models.EntityType\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AccountHolderEntityCreateParams = AccountHolderEntityCreateParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .address(AccountHolderEntityCreateParams.Address.builder()\n .address1("300 Normal Forest Way")\n .city("Portland")\n .country("USA")\n .postalCode("90210")\n .state("OR")\n .build())\n .dob("1991-03-08T08:00:00Z")\n .email("tim@left-earth.com")\n .firstName("Timmy")\n .governmentId("211-23-1412")\n .lastName("Turner")\n .phoneNumber("+15555555555")\n .type(EntityType.BENEFICIAL_OWNER_INDIVIDUAL)\n .build()\n val entity: EntityCreateResponse = client.accountHolders().entities().create(params)\n}', + }, + go: { + method: 'client.AccountHolders.Entities.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tentity, err := client.AccountHolders.Entities.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AccountHolderEntityNewParams{\n\t\t\tAddress: lithic.F(lithic.AccountHolderEntityNewParamsAddress{\n\t\t\t\tAddress1: lithic.F("300 Normal Forest Way"),\n\t\t\t\tCity: lithic.F("Portland"),\n\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\tPostalCode: lithic.F("90210"),\n\t\t\t\tState: lithic.F("OR"),\n\t\t\t}),\n\t\t\tDob: lithic.F("1991-03-08T08:00:00Z"),\n\t\t\tEmail: lithic.F("tim@left-earth.com"),\n\t\t\tFirstName: lithic.F("Timmy"),\n\t\t\tGovernmentID: lithic.F("211-23-1412"),\n\t\t\tLastName: lithic.F("Turner"),\n\t\t\tPhoneNumber: lithic.F("+15555555555"),\n\t\t\tType: lithic.F(lithic.EntityTypeBeneficialOwnerIndividual),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", entity.Token)\n}\n', + }, + ruby: { + method: 'account_holders.entities.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nentity = lithic.account_holders.entities.create(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n address: {address1: "300 Normal Forest Way", city: "Portland", country: "USA", postal_code: "90210", state: "OR"},\n dob: "1991-03-08T08:00:00Z",\n email: "tim@left-earth.com",\n first_name: "Timmy",\n government_id: "211-23-1412",\n last_name: "Turner",\n phone_number: "+15555555555",\n type: :BENEFICIAL_OWNER_INDIVIDUAL\n)\n\nputs(entity)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN/entities \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "address": {\n "address1": "300 Normal Forest Way",\n "city": "Portland",\n "country": "USA",\n "postal_code": "90210",\n "state": "OR"\n },\n "dob": "1991-03-08T08:00:00Z",\n "email": "tim@left-earth.com",\n "first_name": "Timmy",\n "government_id": "211-23-1412",\n "last_name": "Turner",\n "phone_number": "+15555555555",\n "type": "BENEFICIAL_OWNER_INDIVIDUAL"\n }\'', + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/account_holders/{account_holder_token}/entities/{entity_token}', + httpMethod: 'delete', + summary: 'Deactivate a beneficial owner individual', + description: + 'Deactivate a beneficial owner individual on an existing KYB account holder. Only beneficial owner individuals can be deactivated.', + stainlessPath: '(resource) account_holders.entities > (method) delete', + qualified: 'client.accountHolders.entities.delete', + params: ['account_holder_token: string;', 'entity_token: string;'], + response: + "{ token: string; account_holder_token: string; address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; first_name: string; last_name: string; phone_number: string; status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'; type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'; }", + markdown: + "## delete\n\n`client.accountHolders.entities.delete(account_holder_token: string, entity_token: string): { token: string; account_holder_token: string; address: object; dob: string; email: string; first_name: string; last_name: string; phone_number: string; status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'; type: entity_type; }`\n\n**delete** `/v1/account_holders/{account_holder_token}/entities/{entity_token}`\n\nDeactivate a beneficial owner individual on an existing KYB account holder. Only beneficial owner individuals can be deactivated.\n\n### Parameters\n\n- `account_holder_token: string`\n\n- `entity_token: string`\n\n### Returns\n\n- `{ token: string; account_holder_token: string; address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; dob: string; email: string; first_name: string; last_name: string; phone_number: string; status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'; type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'; }`\n Information about an entity associated with an account holder\n\n - `token: string`\n - `account_holder_token: string`\n - `address: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `dob: string`\n - `email: string`\n - `first_name: string`\n - `last_name: string`\n - `phone_number: string`\n - `status: 'ACCEPTED' | 'INACTIVE' | 'PENDING_REVIEW' | 'REJECTED'`\n - `type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst accountHolderEntity = await client.accountHolders.entities.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_holder_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(accountHolderEntity);\n```", + perLanguage: { + typescript: { + method: 'client.accountHolders.entities.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst accountHolderEntity = await client.accountHolders.entities.delete(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { account_holder_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(accountHolderEntity.token);", + }, + python: { + method: 'account_holders.entities.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\naccount_holder_entity = client.account_holders.entities.delete(\n entity_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n account_holder_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(account_holder_entity.token)', + }, + java: { + method: 'accountHolders().entities().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountHolderEntity;\nimport com.lithic.api.models.AccountHolderEntityDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountHolderEntityDeleteParams params = AccountHolderEntityDeleteParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .entityToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n AccountHolderEntity accountHolderEntity = client.accountHolders().entities().delete(params);\n }\n}', + }, + kotlin: { + method: 'accountHolders().entities().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountHolderEntity\nimport com.lithic.api.models.AccountHolderEntityDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AccountHolderEntityDeleteParams = AccountHolderEntityDeleteParams.builder()\n .accountHolderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .entityToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val accountHolderEntity: AccountHolderEntity = client.accountHolders().entities().delete(params)\n}', + }, + go: { + method: 'client.AccountHolders.Entities.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\taccountHolderEntity, err := client.AccountHolders.Entities.Delete(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", accountHolderEntity.Token)\n}\n', + }, + ruby: { + method: 'account_holders.entities.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\naccount_holder_entity = lithic.account_holders.entities.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n account_holder_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(account_holder_entity)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_holders/$ACCOUNT_HOLDER_TOKEN/entities/$ENTITY_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v2/auth_rules', + httpMethod: 'post', + summary: 'Create a new rule', + description: 'Creates a new V2 Auth rule in draft mode', + stainlessPath: '(resource) auth_rules.v2 > (method) create', + qualified: 'client.authRules.v2.create', + params: [ + "{ parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; account_tokens?: string[]; business_account_tokens?: string[]; event_stream?: string; name?: string; } | { card_tokens: string[]; parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; event_stream?: string; name?: string; } | { parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; program_level: boolean; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; event_stream?: string; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; name?: string; };", + ], + response: + "{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }", + perLanguage: { + typescript: { + method: 'client.authRules.v2.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst authRule = await client.authRules.v2.create({\n parameters: {\n conditions: [\n {\n attribute: 'MCC',\n operation: 'IS_ONE_OF',\n value: 'string',\n },\n ],\n },\n type: 'CONDITIONAL_BLOCK',\n});\n\nconsole.log(authRule.token);", + }, + python: { + method: 'auth_rules.v2.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nauth_rule = client.auth_rules.v2.create(\n parameters={\n "conditions": [{\n "attribute": "MCC",\n "operation": "IS_ONE_OF",\n "value": "string",\n }]\n },\n type="CONDITIONAL_BLOCK",\n)\nprint(auth_rule.token)', + }, + java: { + method: 'authRules().v2().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRule;\nimport com.lithic.api.models.AuthRuleCondition;\nimport com.lithic.api.models.AuthRuleV2CreateParams;\nimport com.lithic.api.models.ConditionalAttribute;\nimport com.lithic.api.models.ConditionalBlockParameters;\nimport com.lithic.api.models.ConditionalOperation;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRuleV2CreateParams.Body.AccountLevelRule params = AuthRuleV2CreateParams.Body.AccountLevelRule.builder()\n .parameters(ConditionalBlockParameters.builder()\n .addCondition(AuthRuleCondition.builder()\n .attribute(ConditionalAttribute.MCC)\n .operation(ConditionalOperation.IS_ONE_OF)\n .value("string")\n .build())\n .build())\n .type(AuthRuleV2CreateParams.Body.AccountLevelRule.AuthRuleType.CONDITIONAL_BLOCK)\n .build();\n AuthRule authRule = client.authRules().v2().create(params);\n }\n}', + }, + kotlin: { + method: 'authRules().v2().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRule\nimport com.lithic.api.models.AuthRuleCondition\nimport com.lithic.api.models.AuthRuleV2CreateParams\nimport com.lithic.api.models.ConditionalAttribute\nimport com.lithic.api.models.ConditionalBlockParameters\nimport com.lithic.api.models.ConditionalOperation\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AuthRuleV2CreateParams.Body.AccountLevelRule = AuthRuleV2CreateParams.Body.AccountLevelRule.builder()\n .parameters(ConditionalBlockParameters.builder()\n .addCondition(AuthRuleCondition.builder()\n .attribute(ConditionalAttribute.MCC)\n .operation(ConditionalOperation.IS_ONE_OF)\n .value("string")\n .build())\n .build())\n .type(AuthRuleV2CreateParams.Body.AccountLevelRule.AuthRuleType.CONDITIONAL_BLOCK)\n .build()\n val authRule: AuthRule = client.authRules().v2().create(params)\n}', + }, + go: { + method: 'client.AuthRules.V2.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n\t"github.com/lithic-com/lithic-go/shared"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tauthRule, err := client.AuthRules.V2.New(context.TODO(), lithic.AuthRuleV2NewParams{\n\t\tBody: lithic.AuthRuleV2NewParamsBodyAccountLevelRule{\n\t\t\tParameters: lithic.F[lithic.AuthRuleV2NewParamsBodyAccountLevelRuleParametersUnion](lithic.ConditionalBlockParameters{\n\t\t\t\tConditions: lithic.F([]lithic.AuthRuleConditionParam{{\n\t\t\t\t\tAttribute: lithic.F(lithic.ConditionalAttributeMcc),\n\t\t\t\t\tOperation: lithic.F(lithic.ConditionalOperationIsOneOf),\n\t\t\t\t\tValue: lithic.F[lithic.ConditionalValueUnionParam](shared.UnionString("string")),\n\t\t\t\t}}),\n\t\t\t}),\n\t\t\tType: lithic.F(lithic.AuthRuleV2NewParamsBodyAccountLevelRuleTypeConditionalBlock),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authRule.Token)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nauth_rule = lithic.auth_rules.v2.create(\n body: {\n parameters: {conditions: [{attribute: :MCC, operation: :IS_ONE_OF, value: "string"}]},\n type: :CONDITIONAL_BLOCK\n }\n)\n\nputs(auth_rule)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "parameters": {\n "conditions": [\n {\n "attribute": "MCC",\n "operation": "IS_ONE_OF",\n "value": "string"\n }\n ]\n },\n "type": "CONDITIONAL_BLOCK"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v2/auth_rules', + httpMethod: 'get', + summary: 'List rules', + description: 'Lists V2 Auth rules', + stainlessPath: '(resource) auth_rules.v2 > (method) list', + qualified: 'client.authRules.v2.list', + params: [ + 'account_token?: string;', + 'business_account_token?: string;', + 'card_token?: string;', + 'ending_before?: string;', + 'event_stream?: string;', + 'event_streams?: string[];', + 'page_size?: number;', + "scope?: 'PROGRAM' | 'ACCOUNT' | 'BUSINESS_ACCOUNT' | 'CARD' | 'ANY';", + 'starting_after?: string;', + ], + response: + "{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }", + markdown: + "## list\n\n`client.authRules.v2.list(account_token?: string, business_account_token?: string, card_token?: string, ending_before?: string, event_stream?: string, event_streams?: string[], page_size?: number, scope?: 'PROGRAM' | 'ACCOUNT' | 'BUSINESS_ACCOUNT' | 'CARD' | 'ANY', starting_after?: string): { token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: object; draft_version: object; event_stream: event_stream; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n**get** `/v2/auth_rules`\n\nLists V2 Auth rules\n\n### Parameters\n\n- `account_token?: string`\n Only return Auth Rules that are bound to the provided account token.\n\n- `business_account_token?: string`\n Only return Auth Rules that are bound to the provided business account token.\n\n- `card_token?: string`\n Only return Auth Rules that are bound to the provided card token.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `event_stream?: string`\n Deprecated: Use event_streams instead. Only return Auth rules that are executed during the provided event stream.\n\n- `event_streams?: string[]`\n Only return Auth rules that are executed during any of the provided event streams. If event_streams and event_stream are specified, the values will be combined.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `scope?: 'PROGRAM' | 'ACCOUNT' | 'BUSINESS_ACCOUNT' | 'CARD' | 'ANY'`\n Only return Auth Rules that are bound to the provided scope.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n - `token: string`\n - `account_tokens: string[]`\n - `business_account_tokens: string[]`\n - `card_tokens: string[]`\n - `current_version: { parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; version: number; }`\n - `draft_version: { error: string; parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }`\n - `event_stream: string`\n - `lithic_managed: boolean`\n - `name: string`\n - `program_level: boolean`\n - `state: 'ACTIVE' | 'INACTIVE'`\n - `type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'`\n - `excluded_account_tokens?: string[]`\n - `excluded_business_account_tokens?: string[]`\n - `excluded_card_tokens?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const authRule of client.authRules.v2.list()) {\n console.log(authRule);\n}\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const authRule of client.authRules.v2.list()) {\n console.log(authRule.token);\n}", + }, + python: { + method: 'auth_rules.v2.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.auth_rules.v2.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'authRules().v2().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2ListPage;\nimport com.lithic.api.models.AuthRuleV2ListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRuleV2ListPage page = client.authRules().v2().list();\n }\n}', + }, + kotlin: { + method: 'authRules().v2().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2ListPage\nimport com.lithic.api.models.AuthRuleV2ListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: AuthRuleV2ListPage = client.authRules().v2().list()\n}', + }, + go: { + method: 'client.AuthRules.V2.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.AuthRules.V2.List(context.TODO(), lithic.AuthRuleV2ListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.auth_rules.v2.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v2/auth_rules \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v2/auth_rules/{auth_rule_token}', + httpMethod: 'get', + summary: 'Fetch a rule', + description: 'Fetches a V2 Auth rule by its token', + stainlessPath: '(resource) auth_rules.v2 > (method) retrieve', + qualified: 'client.authRules.v2.retrieve', + params: ['auth_rule_token: string;'], + response: + "{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }", + markdown: + "## retrieve\n\n`client.authRules.v2.retrieve(auth_rule_token: string): { token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: object; draft_version: object; event_stream: event_stream; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n**get** `/v2/auth_rules/{auth_rule_token}`\n\nFetches a V2 Auth rule by its token\n\n### Parameters\n\n- `auth_rule_token: string`\n\n### Returns\n\n- `{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n - `token: string`\n - `account_tokens: string[]`\n - `business_account_tokens: string[]`\n - `card_tokens: string[]`\n - `current_version: { parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; version: number; }`\n - `draft_version: { error: string; parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }`\n - `event_stream: string`\n - `lithic_managed: boolean`\n - `name: string`\n - `program_level: boolean`\n - `state: 'ACTIVE' | 'INACTIVE'`\n - `type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'`\n - `excluded_account_tokens?: string[]`\n - `excluded_business_account_tokens?: string[]`\n - `excluded_card_tokens?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst authRule = await client.authRules.v2.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst authRule = await client.authRules.v2.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule.token);", + }, + python: { + method: 'auth_rules.v2.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nauth_rule = client.auth_rules.v2.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(auth_rule.token)', + }, + java: { + method: 'authRules().v2().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRule;\nimport com.lithic.api.models.AuthRuleV2RetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRule authRule = client.authRules().v2().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRule\nimport com.lithic.api.models.AuthRuleV2RetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val authRule: AuthRule = client.authRules().v2().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tauthRule, err := client.AuthRules.V2.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authRule.Token)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nauth_rule = lithic.auth_rules.v2.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(auth_rule)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v2/auth_rules/{auth_rule_token}', + httpMethod: 'patch', + summary: 'Update a rule', + description: + "Updates a V2 Auth rule's properties\n\nIf `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`, `excluded_account_tokens`, or `excluded_business_account_tokens` is provided, this will replace existing associations with the provided list of entities.\n", + stainlessPath: '(resource) auth_rules.v2 > (method) update', + qualified: 'client.authRules.v2.update', + params: [ + 'auth_rule_token: string;', + "body: { account_tokens?: string[]; business_account_tokens?: string[]; name?: string; state?: 'INACTIVE'; } | { card_tokens?: string[]; name?: string; state?: 'INACTIVE'; } | { excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; name?: string; program_level?: boolean; state?: 'INACTIVE'; };", + ], + response: + "{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }", + perLanguage: { + typescript: { + method: 'client.authRules.v2.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst authRule = await client.authRules.v2.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule.token);", + }, + python: { + method: 'auth_rules.v2.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nauth_rule = client.auth_rules.v2.update(\n auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(auth_rule.token)', + }, + java: { + method: 'authRules().v2().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRule;\nimport com.lithic.api.models.AuthRuleV2UpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRuleV2UpdateParams params = AuthRuleV2UpdateParams.builder()\n .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .body(AuthRuleV2UpdateParams.Body.AccountLevelRule.builder().build())\n .build();\n AuthRule authRule = client.authRules().v2().update(params);\n }\n}', + }, + kotlin: { + method: 'authRules().v2().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRule\nimport com.lithic.api.models.AuthRuleV2UpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AuthRuleV2UpdateParams = AuthRuleV2UpdateParams.builder()\n .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .body(AuthRuleV2UpdateParams.Body.AccountLevelRule.builder().build())\n .build()\n val authRule: AuthRule = client.authRules().v2().update(params)\n}', + }, + go: { + method: 'client.AuthRules.V2.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tauthRule, err := client.AuthRules.V2.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AuthRuleV2UpdateParams{\n\t\t\tBody: lithic.AuthRuleV2UpdateParamsBodyAccountLevelRule{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authRule.Token)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nauth_rule = lithic.auth_rules.v2.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body: {})\n\nputs(auth_rule)', + }, + http: { + example: + "curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'delete', + endpoint: '/v2/auth_rules/{auth_rule_token}', + httpMethod: 'delete', + summary: 'Delete a rule', + description: 'Deletes a V2 Auth rule', + stainlessPath: '(resource) auth_rules.v2 > (method) delete', + qualified: 'client.authRules.v2.delete', + params: ['auth_rule_token: string;'], + markdown: + "## delete\n\n`client.authRules.v2.delete(auth_rule_token: string): void`\n\n**delete** `/v2/auth_rules/{auth_rule_token}`\n\nDeletes a V2 Auth rule\n\n### Parameters\n\n- `auth_rule_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.authRules.v2.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.authRules.v2.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');", + }, + python: { + method: 'auth_rules.v2.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.auth_rules.v2.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'authRules().v2().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2DeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.authRules().v2().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2DeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.authRules().v2().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.AuthRules.V2.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'auth_rules.v2.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.auth_rules.v2.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'draft', + endpoint: '/v2/auth_rules/{auth_rule_token}/draft', + httpMethod: 'post', + summary: 'Draft a new rule version', + description: + 'Creates a new draft version of a rule that will be ran in shadow mode.\n\nThis can also be utilized to reset the draft parameters, causing a draft version to no longer be ran in shadow mode.\n', + stainlessPath: '(resource) auth_rules.v2 > (method) draft', + qualified: 'client.authRules.v2.draft', + params: [ + 'auth_rule_token: string;', + "parameters?: { conditions: { attribute: conditional_attribute; operation: conditional_operation; value: conditional_value; }[]; } | { period: { duration: number; type: 'CUSTOM'; } | { type: 'DAY'; } | { type: 'WEEK'; day_of_week?: number; } | { type: 'MONTH'; day_of_month?: number; } | { type: 'YEAR'; day_of_month?: number; month?: number; }; scope: 'CARD' | 'ACCOUNT'; filters?: { exclude_countries?: string[]; exclude_mccs?: string[]; include_countries?: string[]; include_mccs?: string[]; include_pan_entry_modes?: string[]; }; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; parameters?: { interval?: 'LIFETIME' | '7D' | '30D' | '90D'; scope?: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; }; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { action: { key: string; type: 'TAG'; value: string; } | { queue_token: string; scope: 'CARD' | 'ACCOUNT'; type: 'CREATE_CASE'; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; parameters?: { filters?: spend_velocity_filters; interval?: 'LIFETIME' | '7D' | '30D' | '90D'; period?: velocity_limit_period; scope?: 'CARD' | 'ACCOUNT' | 'GLOBAL'; unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; }; }[]; } | { action: { key: string; type: 'TAG'; value: string; } | { queue_token: string; scope: 'FINANCIAL_ACCOUNT'; type: 'CREATE_CASE'; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { code: string; features: { type: 'AUTHORIZATION'; name?: string; } | { type: 'AUTHENTICATION'; name?: string; } | { type: 'TOKENIZATION'; name?: string; } | { type: 'ACH_RECEIPT'; name?: string; } | { type: 'CARD_TRANSACTION'; name?: string; } | { type: 'ACH_PAYMENT'; name?: string; } | { type: 'EXTERNAL_BANK_ACCOUNT'; name?: string; } | { type: 'CARD'; name?: string; } | { type: 'ACCOUNT_HOLDER'; name?: string; } | { type: 'IP_METADATA'; name?: string; } | { period: velocity_limit_period; scope: 'CARD' | 'ACCOUNT'; type: 'SPEND_VELOCITY'; filters?: velocity_limit_filters; name?: string; } | { period: velocity_limit_period; scope: 'FINANCIAL_ACCOUNT' | 'GLOBAL'; type: 'PAYMENT_VELOCITY'; filters?: object; name?: string; } | { scope: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; type: 'TRANSACTION_HISTORY_SIGNALS'; name?: string; } | { scope: 'CARD' | 'ACCOUNT'; type: 'CONSECUTIVE_DECLINES'; name?: string; } | { scope: 'FINANCIAL_ACCOUNT'; type: 'ACH_PAYMENT_HISTORY'; name?: string; }[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; parameters?: { interval?: 'LIFETIME' | '7D' | '30D' | '90D'; scope?: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; }; }[]; };", + ], + response: + "{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }", + markdown: + "## draft\n\n`client.authRules.v2.draft(auth_rule_token: string, parameters?: { conditions: auth_rule_condition[]; } | { period: velocity_limit_period; scope: 'CARD' | 'ACCOUNT'; filters?: velocity_limit_filters; limit_amount?: number; limit_count?: number; } | { merchants: object[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: object[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: object[]; } | { action: object | object; conditions: object[]; } | { action: object | object; conditions: object[]; } | { action: card_transaction_update_action; conditions: object[]; } | { action: ach_payment_update_action; conditions: object[]; } | { code: string; features: rule_feature[]; } | { action: object; conditions: object[]; }): { token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: object; draft_version: object; event_stream: event_stream; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n**post** `/v2/auth_rules/{auth_rule_token}/draft`\n\nCreates a new draft version of a rule that will be ran in shadow mode.\n\nThis can also be utilized to reset the draft parameters, causing a draft version to no longer be ran in shadow mode.\n\n\n### Parameters\n\n- `auth_rule_token: string`\n\n- `parameters?: { conditions: { attribute: conditional_attribute; operation: conditional_operation; value: conditional_value; }[]; } | { period: { duration: number; type: 'CUSTOM'; } | { type: 'DAY'; } | { type: 'WEEK'; day_of_week?: number; } | { type: 'MONTH'; day_of_month?: number; } | { type: 'YEAR'; day_of_month?: number; month?: number; }; scope: 'CARD' | 'ACCOUNT'; filters?: { exclude_countries?: string[]; exclude_mccs?: string[]; include_countries?: string[]; include_mccs?: string[]; include_pan_entry_modes?: string[]; }; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; parameters?: { interval?: 'LIFETIME' | '7D' | '30D' | '90D'; scope?: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; }; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { action: { key: string; type: 'TAG'; value: string; } | { queue_token: string; scope: 'CARD' | 'ACCOUNT'; type: 'CREATE_CASE'; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; parameters?: { filters?: spend_velocity_filters; interval?: 'LIFETIME' | '7D' | '30D' | '90D'; period?: velocity_limit_period; scope?: 'CARD' | 'ACCOUNT' | 'GLOBAL'; unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; }; }[]; } | { action: { key: string; type: 'TAG'; value: string; } | { queue_token: string; scope: 'FINANCIAL_ACCOUNT'; type: 'CREATE_CASE'; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; }[]; } | { code: string; features: { type: 'AUTHORIZATION'; name?: string; } | { type: 'AUTHENTICATION'; name?: string; } | { type: 'TOKENIZATION'; name?: string; } | { type: 'ACH_RECEIPT'; name?: string; } | { type: 'CARD_TRANSACTION'; name?: string; } | { type: 'ACH_PAYMENT'; name?: string; } | { type: 'EXTERNAL_BANK_ACCOUNT'; name?: string; } | { type: 'CARD'; name?: string; } | { type: 'ACCOUNT_HOLDER'; name?: string; } | { type: 'IP_METADATA'; name?: string; } | { period: velocity_limit_period; scope: 'CARD' | 'ACCOUNT'; type: 'SPEND_VELOCITY'; filters?: velocity_limit_filters; name?: string; } | { period: velocity_limit_period; scope: 'FINANCIAL_ACCOUNT' | 'GLOBAL'; type: 'PAYMENT_VELOCITY'; filters?: object; name?: string; } | { scope: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; type: 'TRANSACTION_HISTORY_SIGNALS'; name?: string; } | { scope: 'CARD' | 'ACCOUNT'; type: 'CONSECUTIVE_DECLINES'; name?: string; } | { scope: 'FINANCIAL_ACCOUNT'; type: 'ACH_PAYMENT_HISTORY'; name?: string; }[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: string; value: string | number | number | string[] | string; parameters?: { interval?: 'LIFETIME' | '7D' | '30D' | '90D'; scope?: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; }; }[]; }`\n Parameters for the Auth Rule\n\n### Returns\n\n- `{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n - `token: string`\n - `account_tokens: string[]`\n - `business_account_tokens: string[]`\n - `card_tokens: string[]`\n - `current_version: { parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; version: number; }`\n - `draft_version: { error: string; parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }`\n - `event_stream: string`\n - `lithic_managed: boolean`\n - `name: string`\n - `program_level: boolean`\n - `state: 'ACTIVE' | 'INACTIVE'`\n - `type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'`\n - `excluded_account_tokens?: string[]`\n - `excluded_business_account_tokens?: string[]`\n - `excluded_card_tokens?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst authRule = await client.authRules.v2.draft('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.draft', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst authRule = await client.authRules.v2.draft('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule.token);", + }, + python: { + method: 'auth_rules.v2.draft', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nauth_rule = client.auth_rules.v2.draft(\n auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(auth_rule.token)', + }, + java: { + method: 'authRules().v2().draft', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRule;\nimport com.lithic.api.models.AuthRuleV2DraftParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRule authRule = client.authRules().v2().draft("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().draft', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRule\nimport com.lithic.api.models.AuthRuleV2DraftParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val authRule: AuthRule = client.authRules().v2().draft("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.Draft', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tauthRule, err := client.AuthRules.V2.Draft(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AuthRuleV2DraftParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authRule.Token)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.draft', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nauth_rule = lithic.auth_rules.v2.draft("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(auth_rule)', + }, + http: { + example: + "curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/draft \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'list_versions', + endpoint: '/v2/auth_rules/{auth_rule_token}/versions', + httpMethod: 'get', + summary: 'List rule versions', + description: 'Returns all versions of an auth rule, sorted by version number descending (newest first).', + stainlessPath: '(resource) auth_rules.v2 > (method) list_versions', + qualified: 'client.authRules.v2.listVersions', + params: ['auth_rule_token: string;'], + response: + "{ data: { created: string; parameters: conditional_block_parameters | velocity_limit_params | merchant_lock_parameters | conditional_3ds_action_parameters | conditional_authorization_action_parameters | conditional_ach_action_parameters | conditional_tokenization_action_parameters | conditional_card_transaction_update_action_parameters | conditional_ach_payment_update_action_parameters | typescript_code_parameters | conditional_authorization_adjustment_parameters; state: 'ACTIVE' | 'SHADOW' | 'INACTIVE'; version: number; }[]; }", + markdown: + "## list_versions\n\n`client.authRules.v2.listVersions(auth_rule_token: string): { data: auth_rule_version[]; }`\n\n**get** `/v2/auth_rules/{auth_rule_token}/versions`\n\nReturns all versions of an auth rule, sorted by version number descending (newest first).\n\n### Parameters\n\n- `auth_rule_token: string`\n\n### Returns\n\n- `{ data: { created: string; parameters: conditional_block_parameters | velocity_limit_params | merchant_lock_parameters | conditional_3ds_action_parameters | conditional_authorization_action_parameters | conditional_ach_action_parameters | conditional_tokenization_action_parameters | conditional_card_transaction_update_action_parameters | conditional_ach_payment_update_action_parameters | typescript_code_parameters | conditional_authorization_adjustment_parameters; state: 'ACTIVE' | 'SHADOW' | 'INACTIVE'; version: number; }[]; }`\n\n - `data: { created: string; parameters: { conditions: auth_rule_condition[]; } | { period: velocity_limit_period; scope: 'CARD' | 'ACCOUNT'; filters?: velocity_limit_filters; limit_amount?: number; limit_count?: number; } | { merchants: object[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: object[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: object[]; } | { action: object | object; conditions: object[]; } | { action: object | object; conditions: object[]; } | { action: card_transaction_update_action; conditions: object[]; } | { action: ach_payment_update_action; conditions: object[]; } | { code: string; features: rule_feature[]; } | { action: object; conditions: object[]; }; state: 'ACTIVE' | 'SHADOW' | 'INACTIVE'; version: number; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.authRules.v2.listVersions('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.listVersions', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.authRules.v2.listVersions('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.data);", + }, + python: { + method: 'auth_rules.v2.list_versions', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.auth_rules.v2.list_versions(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.data)', + }, + java: { + method: 'authRules().v2().listVersions', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2ListVersionsParams;\nimport com.lithic.api.models.V2ListVersionsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n V2ListVersionsResponse response = client.authRules().v2().listVersions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().listVersions', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2ListVersionsParams\nimport com.lithic.api.models.V2ListVersionsResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: V2ListVersionsResponse = client.authRules().v2().listVersions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.ListVersions', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.AuthRules.V2.ListVersions(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.list_versions', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.auth_rules.v2.list_versions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/versions \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'promote', + endpoint: '/v2/auth_rules/{auth_rule_token}/promote', + httpMethod: 'post', + summary: 'Promote a rule version', + description: + 'Promotes the draft version of an Auth rule to the currently active version such that it is enforced in the respective stream.', + stainlessPath: '(resource) auth_rules.v2 > (method) promote', + qualified: 'client.authRules.v2.promote', + params: ['auth_rule_token: string;'], + response: + "{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }", + markdown: + "## promote\n\n`client.authRules.v2.promote(auth_rule_token: string): { token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: object; draft_version: object; event_stream: event_stream; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n**post** `/v2/auth_rules/{auth_rule_token}/promote`\n\nPromotes the draft version of an Auth rule to the currently active version such that it is enforced in the respective stream.\n\n### Parameters\n\n- `auth_rule_token: string`\n\n### Returns\n\n- `{ token: string; account_tokens: string[]; business_account_tokens: string[]; card_tokens: string[]; current_version: { parameters: object | object | object | object | object | object | object | object | object | object | object; version: number; }; draft_version: { error: string; parameters: object | object | object | object | object | object | object | object | object | object | object; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }; event_stream: string; lithic_managed: boolean; name: string; program_level: boolean; state: 'ACTIVE' | 'INACTIVE'; type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; excluded_account_tokens?: string[]; excluded_business_account_tokens?: string[]; excluded_card_tokens?: string[]; }`\n\n - `token: string`\n - `account_tokens: string[]`\n - `business_account_tokens: string[]`\n - `card_tokens: string[]`\n - `current_version: { parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; version: number; }`\n - `draft_version: { error: string; parameters: { conditions: object[]; } | { period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; filters?: object; limit_amount?: number; limit_count?: number; } | { merchants: { comment?: string; descriptor?: string; merchant_id?: string; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: 'DECLINE' | 'CHALLENGE'; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: { type: 'APPROVE'; } | { code: string; type: 'RETURN'; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: { type: 'DECLINE'; reason?: string; } | { type: 'REQUIRE_TFA'; reason?: string; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; } | { action: object | object; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; }[]; } | { code: string; features: object | object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; } | { action: { mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; type: 'HOLD_ADJUSTMENT'; value: number; }; conditions: { attribute: string; operation: conditional_operation; value: conditional_value; parameters?: object; }[]; }; state: 'PENDING' | 'SHADOWING' | 'ERROR'; version: number; }`\n - `event_stream: string`\n - `lithic_managed: boolean`\n - `name: string`\n - `program_level: boolean`\n - `state: 'ACTIVE' | 'INACTIVE'`\n - `type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'`\n - `excluded_account_tokens?: string[]`\n - `excluded_business_account_tokens?: string[]`\n - `excluded_card_tokens?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst authRule = await client.authRules.v2.promote('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.promote', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst authRule = await client.authRules.v2.promote('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(authRule.token);", + }, + python: { + method: 'auth_rules.v2.promote', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nauth_rule = client.auth_rules.v2.promote(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(auth_rule.token)', + }, + java: { + method: 'authRules().v2().promote', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRule;\nimport com.lithic.api.models.AuthRuleV2PromoteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRule authRule = client.authRules().v2().promote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().promote', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRule\nimport com.lithic.api.models.AuthRuleV2PromoteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val authRule: AuthRule = client.authRules().v2().promote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.Promote', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tauthRule, err := client.AuthRules.V2.Promote(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authRule.Token)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.promote', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nauth_rule = lithic.auth_rules.v2.promote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(auth_rule)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/promote \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_report', + endpoint: '/v2/auth_rules/{auth_rule_token}/report', + httpMethod: 'get', + summary: 'Retrieve a performance report', + description: + 'Retrieves a performance report for an Auth rule containing daily statistics and evaluation outcomes.\n\n**Time Range Limitations:**\n- Reports are supported for the past 3 months only\n- Maximum interval length is 1 month\n- Report data is available only through the previous day in UTC (current day data is not available)\n\nThe report provides daily statistics for both current and draft versions of the Auth rule, including approval, decline, and challenge counts along with sample events.\n', + stainlessPath: '(resource) auth_rules.v2 > (method) retrieve_report', + qualified: 'client.authRules.v2.retrieveReport', + params: ['auth_rule_token: string;', 'begin: string;', 'end: string;'], + response: + '{ auth_rule_token: string; begin: string; daily_statistics: { date: string; versions: object[]; }[]; end: string; }', + markdown: + "## retrieve_report\n\n`client.authRules.v2.retrieveReport(auth_rule_token: string, begin: string, end: string): { auth_rule_token: string; begin: string; daily_statistics: object[]; end: string; }`\n\n**get** `/v2/auth_rules/{auth_rule_token}/report`\n\nRetrieves a performance report for an Auth rule containing daily statistics and evaluation outcomes.\n\n**Time Range Limitations:**\n- Reports are supported for the past 3 months only\n- Maximum interval length is 1 month\n- Report data is available only through the previous day in UTC (current day data is not available)\n\nThe report provides daily statistics for both current and draft versions of the Auth rule, including approval, decline, and challenge counts along with sample events.\n\n\n### Parameters\n\n- `auth_rule_token: string`\n\n- `begin: string`\n Start date for the report\n\n- `end: string`\n End date for the report\n\n### Returns\n\n- `{ auth_rule_token: string; begin: string; daily_statistics: { date: string; versions: object[]; }[]; end: string; }`\n\n - `auth_rule_token: string`\n - `begin: string`\n - `daily_statistics: { date: string; versions: { action_counts: object; examples: { actions: object | object | object | object | object | object | object[]; event_token: string; timestamp: string; transaction_token?: string; }[]; state: 'ACTIVE' | 'SHADOW' | 'INACTIVE'; version: number; }[]; }[]`\n - `end: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.authRules.v2.retrieveReport('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { begin: '2019-12-27', end: '2019-12-27' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.retrieveReport', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.authRules.v2.retrieveReport('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n begin: '2019-12-27',\n end: '2019-12-27',\n});\n\nconsole.log(response.auth_rule_token);", + }, + python: { + method: 'auth_rules.v2.retrieve_report', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.auth_rules.v2.retrieve_report(\n auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n begin=date.fromisoformat("2019-12-27"),\n end=date.fromisoformat("2019-12-27"),\n)\nprint(response.auth_rule_token)', + }, + java: { + method: 'authRules().v2().retrieveReport', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2RetrieveReportParams;\nimport com.lithic.api.models.V2RetrieveReportResponse;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRuleV2RetrieveReportParams params = AuthRuleV2RetrieveReportParams.builder()\n .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .begin(LocalDate.parse("2019-12-27"))\n .end(LocalDate.parse("2019-12-27"))\n .build();\n V2RetrieveReportResponse response = client.authRules().v2().retrieveReport(params);\n }\n}', + }, + kotlin: { + method: 'authRules().v2().retrieveReport', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2RetrieveReportParams\nimport com.lithic.api.models.V2RetrieveReportResponse\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AuthRuleV2RetrieveReportParams = AuthRuleV2RetrieveReportParams.builder()\n .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .begin(LocalDate.parse("2019-12-27"))\n .end(LocalDate.parse("2019-12-27"))\n .build()\n val response: V2RetrieveReportResponse = client.authRules().v2().retrieveReport(params)\n}', + }, + go: { + method: 'client.AuthRules.V2.GetReport', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.AuthRules.V2.GetReport(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AuthRuleV2GetReportParams{\n\t\t\tBegin: lithic.F(time.Now()),\n\t\t\tEnd: lithic.F(time.Now()),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.AuthRuleToken)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.retrieve_report', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.auth_rules.v2.retrieve_report(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n begin_: "2019-12-27",\n end_: "2019-12-27"\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/report \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_features', + endpoint: '/v2/auth_rules/{auth_rule_token}/features', + httpMethod: 'get', + summary: 'Calculated Feature values', + description: + 'Fetches the current calculated Feature values for the given Auth Rule\n\nThis only calculates the features for the active version.\n- VelocityLimit Rules calculates the current Velocity Feature data. This requires a `card_token` or `account_token` matching what the rule is Scoped to.\n- ConditionalBlock Rules calculates the CARD_TRANSACTION_COUNT_* attributes on the rule. This requires a `card_token`\n', + stainlessPath: '(resource) auth_rules.v2 > (method) retrieve_features', + qualified: 'client.authRules.v2.retrieveFeatures', + params: ['auth_rule_token: string;', 'account_token?: string;', 'card_token?: string;'], + response: + "{ evaluated: string; features: { filters: object; period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; value: { amount: number; count: number; }; }[]; }", + markdown: + "## retrieve_features\n\n`client.authRules.v2.retrieveFeatures(auth_rule_token: string, account_token?: string, card_token?: string): { evaluated: string; features: object[]; }`\n\n**get** `/v2/auth_rules/{auth_rule_token}/features`\n\nFetches the current calculated Feature values for the given Auth Rule\n\nThis only calculates the features for the active version.\n- VelocityLimit Rules calculates the current Velocity Feature data. This requires a `card_token` or `account_token` matching what the rule is Scoped to.\n- ConditionalBlock Rules calculates the CARD_TRANSACTION_COUNT_* attributes on the rule. This requires a `card_token`\n\n\n### Parameters\n\n- `auth_rule_token: string`\n\n- `account_token?: string`\n\n- `card_token?: string`\n\n### Returns\n\n- `{ evaluated: string; features: { filters: object; period: object | object | object | object | object; scope: 'CARD' | 'ACCOUNT'; value: { amount: number; count: number; }; }[]; }`\n\n - `evaluated: string`\n - `features: { filters: { exclude_countries?: string[]; exclude_mccs?: string[]; include_countries?: string[]; include_mccs?: string[]; include_pan_entry_modes?: string[]; }; period: { duration: number; type: 'CUSTOM'; } | { type: 'DAY'; } | { type: 'WEEK'; day_of_week?: number; } | { type: 'MONTH'; day_of_month?: number; } | { type: 'YEAR'; day_of_month?: number; month?: number; }; scope: 'CARD' | 'ACCOUNT'; value: { amount: number; count: number; }; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.authRules.v2.retrieveFeatures('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.retrieveFeatures', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.authRules.v2.retrieveFeatures('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.evaluated);", + }, + python: { + method: 'auth_rules.v2.retrieve_features', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.auth_rules.v2.retrieve_features(\n auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.evaluated)', + }, + java: { + method: 'authRules().v2().retrieveFeatures', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams;\nimport com.lithic.api.models.V2RetrieveFeaturesResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n V2RetrieveFeaturesResponse response = client.authRules().v2().retrieveFeatures("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().retrieveFeatures', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2RetrieveFeaturesParams\nimport com.lithic.api.models.V2RetrieveFeaturesResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: V2RetrieveFeaturesResponse = client.authRules().v2().retrieveFeatures("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.GetFeatures', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.AuthRules.V2.GetFeatures(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AuthRuleV2GetFeaturesParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Evaluated)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.retrieve_features', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.auth_rules.v2.retrieve_features("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/features \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list_results', + endpoint: '/v2/auth_rules/results', + httpMethod: 'get', + summary: 'List rule evaluation results', + description: + 'Lists Auth Rule evaluation results.\n\n**Limitations:**\n- Results are available for the past 3 months only\n- At least one filter (`event_token` or `auth_rule_token`) must be provided\n- When filtering by `event_token`, pagination is not supported\n', + stainlessPath: '(resource) auth_rules.v2 > (method) list_results', + qualified: 'client.authRules.v2.listResults', + params: [ + 'auth_rule_token?: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'event_token?: string;', + 'has_actions?: boolean;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: 'object | object | object | object | object | object', + markdown: + "## list_results\n\n`client.authRules.v2.listResults(auth_rule_token?: string, begin?: string, end?: string, ending_before?: string, event_token?: string, has_actions?: boolean, page_size?: number, starting_after?: string): { token: string; actions: object | object[]; auth_rule_token: string; evaluation_time: string; event_stream: 'AUTHORIZATION'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: object[]; auth_rule_token: string; evaluation_time: string; event_stream: 'THREE_DS_AUTHENTICATION'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: object | object[]; auth_rule_token: string; evaluation_time: string; event_stream: 'TOKENIZATION'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: object | object[]; auth_rule_token: string; evaluation_time: string; event_stream: 'ACH_CREDIT_RECEIPT' | 'ACH_DEBIT_RECEIPT'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: object | object[]; auth_rule_token: string; evaluation_time: string; event_stream: 'CARD_TRANSACTION_UPDATE'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: object | object[]; auth_rule_token: string; evaluation_time: string; event_stream: 'ACH_PAYMENT_UPDATE'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; }`\n\n**get** `/v2/auth_rules/results`\n\nLists Auth Rule evaluation results.\n\n**Limitations:**\n- Results are available for the past 3 months only\n- At least one filter (`event_token` or `auth_rule_token`) must be provided\n- When filtering by `event_token`, pagination is not supported\n\n\n### Parameters\n\n- `auth_rule_token?: string`\n Filter by Auth Rule token\n\n- `begin?: string`\n Date string in RFC 3339 format. Only events evaluated after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only events evaluated before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `event_token?: string`\n Filter by event token\n\n- `has_actions?: boolean`\n Filter by whether the rule evaluation produced any actions. When not provided, all results are returned.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; actions: { code: string; type: 'DECLINE'; explanation?: string; } | { type: 'CHALLENGE'; explanation?: string; }[]; auth_rule_token: string; evaluation_time: string; event_stream: 'AUTHORIZATION'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: { type: 'DECLINE' | 'CHALLENGE'; explanation?: string; }[]; auth_rule_token: string; evaluation_time: string; event_stream: 'THREE_DS_AUTHENTICATION'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: { type: 'DECLINE'; explanation?: string; reason?: string; } | { type: 'REQUIRE_TFA'; explanation?: string; reason?: string; }[]; auth_rule_token: string; evaluation_time: string; event_stream: 'TOKENIZATION'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: { type: 'APPROVE'; explanation?: string; } | { code: string; type: 'RETURN'; explanation?: string; }[]; auth_rule_token: string; evaluation_time: string; event_stream: 'ACH_CREDIT_RECEIPT' | 'ACH_DEBIT_RECEIPT'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: { key: string; type: 'TAG'; value: string; explanation?: string; } | { queue_token: string; scope: 'CARD' | 'ACCOUNT'; type: 'CREATE_CASE'; explanation?: string; }[]; auth_rule_token: string; evaluation_time: string; event_stream: 'CARD_TRANSACTION_UPDATE'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; } | { token: string; actions: { key: string; type: 'TAG'; value: string; explanation?: string; } | { queue_token: string; scope: 'FINANCIAL_ACCOUNT'; type: 'CREATE_CASE'; explanation?: string; }[]; auth_rule_token: string; evaluation_time: string; event_stream: 'ACH_PAYMENT_UPDATE'; event_token: string; mode: 'ACTIVE' | 'INACTIVE'; rule_version: number; transaction_token: string; }`\n Result of an Auth Rule evaluation\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const v2ListResultsResponse of client.authRules.v2.listResults()) {\n console.log(v2ListResultsResponse);\n}\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.listResults', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const v2ListResultsResponse of client.authRules.v2.listResults()) {\n console.log(v2ListResultsResponse);\n}", + }, + python: { + method: 'auth_rules.v2.list_results', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.auth_rules.v2.list_results()\npage = page.data[0]\nprint(page)', + }, + java: { + method: 'authRules().v2().listResults', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2ListResultsPage;\nimport com.lithic.api.models.AuthRuleV2ListResultsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRuleV2ListResultsPage page = client.authRules().v2().listResults();\n }\n}', + }, + kotlin: { + method: 'authRules().v2().listResults', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2ListResultsPage\nimport com.lithic.api.models.AuthRuleV2ListResultsParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: AuthRuleV2ListResultsPage = client.authRules().v2().listResults()\n}', + }, + go: { + method: 'client.AuthRules.V2.ListResults', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.AuthRules.V2.ListResults(context.TODO(), lithic.AuthRuleV2ListResultsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.list_results', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.auth_rules.v2.list_results\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/results \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v2/auth_rules/{auth_rule_token}/backtests', + httpMethod: 'post', + summary: 'Request a backtest', + description: + "Initiates a request to asynchronously generate a backtest for an Auth rule. During backtesting, both the active version (if one exists) and the draft version of the Auth Rule are evaluated by replaying historical transaction data against the rule's conditions. This process allows customers to simulate and understand the effects of proposed rule changes before deployment.\nThe generated backtest report provides detailed results showing whether the draft version of the Auth Rule would have approved or declined historical transactions which were processed during the backtest period. These reports help evaluate how changes to rule configurations might affect overall transaction approval rates.\n\nThe generated backtest report will be delivered asynchronously through a webhook with `event_type` = `auth_rules.backtest_report.created`. See the docs on setting up [webhook subscriptions](https://docs.lithic.com/docs/events-api).\nIt is also possible to request backtest reports on-demand through the `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` endpoint.\n\nLithic currently supports backtesting for `CONDITIONAL_BLOCK` / `CONDITIONAL_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e. where Lithic has pre-calculated the requested velocity metrics for historical transactions), a backtest may be feasible. However, such cases are uncommon and customers should not anticipate support for velocity backtests under most configurations.\nIf a historical transaction does not feature the required inputs to evaluate the rule, then it will not be included in the final backtest report.\n", + stainlessPath: '(resource) auth_rules.v2.backtests > (method) create', + qualified: 'client.authRules.v2.backtests.create', + params: ['auth_rule_token: string;', 'end?: string;', 'start?: string;'], + response: '{ backtest_token?: string; }', + markdown: + "## create\n\n`client.authRules.v2.backtests.create(auth_rule_token: string, end?: string, start?: string): { backtest_token?: string; }`\n\n**post** `/v2/auth_rules/{auth_rule_token}/backtests`\n\nInitiates a request to asynchronously generate a backtest for an Auth rule. During backtesting, both the active version (if one exists) and the draft version of the Auth Rule are evaluated by replaying historical transaction data against the rule's conditions. This process allows customers to simulate and understand the effects of proposed rule changes before deployment.\nThe generated backtest report provides detailed results showing whether the draft version of the Auth Rule would have approved or declined historical transactions which were processed during the backtest period. These reports help evaluate how changes to rule configurations might affect overall transaction approval rates.\n\nThe generated backtest report will be delivered asynchronously through a webhook with `event_type` = `auth_rules.backtest_report.created`. See the docs on setting up [webhook subscriptions](https://docs.lithic.com/docs/events-api).\nIt is also possible to request backtest reports on-demand through the `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` endpoint.\n\nLithic currently supports backtesting for `CONDITIONAL_BLOCK` / `CONDITIONAL_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e. where Lithic has pre-calculated the requested velocity metrics for historical transactions), a backtest may be feasible. However, such cases are uncommon and customers should not anticipate support for velocity backtests under most configurations.\nIf a historical transaction does not feature the required inputs to evaluate the rule, then it will not be included in the final backtest report.\n\n\n### Parameters\n\n- `auth_rule_token: string`\n\n- `end?: string`\n The end time of the backtest.\n\n- `start?: string`\n The start time of the backtest.\n\n### Returns\n\n- `{ backtest_token?: string; }`\n\n - `backtest_token?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst backtest = await client.authRules.v2.backtests.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(backtest);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.backtests.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst backtest = await client.authRules.v2.backtests.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(backtest.backtest_token);", + }, + python: { + method: 'auth_rules.v2.backtests.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nbacktest = client.auth_rules.v2.backtests.create(\n auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(backtest.backtest_token)', + }, + java: { + method: 'authRules().v2().backtests().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2BacktestCreateParams;\nimport com.lithic.api.models.BacktestCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BacktestCreateResponse backtest = client.authRules().v2().backtests().create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'authRules().v2().backtests().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2BacktestCreateParams\nimport com.lithic.api.models.BacktestCreateResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val backtest: BacktestCreateResponse = client.authRules().v2().backtests().create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AuthRules.V2.Backtests.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tbacktest, err := client.AuthRules.V2.Backtests.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.AuthRuleV2BacktestNewParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", backtest.BacktestToken)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.backtests.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nbacktest = lithic.auth_rules.v2.backtests.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(backtest)', + }, + http: { + example: + "curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/backtests \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}', + httpMethod: 'get', + summary: 'Retrieve backtest results', + description: + 'Returns the backtest results of an Auth rule (if available).\n\nBacktesting is an asynchronous process that requires time to complete. If a customer retrieves the backtest results using this endpoint before the report is fully generated, the response will return null for `results.current_version` and `results.draft_version`. Customers are advised to wait for the backtest creation process to complete (as indicated by the webhook event auth_rules.backtest_report.created) before retrieving results from this endpoint.\n\nBacktesting is an asynchronous process, while the backtest is being processed, results will not be available which will cause `results.current_version` and `results.draft_version` objects to contain `null`.\nThe entries in `results` will also always represent the configuration of the rule at the time requests are made to this endpoint. For example, the results for `current_version` in the served backtest report will be consistent with which version of the rule is currently activated in the respective event stream, regardless of which version of the rule was active in the event stream at the time a backtest is requested.\n', + stainlessPath: '(resource) auth_rules.v2.backtests > (method) retrieve', + qualified: 'client.authRules.v2.backtests.retrieve', + params: ['auth_rule_token: string;', 'auth_rule_backtest_token: string;'], + response: + '{ backtest_token: string; results: { current_version?: object; draft_version?: object; }; simulation_parameters: { end: string; start: string; }; }', + markdown: + "## retrieve\n\n`client.authRules.v2.backtests.retrieve(auth_rule_token: string, auth_rule_backtest_token: string): { backtest_token: string; results: object; simulation_parameters: object; }`\n\n**get** `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`\n\nReturns the backtest results of an Auth rule (if available).\n\nBacktesting is an asynchronous process that requires time to complete. If a customer retrieves the backtest results using this endpoint before the report is fully generated, the response will return null for `results.current_version` and `results.draft_version`. Customers are advised to wait for the backtest creation process to complete (as indicated by the webhook event auth_rules.backtest_report.created) before retrieving results from this endpoint.\n\nBacktesting is an asynchronous process, while the backtest is being processed, results will not be available which will cause `results.current_version` and `results.draft_version` objects to contain `null`.\nThe entries in `results` will also always represent the configuration of the rule at the time requests are made to this endpoint. For example, the results for `current_version` in the served backtest report will be consistent with which version of the rule is currently activated in the respective event stream, regardless of which version of the rule was active in the event stream at the time a backtest is requested.\n\n\n### Parameters\n\n- `auth_rule_token: string`\n\n- `auth_rule_backtest_token: string`\n\n### Returns\n\n- `{ backtest_token: string; results: { current_version?: object; draft_version?: object; }; simulation_parameters: { end: string; start: string; }; }`\n\n - `backtest_token: string`\n - `results: { current_version?: { approved?: number; challenged?: number; declined?: number; examples?: { decision?: 'APPROVED' | 'DECLINED' | 'CHALLENGED'; event_token?: string; timestamp?: string; transaction_token?: string; }[]; version?: number; }; draft_version?: { approved?: number; challenged?: number; declined?: number; examples?: { decision?: 'APPROVED' | 'DECLINED' | 'CHALLENGED'; event_token?: string; timestamp?: string; transaction_token?: string; }[]; version?: number; }; }`\n - `simulation_parameters: { end: string; start: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst backtestResults = await client.authRules.v2.backtests.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { auth_rule_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(backtestResults);\n```", + perLanguage: { + typescript: { + method: 'client.authRules.v2.backtests.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst backtestResults = await client.authRules.v2.backtests.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { auth_rule_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(backtestResults.backtest_token);", + }, + python: { + method: 'auth_rules.v2.backtests.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nbacktest_results = client.auth_rules.v2.backtests.retrieve(\n auth_rule_backtest_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(backtest_results.backtest_token)', + }, + java: { + method: 'authRules().v2().backtests().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthRuleV2BacktestRetrieveParams;\nimport com.lithic.api.models.BacktestResults;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthRuleV2BacktestRetrieveParams params = AuthRuleV2BacktestRetrieveParams.builder()\n .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .authRuleBacktestToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n BacktestResults backtestResults = client.authRules().v2().backtests().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'authRules().v2().backtests().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthRuleV2BacktestRetrieveParams\nimport com.lithic.api.models.BacktestResults\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: AuthRuleV2BacktestRetrieveParams = AuthRuleV2BacktestRetrieveParams.builder()\n .authRuleToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .authRuleBacktestToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val backtestResults: BacktestResults = client.authRules().v2().backtests().retrieve(params)\n}', + }, + go: { + method: 'client.AuthRules.V2.Backtests.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tbacktestResults, err := client.AuthRules.V2.Backtests.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", backtestResults.BacktestToken)\n}\n', + }, + ruby: { + method: 'auth_rules.v2.backtests.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nbacktest_results = lithic.auth_rules.v2.backtests.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n auth_rule_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(backtest_results)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/auth_rules/$AUTH_RULE_TOKEN/backtests/$AUTH_RULE_BACKTEST_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/transaction_monitoring/cases', + httpMethod: 'get', + summary: 'List cases', + description: 'Lists transaction monitoring cases, optionally filtered.', + stainlessPath: '(resource) transaction_monitoring.cases > (method) list', + qualified: 'client.transactionMonitoring.cases.list', + params: [ + 'account_token?: string;', + 'assignee?: string;', + 'begin?: string;', + 'card_token?: string;', + 'end?: string;', + 'ending_before?: string;', + 'entity_token?: string;', + 'page_size?: number;', + 'queue_token?: string;', + 'rule_token?: string;', + "sort_by?: 'CREATED_ASC' | 'CREATED_DESC' | 'PRIORITY_DESC' | 'PRIORITY_ASC' | 'STATUS_DESC' | 'STATUS_ASC';", + 'starting_after?: string;', + "status?: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED';", + 'transaction_token?: string;', + ], + response: + "{ token: string; assignee: string; collection_stopped: string; created: string; entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }; pending_transactions: boolean; priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; tags: object; title: string; updated: string; }", + markdown: + "## list\n\n`client.transactionMonitoring.cases.list(account_token?: string, assignee?: string, begin?: string, card_token?: string, end?: string, ending_before?: string, entity_token?: string, page_size?: number, queue_token?: string, rule_token?: string, sort_by?: 'CREATED_ASC' | 'CREATED_DESC' | 'PRIORITY_DESC' | 'PRIORITY_ASC' | 'STATUS_DESC' | 'STATUS_ASC', starting_after?: string, status?: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED', transaction_token?: string): { token: string; assignee: string; collection_stopped: string; created: string; entity: case_entity; pending_transactions: boolean; priority: case_priority; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: case_status; tags: object; title: string; updated: string; }`\n\n**get** `/v1/transaction_monitoring/cases`\n\nLists transaction monitoring cases, optionally filtered.\n\n### Parameters\n\n- `account_token?: string`\n Only return cases that include transactions on the provided account.\n\n- `assignee?: string`\n Only return cases assigned to the provided value. Pass an empty string to return only unassigned cases.\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `card_token?: string`\n Only return cases that include transactions on the provided card.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `entity_token?: string`\n Only return cases associated with the provided entity.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `queue_token?: string`\n Only return cases belonging to the provided queue.\n\n- `rule_token?: string`\n Only return cases triggered by the provided transaction monitoring rule.\n\n- `sort_by?: 'CREATED_ASC' | 'CREATED_DESC' | 'PRIORITY_DESC' | 'PRIORITY_ASC' | 'STATUS_DESC' | 'STATUS_ASC'`\n Sort order for the returned cases.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'`\n Only return cases with the provided status.\n\n- `transaction_token?: string`\n Only return cases that include the provided transaction.\n\n### Returns\n\n- `{ token: string; assignee: string; collection_stopped: string; created: string; entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }; pending_transactions: boolean; priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; tags: object; title: string; updated: string; }`\n A transaction monitoring case\n\n - `token: string`\n - `assignee: string`\n - `collection_stopped: string`\n - `created: string`\n - `entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }`\n - `pending_transactions: boolean`\n - `priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'`\n - `queue_token: string`\n - `resolution: string`\n - `resolution_notes: string`\n - `resolved: string`\n - `rule_token: string`\n - `sla_deadline: string`\n - `status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'`\n - `tags: object`\n - `title: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const monitoringCase of client.transactionMonitoring.cases.list()) {\n console.log(monitoringCase);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const monitoringCase of client.transactionMonitoring.cases.list()) {\n console.log(monitoringCase.token);\n}", + }, + python: { + method: 'transaction_monitoring.cases.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transaction_monitoring.cases.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'transactionMonitoring().cases().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringCaseListPage;\nimport com.lithic.api.models.TransactionMonitoringCaseListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseListPage page = client.transactionMonitoring().cases().list();\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringCaseListPage\nimport com.lithic.api.models.TransactionMonitoringCaseListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransactionMonitoringCaseListPage = client.transactionMonitoring().cases().list()\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.TransactionMonitoring.Cases.List(context.TODO(), lithic.TransactionMonitoringCaseListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transaction_monitoring.cases.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/transaction_monitoring/cases/{case_token}', + httpMethod: 'get', + summary: 'Get case', + description: 'Retrieves a single transaction monitoring case.', + stainlessPath: '(resource) transaction_monitoring.cases > (method) retrieve', + qualified: 'client.transactionMonitoring.cases.retrieve', + params: ['case_token: string;'], + response: + "{ token: string; assignee: string; collection_stopped: string; created: string; entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }; pending_transactions: boolean; priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; tags: object; title: string; updated: string; }", + markdown: + "## retrieve\n\n`client.transactionMonitoring.cases.retrieve(case_token: string): { token: string; assignee: string; collection_stopped: string; created: string; entity: case_entity; pending_transactions: boolean; priority: case_priority; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: case_status; tags: object; title: string; updated: string; }`\n\n**get** `/v1/transaction_monitoring/cases/{case_token}`\n\nRetrieves a single transaction monitoring case.\n\n### Parameters\n\n- `case_token: string`\n\n### Returns\n\n- `{ token: string; assignee: string; collection_stopped: string; created: string; entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }; pending_transactions: boolean; priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; tags: object; title: string; updated: string; }`\n A transaction monitoring case\n\n - `token: string`\n - `assignee: string`\n - `collection_stopped: string`\n - `created: string`\n - `entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }`\n - `pending_transactions: boolean`\n - `priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'`\n - `queue_token: string`\n - `resolution: string`\n - `resolution_notes: string`\n - `resolved: string`\n - `rule_token: string`\n - `sla_deadline: string`\n - `status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'`\n - `tags: object`\n - `title: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst monitoringCase = await client.transactionMonitoring.cases.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(monitoringCase);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitoringCase = await client.transactionMonitoring.cases.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(monitoringCase.token);", + }, + python: { + method: 'transaction_monitoring.cases.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nmonitoring_case = client.transaction_monitoring.cases.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(monitoring_case.token)', + }, + java: { + method: 'transactionMonitoring().cases().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.MonitoringCase;\nimport com.lithic.api.models.TransactionMonitoringCaseRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n MonitoringCase monitoringCase = client.transactionMonitoring().cases().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.MonitoringCase\nimport com.lithic.api.models.TransactionMonitoringCaseRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val monitoringCase: MonitoringCase = client.transactionMonitoring().cases().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tmonitoringCase, err := client.TransactionMonitoring.Cases.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitoringCase.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nmonitoring_case = lithic.transaction_monitoring.cases.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(monitoring_case)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/transaction_monitoring/cases/{case_token}', + httpMethod: 'patch', + summary: 'Update case', + description: 'Updates a transaction monitoring case.', + stainlessPath: '(resource) transaction_monitoring.cases > (method) update', + qualified: 'client.transactionMonitoring.cases.update', + params: [ + 'case_token: string;', + 'actor_token?: string;', + 'assignee?: string;', + "priority?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';", + 'resolution?: string;', + 'resolution_notes?: string;', + 'sla_deadline?: string;', + "status?: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED';", + 'tags?: object;', + 'title?: string;', + ], + response: + "{ token: string; assignee: string; collection_stopped: string; created: string; entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }; pending_transactions: boolean; priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; tags: object; title: string; updated: string; }", + markdown: + "## update\n\n`client.transactionMonitoring.cases.update(case_token: string, actor_token?: string, assignee?: string, priority?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL', resolution?: string, resolution_notes?: string, sla_deadline?: string, status?: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED', tags?: object, title?: string): { token: string; assignee: string; collection_stopped: string; created: string; entity: case_entity; pending_transactions: boolean; priority: case_priority; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: case_status; tags: object; title: string; updated: string; }`\n\n**patch** `/v1/transaction_monitoring/cases/{case_token}`\n\nUpdates a transaction monitoring case.\n\n### Parameters\n\n- `case_token: string`\n\n- `actor_token?: string`\n Optional client-provided identifier for the actor performing this action,\nrecorded on the resulting activity entry. This value is supplied by the\nclient (for example, your own internal user ID) and is not authenticated\nby Lithic\n\n\n- `assignee?: string`\n New assignee for the case, or `null` to unassign\n\n- `priority?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'`\n Priority level of a case, controlling queue ordering and SLA urgency\n\n- `resolution?: string`\n Resolution to record on the case. Must be one of the\n`allowed_resolutions` configured on the case's queue, otherwise the request is\nrejected with a `400`\n\n- `resolution_notes?: string`\n Notes describing the resolution\n\n- `sla_deadline?: string`\n New SLA deadline for the case, or `null` to clear it\n\n- `status?: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'`\n Status of a case as it progresses through the review workflow:\n - `OPEN` - The case has been created and is still collecting matching transactions\n - `ASSIGNED` - An analyst has been assigned and transaction collection has stopped\n - `IN_REVIEW` - The case is actively being investigated\n - `ESCALATED` - The case has been reviewed and requires additional oversight\n - `RESOLVED` - A determination has been made and a resolution recorded\n - `CLOSED` - The case is finalized\n\n\n- `tags?: object`\n Arbitrary key-value metadata to set on the case\n\n- `title?: string`\n New title for the case, or `null` to clear it\n\n### Returns\n\n- `{ token: string; assignee: string; collection_stopped: string; created: string; entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }; pending_transactions: boolean; priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; queue_token: string; resolution: string; resolution_notes: string; resolved: string; rule_token: string; sla_deadline: string; status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; tags: object; title: string; updated: string; }`\n A transaction monitoring case\n\n - `token: string`\n - `assignee: string`\n - `collection_stopped: string`\n - `created: string`\n - `entity: { entity_token: string; entity_type: 'CARD' | 'ACCOUNT'; }`\n - `pending_transactions: boolean`\n - `priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'`\n - `queue_token: string`\n - `resolution: string`\n - `resolution_notes: string`\n - `resolved: string`\n - `rule_token: string`\n - `sla_deadline: string`\n - `status: 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'`\n - `tags: object`\n - `title: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst monitoringCase = await client.transactionMonitoring.cases.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(monitoringCase);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitoringCase = await client.transactionMonitoring.cases.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(monitoringCase.token);", + }, + python: { + method: 'transaction_monitoring.cases.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nmonitoring_case = client.transaction_monitoring.cases.update(\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(monitoring_case.token)', + }, + java: { + method: 'transactionMonitoring().cases().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.MonitoringCase;\nimport com.lithic.api.models.TransactionMonitoringCaseUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n MonitoringCase monitoringCase = client.transactionMonitoring().cases().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.MonitoringCase\nimport com.lithic.api.models.TransactionMonitoringCaseUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val monitoringCase: MonitoringCase = client.transactionMonitoring().cases().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tmonitoringCase, err := client.TransactionMonitoring.Cases.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitoringCase.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nmonitoring_case = lithic.transaction_monitoring.cases.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(monitoring_case)', + }, + http: { + example: + "curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'list_activity', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/activity', + httpMethod: 'get', + summary: 'List case activity', + description: 'Lists the activity feed for a case.', + stainlessPath: '(resource) transaction_monitoring.cases > (method) list_activity', + qualified: 'client.transactionMonitoring.cases.listActivity', + params: [ + 'case_token: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + '{ token: string; actor_token: string; created: string; entry_type: string; new_value: string; previous_value: string; }', + markdown: + "## list_activity\n\n`client.transactionMonitoring.cases.listActivity(case_token: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; actor_token: string; created: string; entry_type: case_activity_type; new_value: string; previous_value: string; }`\n\n**get** `/v1/transaction_monitoring/cases/{case_token}/activity`\n\nLists the activity feed for a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; actor_token: string; created: string; entry_type: string; new_value: string; previous_value: string; }`\n A single entry in a case's activity feed\n\n - `token: string`\n - `actor_token: string`\n - `created: string`\n - `entry_type: string`\n - `new_value: string`\n - `previous_value: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const caseActivityEntry of client.transactionMonitoring.cases.listActivity('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(caseActivityEntry);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.listActivity', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const caseActivityEntry of client.transactionMonitoring.cases.listActivity(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(caseActivityEntry.token);\n}", + }, + python: { + method: 'transaction_monitoring.cases.list_activity', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transaction_monitoring.cases.list_activity(\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'transactionMonitoring().cases().listActivity', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringCaseListActivityPage;\nimport com.lithic.api.models.TransactionMonitoringCaseListActivityParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseListActivityPage page = client.transactionMonitoring().cases().listActivity("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().listActivity', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringCaseListActivityPage\nimport com.lithic.api.models.TransactionMonitoringCaseListActivityParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransactionMonitoringCaseListActivityPage = client.transactionMonitoring().cases().listActivity("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.ListActivity', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.TransactionMonitoring.Cases.ListActivity(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseListActivityParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.list_activity', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transaction_monitoring.cases.list_activity("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/activity \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list_transactions', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/transactions', + httpMethod: 'get', + summary: 'List case transactions', + description: 'Lists the transactions associated with a case.', + stainlessPath: '(resource) transaction_monitoring.cases > (method) list_transactions', + qualified: 'client.transactionMonitoring.cases.listTransactions', + params: [ + 'case_token: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; account_token: string; added_at: string; card_token: string; category: 'CARD'; transaction_created_at: string; } | { token: string; added_at: string; category: 'PAYMENT'; financial_account_token: string; transaction_created_at: string; account_token?: string; }", + markdown: + "## list_transactions\n\n`client.transactionMonitoring.cases.listTransactions(case_token: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; account_token: string; added_at: string; card_token: string; category: 'CARD'; transaction_created_at: string; } | { token: string; added_at: string; category: 'PAYMENT'; financial_account_token: string; transaction_created_at: string; account_token?: string; }`\n\n**get** `/v1/transaction_monitoring/cases/{case_token}/transactions`\n\nLists the transactions associated with a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_token: string; added_at: string; card_token: string; category: 'CARD'; transaction_created_at: string; } | { token: string; added_at: string; category: 'PAYMENT'; financial_account_token: string; transaction_created_at: string; account_token?: string; }`\n A single transaction associated with a case. The `category` field identifies whether this is a\ncard transaction or a payment transaction.\n\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const caseTransaction of client.transactionMonitoring.cases.listTransactions('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(caseTransaction);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.listTransactions', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const caseTransaction of client.transactionMonitoring.cases.listTransactions(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(caseTransaction);\n}", + }, + python: { + method: 'transaction_monitoring.cases.list_transactions', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transaction_monitoring.cases.list_transactions(\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page)', + }, + java: { + method: 'transactionMonitoring().cases().listTransactions', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringCaseListTransactionsPage;\nimport com.lithic.api.models.TransactionMonitoringCaseListTransactionsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseListTransactionsPage page = client.transactionMonitoring().cases().listTransactions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().listTransactions', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringCaseListTransactionsPage\nimport com.lithic.api.models.TransactionMonitoringCaseListTransactionsParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransactionMonitoringCaseListTransactionsPage = client.transactionMonitoring().cases().listTransactions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.ListTransactions', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.TransactionMonitoring.Cases.ListTransactions(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseListTransactionsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.list_transactions', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transaction_monitoring.cases.list_transactions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/transactions \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_cards', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/cards', + httpMethod: 'get', + summary: 'List case cards', + description: 'Lists the cards involved in a case, with per-card transaction counts.', + stainlessPath: '(resource) transaction_monitoring.cases > (method) retrieve_cards', + qualified: 'client.transactionMonitoring.cases.retrieveCards', + params: ['case_token: string;'], + response: '{ account_token: string; card_token: string; transaction_count: number; }[]', + markdown: + "## retrieve_cards\n\n`client.transactionMonitoring.cases.retrieveCards(case_token: string): object[]`\n\n**get** `/v1/transaction_monitoring/cases/{case_token}/cards`\n\nLists the cards involved in a case, with per-card transaction counts.\n\n### Parameters\n\n- `case_token: string`\n\n### Returns\n\n- `{ account_token: string; card_token: string; transaction_count: number; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst caseCards = await client.transactionMonitoring.cases.retrieveCards('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(caseCards);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.retrieveCards', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst caseCards = await client.transactionMonitoring.cases.retrieveCards(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(caseCards);", + }, + python: { + method: 'transaction_monitoring.cases.retrieve_cards', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncase_cards = client.transaction_monitoring.cases.retrieve_cards(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(case_cards)', + }, + java: { + method: 'transactionMonitoring().cases().retrieveCards', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CaseCard;\nimport com.lithic.api.models.TransactionMonitoringCaseRetrieveCardsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n List caseCards = client.transactionMonitoring().cases().retrieveCards("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().retrieveCards', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CaseCard\nimport com.lithic.api.models.TransactionMonitoringCaseRetrieveCardsParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val caseCards: List = client.transactionMonitoring().cases().retrieveCards("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.GetCards', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcaseCards, err := client.TransactionMonitoring.Cases.GetCards(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", caseCards)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.retrieve_cards', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncase_cards = lithic.transaction_monitoring.cases.retrieve_cards("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(case_cards)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/cards \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/comments', + httpMethod: 'post', + summary: 'Add case comment', + description: 'Adds a comment to a case.', + stainlessPath: '(resource) transaction_monitoring.cases.comments > (method) create', + qualified: 'client.transactionMonitoring.cases.comments.create', + params: ['case_token: string;', 'comment: string;', 'actor_token?: string;'], + response: + '{ token: string; actor_token: string; created: string; entry_type: string; new_value: string; previous_value: string; }', + markdown: + "## create\n\n`client.transactionMonitoring.cases.comments.create(case_token: string, comment: string, actor_token?: string): { token: string; actor_token: string; created: string; entry_type: case_activity_type; new_value: string; previous_value: string; }`\n\n**post** `/v1/transaction_monitoring/cases/{case_token}/comments`\n\nAdds a comment to a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `comment: string`\n Text of the comment\n\n- `actor_token?: string`\n Optional client-provided identifier for the actor performing this action,\nrecorded on the resulting activity entry. This value is supplied by the\nclient (for example, your own internal user ID) and is not authenticated\nby Lithic\n\n\n### Returns\n\n- `{ token: string; actor_token: string; created: string; entry_type: string; new_value: string; previous_value: string; }`\n A single entry in a case's activity feed\n\n - `token: string`\n - `actor_token: string`\n - `created: string`\n - `entry_type: string`\n - `new_value: string`\n - `previous_value: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst caseActivityEntry = await client.transactionMonitoring.cases.comments.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { comment: 'comment' });\n\nconsole.log(caseActivityEntry);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.comments.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst caseActivityEntry = await client.transactionMonitoring.cases.comments.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { comment: 'comment' },\n);\n\nconsole.log(caseActivityEntry.token);", + }, + python: { + method: 'transaction_monitoring.cases.comments.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncase_activity_entry = client.transaction_monitoring.cases.comments.create(\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n comment="comment",\n)\nprint(case_activity_entry.token)', + }, + java: { + method: 'transactionMonitoring().cases().comments().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CaseActivityEntry;\nimport com.lithic.api.models.TransactionMonitoringCaseCommentCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseCommentCreateParams params = TransactionMonitoringCaseCommentCreateParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .comment("comment")\n .build();\n CaseActivityEntry caseActivityEntry = client.transactionMonitoring().cases().comments().create(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().comments().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CaseActivityEntry\nimport com.lithic.api.models.TransactionMonitoringCaseCommentCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringCaseCommentCreateParams = TransactionMonitoringCaseCommentCreateParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .comment("comment")\n .build()\n val caseActivityEntry: CaseActivityEntry = client.transactionMonitoring().cases().comments().create(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Comments.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcaseActivityEntry, err := client.TransactionMonitoring.Cases.Comments.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseCommentNewParams{\n\t\t\tComment: lithic.F("comment"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", caseActivityEntry.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.comments.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncase_activity_entry = lithic.transaction_monitoring.cases.comments.create(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n comment: "comment"\n)\n\nputs(case_activity_entry)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/comments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "comment": "comment"\n }\'', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/comments/{comment_token}', + httpMethod: 'patch', + summary: 'Update case comment', + description: 'Edits an existing comment on a case.', + stainlessPath: '(resource) transaction_monitoring.cases.comments > (method) update', + qualified: 'client.transactionMonitoring.cases.comments.update', + params: ['case_token: string;', 'comment_token: string;', 'comment: string;', 'actor_token?: string;'], + response: + '{ token: string; actor_token: string; created: string; entry_type: string; new_value: string; previous_value: string; }', + markdown: + "## update\n\n`client.transactionMonitoring.cases.comments.update(case_token: string, comment_token: string, comment: string, actor_token?: string): { token: string; actor_token: string; created: string; entry_type: case_activity_type; new_value: string; previous_value: string; }`\n\n**patch** `/v1/transaction_monitoring/cases/{case_token}/comments/{comment_token}`\n\nEdits an existing comment on a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `comment_token: string`\n\n- `comment: string`\n New text of the comment\n\n- `actor_token?: string`\n Optional client-provided identifier for the actor performing this action,\nrecorded on the resulting activity entry. This value is supplied by the\nclient (for example, your own internal user ID) and is not authenticated\nby Lithic\n\n\n### Returns\n\n- `{ token: string; actor_token: string; created: string; entry_type: string; new_value: string; previous_value: string; }`\n A single entry in a case's activity feed\n\n - `token: string`\n - `actor_token: string`\n - `created: string`\n - `entry_type: string`\n - `new_value: string`\n - `previous_value: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst caseActivityEntry = await client.transactionMonitoring.cases.comments.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', comment: 'comment' });\n\nconsole.log(caseActivityEntry);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.comments.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst caseActivityEntry = await client.transactionMonitoring.cases.comments.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', comment: 'comment' },\n);\n\nconsole.log(caseActivityEntry.token);", + }, + python: { + method: 'transaction_monitoring.cases.comments.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncase_activity_entry = client.transaction_monitoring.cases.comments.update(\n comment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n comment="comment",\n)\nprint(case_activity_entry.token)', + }, + java: { + method: 'transactionMonitoring().cases().comments().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CaseActivityEntry;\nimport com.lithic.api.models.TransactionMonitoringCaseCommentUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseCommentUpdateParams params = TransactionMonitoringCaseCommentUpdateParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .commentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .comment("comment")\n .build();\n CaseActivityEntry caseActivityEntry = client.transactionMonitoring().cases().comments().update(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().comments().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CaseActivityEntry\nimport com.lithic.api.models.TransactionMonitoringCaseCommentUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringCaseCommentUpdateParams = TransactionMonitoringCaseCommentUpdateParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .commentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .comment("comment")\n .build()\n val caseActivityEntry: CaseActivityEntry = client.transactionMonitoring().cases().comments().update(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Comments.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcaseActivityEntry, err := client.TransactionMonitoring.Cases.Comments.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseCommentUpdateParams{\n\t\t\tComment: lithic.F("comment"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", caseActivityEntry.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.comments.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncase_activity_entry = lithic.transaction_monitoring.cases.comments.update(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n comment: "comment"\n)\n\nputs(case_activity_entry)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/comments/$COMMENT_TOKEN \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "comment": "comment"\n }\'', + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/comments/{comment_token}', + httpMethod: 'delete', + summary: 'Delete case comment', + description: 'Deletes a comment from a case.', + stainlessPath: '(resource) transaction_monitoring.cases.comments > (method) delete', + qualified: 'client.transactionMonitoring.cases.comments.delete', + params: ['case_token: string;', 'comment_token: string;'], + markdown: + "## delete\n\n`client.transactionMonitoring.cases.comments.delete(case_token: string, comment_token: string): void`\n\n**delete** `/v1/transaction_monitoring/cases/{case_token}/comments/{comment_token}`\n\nDeletes a comment from a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `comment_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.transactionMonitoring.cases.comments.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' })\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.comments.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.transactionMonitoring.cases.comments.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});", + }, + python: { + method: 'transaction_monitoring.cases.comments.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.transaction_monitoring.cases.comments.delete(\n comment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'transactionMonitoring().cases().comments().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringCaseCommentDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseCommentDeleteParams params = TransactionMonitoringCaseCommentDeleteParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .commentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n client.transactionMonitoring().cases().comments().delete(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().comments().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringCaseCommentDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringCaseCommentDeleteParams = TransactionMonitoringCaseCommentDeleteParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .commentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n client.transactionMonitoring().cases().comments().delete(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Comments.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.TransactionMonitoring.Cases.Comments.Delete(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.comments.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.transaction_monitoring.cases.comments.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/comments/$COMMENT_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/files', + httpMethod: 'post', + summary: 'Create case file', + description: 'Creates a file record and returns a presigned URL for uploading the file to the case.', + stainlessPath: '(resource) transaction_monitoring.cases.files > (method) create', + qualified: 'client.transactionMonitoring.cases.files.create', + params: ['case_token: string;', 'name: string;'], + response: + "{ token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: 'PENDING' | 'READY' | 'REJECTED'; updated: string; upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }; upload_url: string; upload_url_expires: string; }", + markdown: + "## create\n\n`client.transactionMonitoring.cases.files.create(case_token: string, name: string): { token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: file_status; updated: string; upload_constraints: upload_constraints; upload_url: string; upload_url_expires: string; }`\n\n**post** `/v1/transaction_monitoring/cases/{case_token}/files`\n\nCreates a file record and returns a presigned URL for uploading the file to the case.\n\n### Parameters\n\n- `case_token: string`\n\n- `name: string`\n Name of the file to upload\n\n### Returns\n\n- `{ token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: 'PENDING' | 'READY' | 'REJECTED'; updated: string; upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }; upload_url: string; upload_url_expires: string; }`\n A file attached to a case. Status-dependent fields are always present but may be `null`:\n - `upload_url`, `upload_url_expires`, and `upload_constraints` are populated when `status` is `PENDING` or `REJECTED`\n - `download_url` and `download_url_expires` are populated when `status` is `READY`\n - `failure_reason` is populated when `status` is `REJECTED`\n\n\n - `token: string`\n - `created: string`\n - `download_url: string`\n - `download_url_expires: string`\n - `failure_reason: string`\n - `mime_type: string`\n - `name: string`\n - `size_bytes: number`\n - `status: 'PENDING' | 'READY' | 'REJECTED'`\n - `updated: string`\n - `upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }`\n - `upload_url: string`\n - `upload_url_expires: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst caseFile = await client.transactionMonitoring.cases.files.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { name: 'name' });\n\nconsole.log(caseFile);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.files.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst caseFile = await client.transactionMonitoring.cases.files.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { name: 'name' },\n);\n\nconsole.log(caseFile.token);", + }, + python: { + method: 'transaction_monitoring.cases.files.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncase_file = client.transaction_monitoring.cases.files.create(\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n name="name",\n)\nprint(case_file.token)', + }, + java: { + method: 'transactionMonitoring().cases().files().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CaseFile;\nimport com.lithic.api.models.TransactionMonitoringCaseFileCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseFileCreateParams params = TransactionMonitoringCaseFileCreateParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .name("name")\n .build();\n CaseFile caseFile = client.transactionMonitoring().cases().files().create(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().files().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CaseFile\nimport com.lithic.api.models.TransactionMonitoringCaseFileCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringCaseFileCreateParams = TransactionMonitoringCaseFileCreateParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .name("name")\n .build()\n val caseFile: CaseFile = client.transactionMonitoring().cases().files().create(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Files.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcaseFile, err := client.TransactionMonitoring.Cases.Files.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseFileNewParams{\n\t\t\tName: lithic.F("name"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", caseFile.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.files.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncase_file = lithic.transaction_monitoring.cases.files.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name: "name")\n\nputs(case_file)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/files \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "name": "name"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/files', + httpMethod: 'get', + summary: 'List case files', + description: 'Lists the files attached to a case.', + stainlessPath: '(resource) transaction_monitoring.cases.files > (method) list', + qualified: 'client.transactionMonitoring.cases.files.list', + params: [ + 'case_token: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: 'PENDING' | 'READY' | 'REJECTED'; updated: string; upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }; upload_url: string; upload_url_expires: string; }", + markdown: + "## list\n\n`client.transactionMonitoring.cases.files.list(case_token: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: file_status; updated: string; upload_constraints: upload_constraints; upload_url: string; upload_url_expires: string; }`\n\n**get** `/v1/transaction_monitoring/cases/{case_token}/files`\n\nLists the files attached to a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: 'PENDING' | 'READY' | 'REJECTED'; updated: string; upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }; upload_url: string; upload_url_expires: string; }`\n A file attached to a case. Status-dependent fields are always present but may be `null`:\n - `upload_url`, `upload_url_expires`, and `upload_constraints` are populated when `status` is `PENDING` or `REJECTED`\n - `download_url` and `download_url_expires` are populated when `status` is `READY`\n - `failure_reason` is populated when `status` is `REJECTED`\n\n\n - `token: string`\n - `created: string`\n - `download_url: string`\n - `download_url_expires: string`\n - `failure_reason: string`\n - `mime_type: string`\n - `name: string`\n - `size_bytes: number`\n - `status: 'PENDING' | 'READY' | 'REJECTED'`\n - `updated: string`\n - `upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }`\n - `upload_url: string`\n - `upload_url_expires: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const caseFile of client.transactionMonitoring.cases.files.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(caseFile);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.files.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const caseFile of client.transactionMonitoring.cases.files.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(caseFile.token);\n}", + }, + python: { + method: 'transaction_monitoring.cases.files.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transaction_monitoring.cases.files.list(\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'transactionMonitoring().cases().files().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringCaseFileListPage;\nimport com.lithic.api.models.TransactionMonitoringCaseFileListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseFileListPage page = client.transactionMonitoring().cases().files().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().files().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringCaseFileListPage\nimport com.lithic.api.models.TransactionMonitoringCaseFileListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransactionMonitoringCaseFileListPage = client.transactionMonitoring().cases().files().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Files.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.TransactionMonitoring.Cases.Files.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringCaseFileListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.files.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transaction_monitoring.cases.files.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/files \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/files/{file_token}', + httpMethod: 'get', + summary: 'Get case file', + description: + 'Retrieves a single file attached to a case, including a presigned download URL when the file is ready.', + stainlessPath: '(resource) transaction_monitoring.cases.files > (method) retrieve', + qualified: 'client.transactionMonitoring.cases.files.retrieve', + params: ['case_token: string;', 'file_token: string;'], + response: + "{ token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: 'PENDING' | 'READY' | 'REJECTED'; updated: string; upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }; upload_url: string; upload_url_expires: string; }", + markdown: + "## retrieve\n\n`client.transactionMonitoring.cases.files.retrieve(case_token: string, file_token: string): { token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: file_status; updated: string; upload_constraints: upload_constraints; upload_url: string; upload_url_expires: string; }`\n\n**get** `/v1/transaction_monitoring/cases/{case_token}/files/{file_token}`\n\nRetrieves a single file attached to a case, including a presigned download URL when the file is ready.\n\n### Parameters\n\n- `case_token: string`\n\n- `file_token: string`\n\n### Returns\n\n- `{ token: string; created: string; download_url: string; download_url_expires: string; failure_reason: string; mime_type: string; name: string; size_bytes: number; status: 'PENDING' | 'READY' | 'REJECTED'; updated: string; upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }; upload_url: string; upload_url_expires: string; }`\n A file attached to a case. Status-dependent fields are always present but may be `null`:\n - `upload_url`, `upload_url_expires`, and `upload_constraints` are populated when `status` is `PENDING` or `REJECTED`\n - `download_url` and `download_url_expires` are populated when `status` is `READY`\n - `failure_reason` is populated when `status` is `REJECTED`\n\n\n - `token: string`\n - `created: string`\n - `download_url: string`\n - `download_url_expires: string`\n - `failure_reason: string`\n - `mime_type: string`\n - `name: string`\n - `size_bytes: number`\n - `status: 'PENDING' | 'READY' | 'REJECTED'`\n - `updated: string`\n - `upload_constraints: { accepted_mime_types: string[]; max_size_bytes: number; }`\n - `upload_url: string`\n - `upload_url_expires: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst caseFile = await client.transactionMonitoring.cases.files.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(caseFile);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.files.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst caseFile = await client.transactionMonitoring.cases.files.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(caseFile.token);", + }, + python: { + method: 'transaction_monitoring.cases.files.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncase_file = client.transaction_monitoring.cases.files.retrieve(\n file_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(case_file.token)', + }, + java: { + method: 'transactionMonitoring().cases().files().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CaseFile;\nimport com.lithic.api.models.TransactionMonitoringCaseFileRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseFileRetrieveParams params = TransactionMonitoringCaseFileRetrieveParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .fileToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n CaseFile caseFile = client.transactionMonitoring().cases().files().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().files().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CaseFile\nimport com.lithic.api.models.TransactionMonitoringCaseFileRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringCaseFileRetrieveParams = TransactionMonitoringCaseFileRetrieveParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .fileToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val caseFile: CaseFile = client.transactionMonitoring().cases().files().retrieve(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Files.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcaseFile, err := client.TransactionMonitoring.Cases.Files.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", caseFile.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.files.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncase_file = lithic.transaction_monitoring.cases.files.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(case_file)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/files/$FILE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/transaction_monitoring/cases/{case_token}/files/{file_token}', + httpMethod: 'delete', + summary: 'Delete case file', + description: 'Deletes a file from a case.', + stainlessPath: '(resource) transaction_monitoring.cases.files > (method) delete', + qualified: 'client.transactionMonitoring.cases.files.delete', + params: ['case_token: string;', 'file_token: string;'], + markdown: + "## delete\n\n`client.transactionMonitoring.cases.files.delete(case_token: string, file_token: string): void`\n\n**delete** `/v1/transaction_monitoring/cases/{case_token}/files/{file_token}`\n\nDeletes a file from a case.\n\n### Parameters\n\n- `case_token: string`\n\n- `file_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.transactionMonitoring.cases.files.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' })\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.cases.files.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.transactionMonitoring.cases.files.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});", + }, + python: { + method: 'transaction_monitoring.cases.files.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.transaction_monitoring.cases.files.delete(\n file_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'transactionMonitoring().cases().files().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringCaseFileDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringCaseFileDeleteParams params = TransactionMonitoringCaseFileDeleteParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .fileToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n client.transactionMonitoring().cases().files().delete(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().cases().files().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringCaseFileDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringCaseFileDeleteParams = TransactionMonitoringCaseFileDeleteParams.builder()\n .caseToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .fileToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n client.transactionMonitoring().cases().files().delete(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Cases.Files.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.TransactionMonitoring.Cases.Files.Delete(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'transaction_monitoring.cases.files.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.transaction_monitoring.cases.files.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/cases/$CASE_TOKEN/files/$FILE_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/transaction_monitoring/queues', + httpMethod: 'post', + summary: 'Create queue', + description: 'Creates a new queue for grouping transaction monitoring cases.', + stainlessPath: '(resource) transaction_monitoring.queues > (method) create', + qualified: 'client.transactionMonitoring.queues.create', + params: ['name: string;', 'allowed_resolutions?: string[];', 'description?: string;'], + response: + '{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }', + markdown: + "## create\n\n`client.transactionMonitoring.queues.create(name: string, allowed_resolutions?: string[], description?: string): { token: string; allowed_resolutions: string[]; case_counts: object; created: string; description: string; name: string; updated: string; }`\n\n**post** `/v1/transaction_monitoring/queues`\n\nCreates a new queue for grouping transaction monitoring cases.\n\n### Parameters\n\n- `name: string`\n Human-readable name of the queue\n\n- `allowed_resolutions?: string[]`\n Resolutions that can be recorded on cases in this queue. Omit or send `null` to\nuse the default list. Values are free-form labels and must be non-empty and unique\n\n- `description?: string`\n Optional description of the queue\n\n### Returns\n\n- `{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }`\n A queue that groups transaction monitoring cases for review\n\n - `token: string`\n - `allowed_resolutions: string[]`\n - `case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }`\n - `created: string`\n - `description: string`\n - `name: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst queue = await client.transactionMonitoring.queues.create({ name: 'name' });\n\nconsole.log(queue);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.queues.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst queue = await client.transactionMonitoring.queues.create({ name: 'name' });\n\nconsole.log(queue.token);", + }, + python: { + method: 'transaction_monitoring.queues.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nqueue = client.transaction_monitoring.queues.create(\n name="name",\n)\nprint(queue.token)', + }, + java: { + method: 'transactionMonitoring().queues().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Queue;\nimport com.lithic.api.models.TransactionMonitoringQueueCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringQueueCreateParams params = TransactionMonitoringQueueCreateParams.builder()\n .name("name")\n .build();\n Queue queue = client.transactionMonitoring().queues().create(params);\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().queues().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Queue\nimport com.lithic.api.models.TransactionMonitoringQueueCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionMonitoringQueueCreateParams = TransactionMonitoringQueueCreateParams.builder()\n .name("name")\n .build()\n val queue: Queue = client.transactionMonitoring().queues().create(params)\n}', + }, + go: { + method: 'client.TransactionMonitoring.Queues.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tqueue, err := client.TransactionMonitoring.Queues.New(context.TODO(), lithic.TransactionMonitoringQueueNewParams{\n\t\tName: lithic.F("name"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queue.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.queues.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nqueue = lithic.transaction_monitoring.queues.create(name: "name")\n\nputs(queue)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/queues \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "name": "name"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/transaction_monitoring/queues', + httpMethod: 'get', + summary: 'List queues', + description: 'Lists transaction monitoring queues.', + stainlessPath: '(resource) transaction_monitoring.queues > (method) list', + qualified: 'client.transactionMonitoring.queues.list', + params: ['ending_before?: string;', 'page_size?: number;', 'starting_after?: string;'], + response: + '{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }', + markdown: + "## list\n\n`client.transactionMonitoring.queues.list(ending_before?: string, page_size?: number, starting_after?: string): { token: string; allowed_resolutions: string[]; case_counts: object; created: string; description: string; name: string; updated: string; }`\n\n**get** `/v1/transaction_monitoring/queues`\n\nLists transaction monitoring queues.\n\n### Parameters\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }`\n A queue that groups transaction monitoring cases for review\n\n - `token: string`\n - `allowed_resolutions: string[]`\n - `case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }`\n - `created: string`\n - `description: string`\n - `name: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const queue of client.transactionMonitoring.queues.list()) {\n console.log(queue);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.queues.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const queue of client.transactionMonitoring.queues.list()) {\n console.log(queue.token);\n}", + }, + python: { + method: 'transaction_monitoring.queues.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transaction_monitoring.queues.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'transactionMonitoring().queues().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringQueueListPage;\nimport com.lithic.api.models.TransactionMonitoringQueueListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionMonitoringQueueListPage page = client.transactionMonitoring().queues().list();\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().queues().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringQueueListPage\nimport com.lithic.api.models.TransactionMonitoringQueueListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransactionMonitoringQueueListPage = client.transactionMonitoring().queues().list()\n}', + }, + go: { + method: 'client.TransactionMonitoring.Queues.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.TransactionMonitoring.Queues.List(context.TODO(), lithic.TransactionMonitoringQueueListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.queues.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transaction_monitoring.queues.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/queues \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/transaction_monitoring/queues/{queue_token}', + httpMethod: 'get', + summary: 'Get queue', + description: 'Retrieves a single transaction monitoring queue.', + stainlessPath: '(resource) transaction_monitoring.queues > (method) retrieve', + qualified: 'client.transactionMonitoring.queues.retrieve', + params: ['queue_token: string;'], + response: + '{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }', + markdown: + "## retrieve\n\n`client.transactionMonitoring.queues.retrieve(queue_token: string): { token: string; allowed_resolutions: string[]; case_counts: object; created: string; description: string; name: string; updated: string; }`\n\n**get** `/v1/transaction_monitoring/queues/{queue_token}`\n\nRetrieves a single transaction monitoring queue.\n\n### Parameters\n\n- `queue_token: string`\n\n### Returns\n\n- `{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }`\n A queue that groups transaction monitoring cases for review\n\n - `token: string`\n - `allowed_resolutions: string[]`\n - `case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }`\n - `created: string`\n - `description: string`\n - `name: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst queue = await client.transactionMonitoring.queues.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(queue);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.queues.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst queue = await client.transactionMonitoring.queues.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(queue.token);", + }, + python: { + method: 'transaction_monitoring.queues.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nqueue = client.transaction_monitoring.queues.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(queue.token)', + }, + java: { + method: 'transactionMonitoring().queues().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Queue;\nimport com.lithic.api.models.TransactionMonitoringQueueRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Queue queue = client.transactionMonitoring().queues().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().queues().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Queue\nimport com.lithic.api.models.TransactionMonitoringQueueRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val queue: Queue = client.transactionMonitoring().queues().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Queues.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tqueue, err := client.TransactionMonitoring.Queues.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queue.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.queues.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nqueue = lithic.transaction_monitoring.queues.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(queue)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/queues/$QUEUE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/transaction_monitoring/queues/{queue_token}', + httpMethod: 'patch', + summary: 'Update queue', + description: 'Updates a transaction monitoring queue.', + stainlessPath: '(resource) transaction_monitoring.queues > (method) update', + qualified: 'client.transactionMonitoring.queues.update', + params: [ + 'queue_token: string;', + 'allowed_resolutions?: string[];', + 'description?: string;', + 'name?: string;', + ], + response: + '{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }', + markdown: + "## update\n\n`client.transactionMonitoring.queues.update(queue_token: string, allowed_resolutions?: string[], description?: string, name?: string): { token: string; allowed_resolutions: string[]; case_counts: object; created: string; description: string; name: string; updated: string; }`\n\n**patch** `/v1/transaction_monitoring/queues/{queue_token}`\n\nUpdates a transaction monitoring queue.\n\n### Parameters\n\n- `queue_token: string`\n\n- `allowed_resolutions?: string[]`\n New list of resolutions that can be recorded on cases in this queue, or `null` to\nrevert to the default list. Values are free-form labels and must be non-empty and\nunique. Changing the list only affects what is selectable going forward; the\n`resolution` already stored on a case is preserved as-is\n\n- `description?: string`\n New description for the queue, or `null` to clear it\n\n- `name?: string`\n New name for the queue\n\n### Returns\n\n- `{ token: string; allowed_resolutions: string[]; case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }; created: string; description: string; name: string; updated: string; }`\n A queue that groups transaction monitoring cases for review\n\n - `token: string`\n - `allowed_resolutions: string[]`\n - `case_counts: { ASSIGNED?: number; CLOSED?: number; ESCALATED?: number; IN_REVIEW?: number; OPEN?: number; RESOLVED?: number; }`\n - `created: string`\n - `description: string`\n - `name: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst queue = await client.transactionMonitoring.queues.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(queue);\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.queues.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst queue = await client.transactionMonitoring.queues.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(queue.token);", + }, + python: { + method: 'transaction_monitoring.queues.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nqueue = client.transaction_monitoring.queues.update(\n queue_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(queue.token)', + }, + java: { + method: 'transactionMonitoring().queues().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Queue;\nimport com.lithic.api.models.TransactionMonitoringQueueUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Queue queue = client.transactionMonitoring().queues().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().queues().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Queue\nimport com.lithic.api.models.TransactionMonitoringQueueUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val queue: Queue = client.transactionMonitoring().queues().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Queues.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tqueue, err := client.TransactionMonitoring.Queues.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TransactionMonitoringQueueUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", queue.Token)\n}\n', + }, + ruby: { + method: 'transaction_monitoring.queues.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nqueue = lithic.transaction_monitoring.queues.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(queue)', + }, + http: { + example: + "curl https://api.lithic.com/v1/transaction_monitoring/queues/$QUEUE_TOKEN \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/transaction_monitoring/queues/{queue_token}', + httpMethod: 'delete', + summary: 'Delete queue', + description: 'Deletes a transaction monitoring queue.', + stainlessPath: '(resource) transaction_monitoring.queues > (method) delete', + qualified: 'client.transactionMonitoring.queues.delete', + params: ['queue_token: string;'], + markdown: + "## delete\n\n`client.transactionMonitoring.queues.delete(queue_token: string): void`\n\n**delete** `/v1/transaction_monitoring/queues/{queue_token}`\n\nDeletes a transaction monitoring queue.\n\n### Parameters\n\n- `queue_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.transactionMonitoring.queues.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.transactionMonitoring.queues.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.transactionMonitoring.queues.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');", + }, + python: { + method: 'transaction_monitoring.queues.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.transaction_monitoring.queues.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'transactionMonitoring().queues().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionMonitoringQueueDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.transactionMonitoring().queues().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactionMonitoring().queues().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionMonitoringQueueDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.transactionMonitoring().queues().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.TransactionMonitoring.Queues.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.TransactionMonitoring.Queues.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'transaction_monitoring.queues.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.transaction_monitoring.queues.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transaction_monitoring/queues/$QUEUE_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_secret', + endpoint: '/v1/auth_stream/secret', + httpMethod: 'get', + summary: 'Retrieve the ASA HMAC secret key', + description: + 'Retrieve the ASA HMAC secret key. If one does not exist for your program yet, calling this endpoint will create one for you. The headers (which you can use to verify webhooks) will begin appearing shortly after calling this endpoint for the first time. See [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) for more detail about verifying ASA webhooks.\n', + stainlessPath: '(resource) auth_stream_enrollment > (method) retrieve_secret', + qualified: 'client.authStreamEnrollment.retrieveSecret', + response: '{ secret?: string; }', + markdown: + "## retrieve_secret\n\n`client.authStreamEnrollment.retrieveSecret(): { secret?: string; }`\n\n**get** `/v1/auth_stream/secret`\n\nRetrieve the ASA HMAC secret key. If one does not exist for your program yet, calling this endpoint will create one for you. The headers (which you can use to verify webhooks) will begin appearing shortly after calling this endpoint for the first time. See [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) for more detail about verifying ASA webhooks.\n\n\n### Returns\n\n- `{ secret?: string; }`\n\n - `secret?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst authStreamSecret = await client.authStreamEnrollment.retrieveSecret();\n\nconsole.log(authStreamSecret);\n```", + perLanguage: { + typescript: { + method: 'client.authStreamEnrollment.retrieveSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst authStreamSecret = await client.authStreamEnrollment.retrieveSecret();\n\nconsole.log(authStreamSecret.secret);", + }, + python: { + method: 'auth_stream_enrollment.retrieve_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nauth_stream_secret = client.auth_stream_enrollment.retrieve_secret()\nprint(auth_stream_secret.secret)', + }, + java: { + method: 'authStreamEnrollment().retrieveSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthStreamEnrollmentRetrieveSecretParams;\nimport com.lithic.api.models.AuthStreamSecret;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AuthStreamSecret authStreamSecret = client.authStreamEnrollment().retrieveSecret();\n }\n}', + }, + kotlin: { + method: 'authStreamEnrollment().retrieveSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthStreamEnrollmentRetrieveSecretParams\nimport com.lithic.api.models.AuthStreamSecret\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val authStreamSecret: AuthStreamSecret = client.authStreamEnrollment().retrieveSecret()\n}', + }, + go: { + method: 'client.AuthStreamEnrollment.GetSecret', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tauthStreamSecret, err := client.AuthStreamEnrollment.GetSecret(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authStreamSecret.Secret)\n}\n', + }, + ruby: { + method: 'auth_stream_enrollment.retrieve_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nauth_stream_secret = lithic.auth_stream_enrollment.retrieve_secret\n\nputs(auth_stream_secret)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/auth_stream/secret \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'rotate_secret', + endpoint: '/v1/auth_stream/secret/rotate', + httpMethod: 'post', + summary: 'Rotate the ASA HMAC secret key', + description: + 'Generate a new ASA HMAC secret key. The old ASA HMAC secret key will be deactivated 24 hours after a successful request to this endpoint. Make a [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) request to retrieve the new secret key.\n', + stainlessPath: '(resource) auth_stream_enrollment > (method) rotate_secret', + qualified: 'client.authStreamEnrollment.rotateSecret', + markdown: + "## rotate_secret\n\n`client.authStreamEnrollment.rotateSecret(): void`\n\n**post** `/v1/auth_stream/secret/rotate`\n\nGenerate a new ASA HMAC secret key. The old ASA HMAC secret key will be deactivated 24 hours after a successful request to this endpoint. Make a [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) request to retrieve the new secret key.\n\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.authStreamEnrollment.rotateSecret()\n```", + perLanguage: { + typescript: { + method: 'client.authStreamEnrollment.rotateSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.authStreamEnrollment.rotateSecret();", + }, + python: { + method: 'auth_stream_enrollment.rotate_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.auth_stream_enrollment.rotate_secret()', + }, + java: { + method: 'authStreamEnrollment().rotateSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthStreamEnrollmentRotateSecretParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.authStreamEnrollment().rotateSecret();\n }\n}', + }, + kotlin: { + method: 'authStreamEnrollment().rotateSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthStreamEnrollmentRotateSecretParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.authStreamEnrollment().rotateSecret()\n}', + }, + go: { + method: 'client.AuthStreamEnrollment.RotateSecret', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.AuthStreamEnrollment.RotateSecret(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'auth_stream_enrollment.rotate_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.auth_stream_enrollment.rotate_secret\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/auth_stream/secret/rotate \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_secret', + endpoint: '/v1/tokenization_decisioning/secret', + httpMethod: 'get', + summary: 'Retrieve the Tokenization Decisioning HMAC secret key', + description: + 'Retrieve the Tokenization Decisioning secret key. If one does not exist your program yet, calling this endpoint will create one for you. The headers of the Tokenization Decisioning request will contain a hmac signature which you can use to verify requests originate from Lithic. See [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more detail about verifying Tokenization Decisioning requests.\n', + stainlessPath: '(resource) tokenization_decisioning > (method) retrieve_secret', + qualified: 'client.tokenizationDecisioning.retrieveSecret', + response: '{ secret?: string; }', + markdown: + "## retrieve_secret\n\n`client.tokenizationDecisioning.retrieveSecret(): { secret?: string; }`\n\n**get** `/v1/tokenization_decisioning/secret`\n\nRetrieve the Tokenization Decisioning secret key. If one does not exist your program yet, calling this endpoint will create one for you. The headers of the Tokenization Decisioning request will contain a hmac signature which you can use to verify requests originate from Lithic. See [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more detail about verifying Tokenization Decisioning requests.\n\n\n### Returns\n\n- `{ secret?: string; }`\n\n - `secret?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst tokenizationSecret = await client.tokenizationDecisioning.retrieveSecret();\n\nconsole.log(tokenizationSecret);\n```", + perLanguage: { + typescript: { + method: 'client.tokenizationDecisioning.retrieveSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst tokenizationSecret = await client.tokenizationDecisioning.retrieveSecret();\n\nconsole.log(tokenizationSecret.secret);", + }, + python: { + method: 'tokenization_decisioning.retrieve_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ntokenization_secret = client.tokenization_decisioning.retrieve_secret()\nprint(tokenization_secret.secret)', + }, + java: { + method: 'tokenizationDecisioning().retrieveSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationDecisioningRetrieveSecretParams;\nimport com.lithic.api.models.TokenizationSecret;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TokenizationSecret tokenizationSecret = client.tokenizationDecisioning().retrieveSecret();\n }\n}', + }, + kotlin: { + method: 'tokenizationDecisioning().retrieveSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationDecisioningRetrieveSecretParams\nimport com.lithic.api.models.TokenizationSecret\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val tokenizationSecret: TokenizationSecret = client.tokenizationDecisioning().retrieveSecret()\n}', + }, + go: { + method: 'client.TokenizationDecisioning.GetSecret', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttokenizationSecret, err := client.TokenizationDecisioning.GetSecret(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", tokenizationSecret.Secret)\n}\n', + }, + ruby: { + method: 'tokenization_decisioning.retrieve_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntokenization_secret = lithic.tokenization_decisioning.retrieve_secret\n\nputs(tokenization_secret)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenization_decisioning/secret \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'rotate_secret', + endpoint: '/v1/tokenization_decisioning/secret/rotate', + httpMethod: 'post', + summary: 'Rotate the Tokenization Decisioning HMAC secret key', + description: + 'Generate a new Tokenization Decisioning secret key. The old Tokenization Decisioning secret key will be deactivated 24 hours after a successful request to this endpoint.\n', + stainlessPath: '(resource) tokenization_decisioning > (method) rotate_secret', + qualified: 'client.tokenizationDecisioning.rotateSecret', + response: '{ secret?: string; }', + markdown: + "## rotate_secret\n\n`client.tokenizationDecisioning.rotateSecret(): { secret?: string; }`\n\n**post** `/v1/tokenization_decisioning/secret/rotate`\n\nGenerate a new Tokenization Decisioning secret key. The old Tokenization Decisioning secret key will be deactivated 24 hours after a successful request to this endpoint.\n\n\n### Returns\n\n- `{ secret?: string; }`\n\n - `secret?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.tokenizationDecisioning.rotateSecret();\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.tokenizationDecisioning.rotateSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.tokenizationDecisioning.rotateSecret();\n\nconsole.log(response.secret);", + }, + python: { + method: 'tokenization_decisioning.rotate_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.tokenization_decisioning.rotate_secret()\nprint(response.secret)', + }, + java: { + method: 'tokenizationDecisioning().rotateSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationDecisioningRotateSecretParams;\nimport com.lithic.api.models.TokenizationDecisioningRotateSecretResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TokenizationDecisioningRotateSecretResponse response = client.tokenizationDecisioning().rotateSecret();\n }\n}', + }, + kotlin: { + method: 'tokenizationDecisioning().rotateSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationDecisioningRotateSecretParams\nimport com.lithic.api.models.TokenizationDecisioningRotateSecretResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: TokenizationDecisioningRotateSecretResponse = client.tokenizationDecisioning().rotateSecret()\n}', + }, + go: { + method: 'client.TokenizationDecisioning.RotateSecret', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.TokenizationDecisioning.RotateSecret(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Secret)\n}\n', + }, + ruby: { + method: 'tokenization_decisioning.rotate_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.tokenization_decisioning.rotate_secret\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenization_decisioning/secret/rotate \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'simulate', + endpoint: '/v1/simulate/tokenizations', + httpMethod: 'post', + summary: "Simulate a card's tokenization", + description: + "This endpoint is used to simulate a card's tokenization in the Digital Wallet and merchant tokenization ecosystem.\n", + stainlessPath: '(resource) tokenizations > (method) simulate', + qualified: 'client.tokenizations.simulate', + params: [ + 'cvv: string;', + 'expiration_date: string;', + 'pan: string;', + "tokenization_source: 'APPLE_PAY' | 'GOOGLE' | 'SAMSUNG_PAY' | 'MERCHANT';", + 'account_score?: number;', + 'device_score?: number;', + 'entity?: string;', + "wallet_recommended_decision?: 'APPROVED' | 'DECLINED' | 'REQUIRE_ADDITIONAL_AUTHENTICATION';", + ], + response: + "{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }", + markdown: + "## simulate\n\n`client.tokenizations.simulate(cvv: string, expiration_date: string, pan: string, tokenization_source: 'APPLE_PAY' | 'GOOGLE' | 'SAMSUNG_PAY' | 'MERCHANT', account_score?: number, device_score?: number, entity?: string, wallet_recommended_decision?: 'APPROVED' | 'DECLINED' | 'REQUIRE_ADDITIONAL_AUTHENTICATION'): { token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: object[]; payment_account_reference_id?: string; }`\n\n**post** `/v1/simulate/tokenizations`\n\nThis endpoint is used to simulate a card's tokenization in the Digital Wallet and merchant tokenization ecosystem.\n\n\n### Parameters\n\n- `cvv: string`\n The three digit cvv for the card.\n\n- `expiration_date: string`\n The expiration date of the card in 'MM/YY' format.\n\n- `pan: string`\n The sixteen digit card number.\n\n- `tokenization_source: 'APPLE_PAY' | 'GOOGLE' | 'SAMSUNG_PAY' | 'MERCHANT'`\n The source of the tokenization request.\n\n- `account_score?: number`\n The account score (1-5) that represents how the Digital Wallet's view on how reputable an end user's account is.\n\n- `device_score?: number`\n The device score (1-5) that represents how the Digital Wallet's view on how reputable an end user's device is.\n\n- `entity?: string`\n Optional field to specify the token requestor name for a merchant token simulation. Ignored when tokenization_source is not MERCHANT.\n\n- `wallet_recommended_decision?: 'APPROVED' | 'DECLINED' | 'REQUIRE_ADDITIONAL_AUTHENTICATION'`\n The decision that the Digital Wallet's recommend\n\n### Returns\n\n- `{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `card_token: string`\n - `created_at: string`\n - `dpan: string`\n - `status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'`\n - `token_requestor_name: string | string`\n - `token_unique_reference: string`\n - `tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'`\n - `updated_at: string`\n - `device_id?: string`\n - `digital_card_art_token?: string`\n - `events?: { token?: string; created_at?: string; result?: string; rule_results?: { auth_rule_token: string; explanation: string; name: string; result: 'APPROVED' | 'DECLINED' | 'REQUIRE_TFA' | 'ERROR'; }[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]`\n - `payment_account_reference_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst tokenization = await client.tokenizations.simulate({\n cvv: '776',\n expiration_date: '08/29',\n pan: '4111111289144142',\n tokenization_source: 'APPLE_PAY',\n});\n\nconsole.log(tokenization);\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.simulate', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst tokenization = await client.tokenizations.simulate({\n cvv: '776',\n expiration_date: '08/29',\n pan: '4111111289144142',\n tokenization_source: 'APPLE_PAY',\n account_score: 5,\n device_score: 5,\n wallet_recommended_decision: 'APPROVED',\n});\n\nconsole.log(tokenization.device_id);", + }, + python: { + method: 'tokenizations.simulate', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ntokenization = client.tokenizations.simulate(\n cvv="776",\n expiration_date="08/29",\n pan="4111111289144142",\n tokenization_source="APPLE_PAY",\n account_score=5,\n device_score=5,\n wallet_recommended_decision="APPROVED",\n)\nprint(tokenization.device_id)', + }, + java: { + method: 'tokenizations().simulate', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Tokenization;\nimport com.lithic.api.models.TokenizationSimulateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TokenizationSimulateParams params = TokenizationSimulateParams.builder()\n .cvv("776")\n .expirationDate("08/29")\n .pan("4111111289144142")\n .tokenizationSource(TokenizationSimulateParams.TokenizationSource.APPLE_PAY)\n .build();\n Tokenization tokenization = client.tokenizations().simulate(params);\n }\n}', + }, + kotlin: { + method: 'tokenizations().simulate', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Tokenization\nimport com.lithic.api.models.TokenizationSimulateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TokenizationSimulateParams = TokenizationSimulateParams.builder()\n .cvv("776")\n .expirationDate("08/29")\n .pan("4111111289144142")\n .tokenizationSource(TokenizationSimulateParams.TokenizationSource.APPLE_PAY)\n .build()\n val tokenization: Tokenization = client.tokenizations().simulate(params)\n}', + }, + go: { + method: 'client.Tokenizations.Simulate', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttokenization, err := client.Tokenizations.Simulate(context.TODO(), lithic.TokenizationSimulateParams{\n\t\tCvv: lithic.F("776"),\n\t\tExpirationDate: lithic.F("08/29"),\n\t\tPan: lithic.F("4111111289144142"),\n\t\tTokenizationSource: lithic.F(lithic.TokenizationSimulateParamsTokenizationSourceApplePay),\n\t\tAccountScore: lithic.F(int64(5)),\n\t\tDeviceScore: lithic.F(int64(5)),\n\t\tWalletRecommendedDecision: lithic.F(lithic.TokenizationSimulateParamsWalletRecommendedDecisionApproved),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", tokenization.DeviceID)\n}\n', + }, + ruby: { + method: 'tokenizations.simulate', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntokenization = lithic.tokenizations.simulate(\n cvv: "776",\n expiration_date: "08/29",\n pan: "4111111289144142",\n tokenization_source: :APPLE_PAY\n)\n\nputs(tokenization)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/tokenizations \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "cvv": "776",\n "expiration_date": "08/29",\n "pan": "4111111289144142",\n "tokenization_source": "APPLE_PAY",\n "account_score": 5,\n "device_score": 5,\n "wallet_recommended_decision": "APPROVED"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/tokenizations', + httpMethod: 'get', + summary: "Get a card's tokenizations", + description: 'List card tokenizations', + stainlessPath: '(resource) tokenizations > (method) list', + qualified: 'client.tokenizations.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'card_token?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + "tokenization_channel?: 'DIGITAL_WALLET' | 'MERCHANT' | 'ALL';", + ], + response: + "{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }", + markdown: + "## list\n\n`client.tokenizations.list(account_token?: string, begin?: string, card_token?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string, tokenization_channel?: 'DIGITAL_WALLET' | 'MERCHANT' | 'ALL'): { token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: object[]; payment_account_reference_id?: string; }`\n\n**get** `/v1/tokenizations`\n\nList card tokenizations\n\n### Parameters\n\n- `account_token?: string`\n Filters for tokenizations associated with a specific account.\n\n- `begin?: string`\n Filter for tokenizations created after this date.\n\n- `card_token?: string`\n Filters for tokenizations associated with a specific card.\n\n- `end?: string`\n Filter for tokenizations created before this date.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `tokenization_channel?: 'DIGITAL_WALLET' | 'MERCHANT' | 'ALL'`\n Filter for tokenizations by tokenization channel. If this is not specified, only DIGITAL_WALLET tokenizations will be returned.\n\n### Returns\n\n- `{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `card_token: string`\n - `created_at: string`\n - `dpan: string`\n - `status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'`\n - `token_requestor_name: string | string`\n - `token_unique_reference: string`\n - `tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'`\n - `updated_at: string`\n - `device_id?: string`\n - `digital_card_art_token?: string`\n - `events?: { token?: string; created_at?: string; result?: string; rule_results?: { auth_rule_token: string; explanation: string; name: string; result: 'APPROVED' | 'DECLINED' | 'REQUIRE_TFA' | 'ERROR'; }[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]`\n - `payment_account_reference_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const tokenization of client.tokenizations.list()) {\n console.log(tokenization);\n}\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const tokenization of client.tokenizations.list()) {\n console.log(tokenization.device_id);\n}", + }, + python: { + method: 'tokenizations.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.tokenizations.list()\npage = page.data[0]\nprint(page.device_id)', + }, + java: { + method: 'tokenizations().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationListPage;\nimport com.lithic.api.models.TokenizationListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TokenizationListPage page = client.tokenizations().list();\n }\n}', + }, + kotlin: { + method: 'tokenizations().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationListPage\nimport com.lithic.api.models.TokenizationListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TokenizationListPage = client.tokenizations().list()\n}', + }, + go: { + method: 'client.Tokenizations.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Tokenizations.List(context.TODO(), lithic.TokenizationListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'tokenizations.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.tokenizations.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/tokenizations \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/tokenizations/{tokenization_token}', + httpMethod: 'get', + summary: 'Get a single card tokenization', + description: 'Get tokenization', + stainlessPath: '(resource) tokenizations > (method) retrieve', + qualified: 'client.tokenizations.retrieve', + params: ['tokenization_token: string;'], + response: + "{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }", + markdown: + "## retrieve\n\n`client.tokenizations.retrieve(tokenization_token: string): { token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: object[]; payment_account_reference_id?: string; }`\n\n**get** `/v1/tokenizations/{tokenization_token}`\n\nGet tokenization\n\n### Parameters\n\n- `tokenization_token: string`\n\n### Returns\n\n- `{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `card_token: string`\n - `created_at: string`\n - `dpan: string`\n - `status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'`\n - `token_requestor_name: string | string`\n - `token_unique_reference: string`\n - `tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'`\n - `updated_at: string`\n - `device_id?: string`\n - `digital_card_art_token?: string`\n - `events?: { token?: string; created_at?: string; result?: string; rule_results?: { auth_rule_token: string; explanation: string; name: string; result: 'APPROVED' | 'DECLINED' | 'REQUIRE_TFA' | 'ERROR'; }[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]`\n - `payment_account_reference_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst tokenization = await client.tokenizations.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(tokenization);\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst tokenization = await client.tokenizations.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(tokenization.device_id);", + }, + python: { + method: 'tokenizations.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ntokenization = client.tokenizations.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(tokenization.device_id)', + }, + java: { + method: 'tokenizations().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Tokenization;\nimport com.lithic.api.models.TokenizationRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Tokenization tokenization = client.tokenizations().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Tokenization\nimport com.lithic.api.models.TokenizationRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val tokenization: Tokenization = client.tokenizations().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttokenization, err := client.Tokenizations.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", tokenization.DeviceID)\n}\n', + }, + ruby: { + method: 'tokenizations.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntokenization = lithic.tokenizations.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(tokenization)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'pause', + endpoint: '/v1/tokenizations/{tokenization_token}/pause', + httpMethod: 'post', + summary: 'Pause a card tokenization', + description: + 'This endpoint is used to ask the card network to pause a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network pauses the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on tokenizations with status `ACTIVE`.\nA paused token will prevent merchants from sending authorizations, and is a temporary status that can be changed.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.', + stainlessPath: '(resource) tokenizations > (method) pause', + qualified: 'client.tokenizations.pause', + params: ['tokenization_token: string;'], + markdown: + "## pause\n\n`client.tokenizations.pause(tokenization_token: string): void`\n\n**post** `/v1/tokenizations/{tokenization_token}/pause`\n\nThis endpoint is used to ask the card network to pause a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network pauses the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on tokenizations with status `ACTIVE`.\nA paused token will prevent merchants from sending authorizations, and is a temporary status that can be changed.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n\n### Parameters\n\n- `tokenization_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.tokenizations.pause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.pause', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.tokenizations.pause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');", + }, + python: { + method: 'tokenizations.pause', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.tokenizations.pause(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'tokenizations().pause', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationPauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.tokenizations().pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().pause', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationPauseParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.tokenizations().pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.Pause', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Tokenizations.Pause(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'tokenizations.pause', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.tokenizations.pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN/pause \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'unpause', + endpoint: '/v1/tokenizations/{tokenization_token}/unpause', + httpMethod: 'post', + summary: 'Unpause a card tokenization', + description: + 'This endpoint is used to ask the card network to unpause a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network unpauses the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on tokenizations with status `PAUSED`.\nThis will put the tokenization in an active state, and transactions may resume.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.', + stainlessPath: '(resource) tokenizations > (method) unpause', + qualified: 'client.tokenizations.unpause', + params: ['tokenization_token: string;'], + markdown: + "## unpause\n\n`client.tokenizations.unpause(tokenization_token: string): void`\n\n**post** `/v1/tokenizations/{tokenization_token}/unpause`\n\nThis endpoint is used to ask the card network to unpause a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network unpauses the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on tokenizations with status `PAUSED`.\nThis will put the tokenization in an active state, and transactions may resume.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n\n### Parameters\n\n- `tokenization_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.tokenizations.unpause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.unpause', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.tokenizations.unpause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');", + }, + python: { + method: 'tokenizations.unpause', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.tokenizations.unpause(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'tokenizations().unpause', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationUnpauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.tokenizations().unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().unpause', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationUnpauseParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.tokenizations().unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.Unpause', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Tokenizations.Unpause(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'tokenizations.unpause', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.tokenizations.unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN/unpause \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'deactivate', + endpoint: '/v1/tokenizations/{tokenization_token}/deactivate', + httpMethod: 'post', + summary: 'Deactivate a card tokenization', + description: + 'This endpoint is used to ask the card network to deactivate a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network deactivates the tokenization, the state will be updated and a tokenization.updated event will be sent.\nAuthorizations attempted with a deactivated tokenization will be blocked and will not be forwarded to Lithic from the network. Deactivating the token is a permanent operation. If the target is a digital wallet tokenization, it will be removed from its device.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.', + stainlessPath: '(resource) tokenizations > (method) deactivate', + qualified: 'client.tokenizations.deactivate', + params: ['tokenization_token: string;'], + markdown: + "## deactivate\n\n`client.tokenizations.deactivate(tokenization_token: string): void`\n\n**post** `/v1/tokenizations/{tokenization_token}/deactivate`\n\nThis endpoint is used to ask the card network to deactivate a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network deactivates the tokenization, the state will be updated and a tokenization.updated event will be sent.\nAuthorizations attempted with a deactivated tokenization will be blocked and will not be forwarded to Lithic from the network. Deactivating the token is a permanent operation. If the target is a digital wallet tokenization, it will be removed from its device.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n\n### Parameters\n\n- `tokenization_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.tokenizations.deactivate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.deactivate', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.tokenizations.deactivate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');", + }, + python: { + method: 'tokenizations.deactivate', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.tokenizations.deactivate(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'tokenizations().deactivate', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationDeactivateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.tokenizations().deactivate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().deactivate', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationDeactivateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.tokenizations().deactivate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.Deactivate', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Tokenizations.Deactivate(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'tokenizations.deactivate', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.tokenizations.deactivate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN/deactivate \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'activate', + endpoint: '/v1/tokenizations/{tokenization_token}/activate', + httpMethod: 'post', + summary: 'Activate a card tokenization', + description: + 'This endpoint is used to ask the card network to activate a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network activates the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on digital wallet tokenizations with status `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`.\nThis will put the tokenization in an active state, and transactions will be allowed.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.', + stainlessPath: '(resource) tokenizations > (method) activate', + qualified: 'client.tokenizations.activate', + params: ['tokenization_token: string;'], + markdown: + "## activate\n\n`client.tokenizations.activate(tokenization_token: string): void`\n\n**post** `/v1/tokenizations/{tokenization_token}/activate`\n\nThis endpoint is used to ask the card network to activate a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network activates the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on digital wallet tokenizations with status `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`.\nThis will put the tokenization in an active state, and transactions will be allowed.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n\n### Parameters\n\n- `tokenization_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.tokenizations.activate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.activate', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.tokenizations.activate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');", + }, + python: { + method: 'tokenizations.activate', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.tokenizations.activate(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'tokenizations().activate', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationActivateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.tokenizations().activate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().activate', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationActivateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.tokenizations().activate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.Activate', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Tokenizations.Activate(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'tokenizations.activate', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.tokenizations.activate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN/activate \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'resend_activation_code', + endpoint: '/v1/tokenizations/{tokenization_token}/resend_activation_code', + httpMethod: 'post', + summary: 'Resend activation code for a card tokenization', + description: + 'This endpoint is used to ask the card network to send another activation code to a cardholder that has already tried tokenizing a card. A successful response indicates that the request was successfully delivered to the card network.\nThe endpoint may only be used on Mastercard digital wallet tokenizations with status `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`. The network will send a new activation code to the one of the contact methods provided in the initial tokenization flow. If a user fails to enter the code correctly 3 times, the contact method will not be eligible for resending the activation code, and the cardholder must restart the provision process.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.', + stainlessPath: '(resource) tokenizations > (method) resend_activation_code', + qualified: 'client.tokenizations.resendActivationCode', + params: [ + 'tokenization_token: string;', + "activation_method_type?: 'EMAIL_TO_CARDHOLDER_ADDRESS' | 'TEXT_TO_CARDHOLDER_NUMBER';", + ], + markdown: + "## resend_activation_code\n\n`client.tokenizations.resendActivationCode(tokenization_token: string, activation_method_type?: 'EMAIL_TO_CARDHOLDER_ADDRESS' | 'TEXT_TO_CARDHOLDER_NUMBER'): void`\n\n**post** `/v1/tokenizations/{tokenization_token}/resend_activation_code`\n\nThis endpoint is used to ask the card network to send another activation code to a cardholder that has already tried tokenizing a card. A successful response indicates that the request was successfully delivered to the card network.\nThe endpoint may only be used on Mastercard digital wallet tokenizations with status `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`. The network will send a new activation code to the one of the contact methods provided in the initial tokenization flow. If a user fails to enter the code correctly 3 times, the contact method will not be eligible for resending the activation code, and the cardholder must restart the provision process.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n\n### Parameters\n\n- `tokenization_token: string`\n\n- `activation_method_type?: 'EMAIL_TO_CARDHOLDER_ADDRESS' | 'TEXT_TO_CARDHOLDER_NUMBER'`\n The communication method that the user has selected to use to receive the authentication code.\nSupported Values: Sms = \"TEXT_TO_CARDHOLDER_NUMBER\". Email = \"EMAIL_TO_CARDHOLDER_ADDRESS\"\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.tokenizations.resendActivationCode('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.resendActivationCode', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.tokenizations.resendActivationCode('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n activation_method_type: 'TEXT_TO_CARDHOLDER_NUMBER',\n});", + }, + python: { + method: 'tokenizations.resend_activation_code', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.tokenizations.resend_activation_code(\n tokenization_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n activation_method_type="TEXT_TO_CARDHOLDER_NUMBER",\n)', + }, + java: { + method: 'tokenizations().resendActivationCode', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TokenizationResendActivationCodeParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.tokenizations().resendActivationCode("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().resendActivationCode', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TokenizationResendActivationCodeParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.tokenizations().resendActivationCode("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.ResendActivationCode', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Tokenizations.ResendActivationCode(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TokenizationResendActivationCodeParams{\n\t\t\tActivationMethodType: lithic.F(lithic.TokenizationResendActivationCodeParamsActivationMethodTypeTextToCardholderNumber),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'tokenizations.resend_activation_code', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.tokenizations.resend_activation_code("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN/resend_activation_code \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update_digital_card_art', + endpoint: '/v1/tokenizations/{tokenization_token}/update_digital_card_art', + httpMethod: 'post', + summary: 'Update digital card art for a card tokenization', + description: + "This endpoint is used update the digital card art for a digital wallet tokenization. A successful response indicates that the card network has updated the tokenization's art, and the tokenization's `digital_cart_art_token` field was updated.\nThe endpoint may not be used on tokenizations with status `DEACTIVATED`.\nNote that this updates the art for one specific tokenization, not all tokenizations for a card. New tokenizations for a card will be created with the art referenced in the card object's `digital_card_art_token` field.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.", + stainlessPath: '(resource) tokenizations > (method) update_digital_card_art', + qualified: 'client.tokenizations.updateDigitalCardArt', + params: ['tokenization_token: string;', 'digital_card_art_token?: string;'], + response: + "{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }", + markdown: + "## update_digital_card_art\n\n`client.tokenizations.updateDigitalCardArt(tokenization_token: string, digital_card_art_token?: string): { token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: object[]; payment_account_reference_id?: string; }`\n\n**post** `/v1/tokenizations/{tokenization_token}/update_digital_card_art`\n\nThis endpoint is used update the digital card art for a digital wallet tokenization. A successful response indicates that the card network has updated the tokenization's art, and the tokenization's `digital_cart_art_token` field was updated.\nThe endpoint may not be used on tokenizations with status `DEACTIVATED`.\nNote that this updates the art for one specific tokenization, not all tokenizations for a card. New tokenizations for a card will be created with the art referenced in the card object's `digital_card_art_token` field.\nReach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n\n### Parameters\n\n- `tokenization_token: string`\n\n- `digital_card_art_token?: string`\n Specifies the digital card art to be displayed in the user’s digital wallet for a tokenization. This artwork must be approved by the network and configured by Lithic to use. See [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).\n\n### Returns\n\n- `{ token: string; account_token: string; card_token: string; created_at: string; dpan: string; status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'; token_requestor_name: string | string; token_unique_reference: string; tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; updated_at: string; device_id?: string; digital_card_art_token?: string; events?: { token?: string; created_at?: string; result?: string; rule_results?: object[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]; payment_account_reference_id?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `card_token: string`\n - `created_at: string`\n - `dpan: string`\n - `status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN'`\n - `token_requestor_name: string | string`\n - `token_unique_reference: string`\n - `tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'`\n - `updated_at: string`\n - `device_id?: string`\n - `digital_card_art_token?: string`\n - `events?: { token?: string; created_at?: string; result?: string; rule_results?: { auth_rule_token: string; explanation: string; name: string; result: 'APPROVED' | 'DECLINED' | 'REQUIRE_TFA' | 'ERROR'; }[]; tokenization_decline_reasons?: string[]; tokenization_tfa_reasons?: string[]; type?: string; }[]`\n - `payment_account_reference_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst tokenization = await client.tokenizations.updateDigitalCardArt('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(tokenization);\n```", + perLanguage: { + typescript: { + method: 'client.tokenizations.updateDigitalCardArt', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst tokenization = await client.tokenizations.updateDigitalCardArt(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(tokenization.device_id);", + }, + python: { + method: 'tokenizations.update_digital_card_art', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ntokenization = client.tokenizations.update_digital_card_art(\n tokenization_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(tokenization.device_id)', + }, + java: { + method: 'tokenizations().updateDigitalCardArt', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Tokenization;\nimport com.lithic.api.models.TokenizationUpdateDigitalCardArtParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Tokenization tokenization = client.tokenizations().updateDigitalCardArt("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'tokenizations().updateDigitalCardArt', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Tokenization\nimport com.lithic.api.models.TokenizationUpdateDigitalCardArtParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val tokenization: Tokenization = client.tokenizations().updateDigitalCardArt("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Tokenizations.UpdateDigitalCardArt', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttokenization, err := client.Tokenizations.UpdateDigitalCardArt(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.TokenizationUpdateDigitalCardArtParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", tokenization.DeviceID)\n}\n', + }, + ruby: { + method: 'tokenizations.update_digital_card_art', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntokenization = lithic.tokenizations.update_digital_card_art("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(tokenization)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/tokenizations/$TOKENIZATION_TOKEN/update_digital_card_art \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/cards', + httpMethod: 'get', + summary: 'List cards', + description: 'List cards.', + stainlessPath: '(resource) cards > (method) list', + qualified: 'client.cards.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'memo?: string;', + 'page_size?: number;', + 'starting_after?: string;', + "state?: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT';", + ], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## list\n\n`client.cards.list(account_token?: string, begin?: string, end?: string, ending_before?: string, memo?: string, page_size?: number, starting_after?: string, state?: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'): { token: string; account_token: string; card_program_token: string; created: string; funding: object; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: spend_limit_duration; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n\n**get** `/v1/cards`\n\nList cards.\n\n### Parameters\n\n- `account_token?: string`\n Returns cards associated with the specified account.\n\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `memo?: string`\n Returns cards containing the specified partial or full memo text.\n\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `state?: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'`\n Returns cards with the specified state.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details without PCI information\n\n - `token: string`\n - `account_token: string`\n - `card_program_token: string`\n - `created: string`\n - `funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }`\n - `last_four: string`\n - `pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'`\n - `spend_limit: number`\n - `spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'`\n - `state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'`\n - `type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'`\n - `auth_rule_tokens?: string[]`\n - `bulk_order_token?: string`\n - `cardholder_currency?: string`\n - `comment?: string`\n - `digital_card_art_token?: string`\n - `exp_month?: string`\n - `exp_year?: string`\n - `hostname?: string`\n - `memo?: string`\n - `network_program_token?: string`\n - `pending_commands?: string[]`\n - `product_id?: string`\n - `replacement_for?: string`\n - `substatus?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const nonPCICard of client.cards.list()) {\n console.log(nonPCICard);\n}\n```", + perLanguage: { + typescript: { + method: 'client.cards.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const nonPCICard of client.cards.list()) {\n console.log(nonPCICard.product_id);\n}", + }, + python: { + method: 'cards.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.cards.list()\npage = page.data[0]\nprint(page.product_id)', + }, + java: { + method: 'cards().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardListPage;\nimport com.lithic.api.models.CardListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardListPage page = client.cards().list();\n }\n}', + }, + kotlin: { + method: 'cards().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardListPage\nimport com.lithic.api.models.CardListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: CardListPage = client.cards().list()\n}', + }, + go: { + method: 'client.Cards.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Cards.List(context.TODO(), lithic.CardListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'cards.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.cards.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/cards \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/cards', + httpMethod: 'post', + summary: 'Create card', + description: + 'Create a new virtual or physical card. Parameters `shipping_address` and `product_id` only apply to physical cards.\n', + stainlessPath: '(resource) cards > (method) create', + qualified: 'client.cards.create', + params: [ + "type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET';", + 'account_token?: string;', + 'bulk_order_token?: string;', + 'card_program_token?: string;', + 'carrier?: { qr_code_url?: string; };', + 'digital_card_art_token?: string;', + 'exp_month?: string;', + 'exp_year?: string;', + 'memo?: string;', + 'pin?: string;', + 'product_id?: string;', + 'replacement_account_token?: string;', + 'replacement_comment?: string;', + 'replacement_for?: string;', + 'replacement_substatus?: string;', + 'shipping_address?: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; };', + "shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING';", + 'spend_limit?: number;', + "spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';", + "state?: 'OPEN' | 'PAUSED';", + 'Idempotency-Key?: string;', + ], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## create\n\n`client.cards.create(type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET', account_token?: string, bulk_order_token?: string, card_program_token?: string, carrier?: { qr_code_url?: string; }, digital_card_art_token?: string, exp_month?: string, exp_year?: string, memo?: string, pin?: string, product_id?: string, replacement_account_token?: string, replacement_comment?: string, replacement_for?: string, replacement_substatus?: string, shipping_address?: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }, shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING', spend_limit?: number, spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION', state?: 'OPEN' | 'PAUSED', Idempotency-Key?: string): object`\n\n**post** `/v1/cards`\n\nCreate a new virtual or physical card. Parameters `shipping_address` and `product_id` only apply to physical cards.\n\n\n### Parameters\n\n- `type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'`\n Card types:\n* `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet like Apple Pay or Google Pay (if the card program is digital wallet-enabled).\n* `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at [lithic.com/contact](https://lithic.com/contact) for more information.\n* `SINGLE_USE` - Card is closed upon first successful authorization.\n* `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully authorizes the card.\n* `UNLOCKED` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.\n* `DIGITAL_WALLET` - *[Deprecated]* Similar behavior to VIRTUAL cards, please use VIRTUAL instead.\n\n- `account_token?: string`\n Globally unique identifier for the account that the card will be associated with. Required for programs enrolling users using the [/account\\_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). See [Managing Your Program](doc:managing-your-program) for more information.\n\n\n- `bulk_order_token?: string`\n Globally unique identifier for an existing bulk order to associate this card with. When specified, the card will be added to the bulk order for batch shipment. Only applicable to cards of type PHYSICAL\n\n- `card_program_token?: string`\n For card programs with more than one BIN range. This must be configured with Lithic before use. Identifies the card program/BIN range under which to create the card. If omitted, will utilize the program's default `card_program_token`. In Sandbox, use 00000000-0000-0000-1000-000000000000 and 00000000-0000-0000-2000-000000000000 to test creating cards on specific card programs.\n\n- `carrier?: { qr_code_url?: string; }`\n - `qr_code_url?: string`\n QR code URL to display on the card carrier. The `qr_code_url` field requires your domain to be allowlisted by Lithic before use. Contact Support to configure your QR code domain\n\n- `digital_card_art_token?: string`\n Specifies the digital card art to be displayed in the user’s digital wallet after tokenization. This artwork must be approved by Mastercard and configured by Lithic to use. See [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).\n\n- `exp_month?: string`\n Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an expiration date five years in the future will be generated. Five years is the maximum expiration date.\n\n- `exp_year?: string`\n Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an expiration date five years in the future will be generated. Five years is the maximum expiration date.\n\n- `memo?: string`\n Friendly name to identify the card.\n\n- `pin?: string`\n Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and `VIRTUAL`. See [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block).\n\n- `product_id?: string`\n Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before use. Specifies the configuration (i.e., physical card art) that the card should be manufactured with.\n\n- `replacement_account_token?: string`\n Restricted field limited to select use cases. Lithic will reach out directly if this field should be used. Globally unique identifier for the replacement card's account. If this field is specified, `replacement_for` must also be specified. If `replacement_for` is specified and this field is omitted, the replacement card's account will be inferred from the card being replaced.\n\n- `replacement_comment?: string`\n Additional context or information related to the card that this card will replace.\n\n- `replacement_for?: string`\n Globally unique identifier for the card that this card will replace. If the card type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is `VIRTUAL` it will be replaced by a `VIRTUAL` card.\n\n- `replacement_substatus?: string`\n Card state substatus values for the card that this card will replace:\n* `LOST` - The physical card is no longer in the cardholder's possession due to being lost or never received by the cardholder.\n* `COMPROMISED` - Card information has been exposed, potentially leading to unauthorized access. This may involve physical card theft, cloning, or online data breaches.\n* `DAMAGED` - The physical card is not functioning properly, such as having chip failures or a demagnetized magnetic stripe.\n* `END_USER_REQUEST` - The cardholder requested the closure of the card for reasons unrelated to fraud or damage, such as switching to a different product or closing the account.\n* `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud or damage, such as account inactivity, product or policy changes, or technology upgrades.\n* `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified period, applicable to statuses like `PAUSED` or `CLOSED`.\n* `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or activities that require review. This can involve prompting the cardholder to confirm legitimate use or report confirmed fraud.\n* `INTERNAL_REVIEW` - The card is temporarily paused pending further internal review.\n* `EXPIRED` - The card has expired and has been closed without being reissued.\n* `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been returned.\n* `OTHER` - The reason for the status does not fall into any of the above categories. A comment should be provided to specify the reason.\n\n- `shipping_address?: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }`\n - `address1: string`\n Valid USPS routable address.\n - `city: string`\n City\n - `country: string`\n Uppercase ISO 3166-1 alpha-3 three character abbreviation.\n - `first_name: string`\n Customer's first name. This will be the first name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `last_name: string`\n Customer's surname (family name). This will be the last name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `postal_code: string`\n Postal code (formerly zipcode). For US addresses, either five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.\n - `state: string`\n Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 characters for other countries.\n - `address2?: string`\n Unit number (if applicable).\n - `email?: string`\n Email address to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n - `line2_text?: string`\n Text to be printed on line two of the physical card. Use of this field requires additional permissions.\n - `phone_number?: string`\n Cardholder's phone number in E.164 format to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n\n- `shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'`\n Shipping method for the card. Only applies to cards of type PHYSICAL.\nUse of options besides `STANDARD` require additional permissions.\n\n* `STANDARD` - USPS regular mail or similar international option, with no tracking\n* `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with tracking\n* `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking\n* `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day shipping, with tracking\n* `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking\n* `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar international option, with tracking\n* `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and timeline are inherited from the parent bulk order.\n\n- `spend_limit?: number`\n Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,000 limit). Transaction requests above the spend limit will be declined. Note that a spend limit of 0 is effectively no limit, and should only be used to reset or remove a prior limit. Only a limit of 1 or above will result in declined transactions due to checks against the card limit.\n\n- `spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'`\n Spend limit duration values:\n\n* `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year.\n* `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the card.\n* `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. To support recurring monthly payments, which can occur on different day every month, the time window we consider for monthly velocity starts 6 days after the current calendar date one month prior.\n* `TRANSACTION` - Card will authorize multiple transactions if each individual transaction is under the spend limit.\n\n- `state?: 'OPEN' | 'PAUSED'`\n Card state values:\n* `OPEN` - Card will approve authorizations (if they match card and account parameters).\n* `PAUSED` - Card will decline authorizations, but can be resumed at a later time.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.create({ type: 'VIRTUAL' });\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.create({\n type: 'VIRTUAL',\n memo: 'New Card',\n spend_limit: 1000,\n spend_limit_duration: 'TRANSACTION',\n state: 'OPEN',\n});\n\nconsole.log(card);", + }, + python: { + method: 'cards.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.create(\n type="VIRTUAL",\n memo="New Card",\n spend_limit=1000,\n spend_limit_duration="TRANSACTION",\n state="OPEN",\n)\nprint(card)', + }, + java: { + method: 'cards().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardCreateParams params = CardCreateParams.builder()\n .type(CardCreateParams.Type.VIRTUAL)\n .build();\n Card card = client.cards().create(params);\n }\n}', + }, + kotlin: { + method: 'cards().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardCreateParams = CardCreateParams.builder()\n .type(CardCreateParams.Type.VIRTUAL)\n .build()\n val card: Card = client.cards().create(params)\n}', + }, + go: { + method: 'client.Cards.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.New(context.TODO(), lithic.CardNewParams{\n\t\tType: lithic.F(lithic.CardNewParamsTypeVirtual),\n\t\tMemo: lithic.F("New Card"),\n\t\tSpendLimit: lithic.F(int64(1000)),\n\t\tSpendLimitDuration: lithic.F(lithic.SpendLimitDurationTransaction),\n\t\tState: lithic.F(lithic.CardNewParamsStateOpen),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.create(type: :VIRTUAL)\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "type": "VIRTUAL",\n "bulk_order_token": "5e9483eb-8103-4e16-9794-2106111b2eca",\n "card_program_token": "5e9483eb-8103-4e16-9794-2106111b2eca",\n "digital_card_art_token": "5e9483eb-8103-4e16-9794-2106111b2eca",\n "exp_month": "06",\n "exp_year": "2027",\n "memo": "New Card",\n "product_id": "1",\n "replacement_account_token": "5e9483eb-8103-4e16-9794-2106111b2eca",\n "replacement_for": "5e9483eb-8103-4e16-9794-2106111b2eca",\n "spend_limit": 1000,\n "spend_limit_duration": "TRANSACTION",\n "state": "OPEN"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/cards/{card_token}', + httpMethod: 'get', + summary: 'Get card', + description: 'Get card configuration such as spend limit and state.', + stainlessPath: '(resource) cards > (method) retrieve', + qualified: 'client.cards.retrieve', + params: ['card_token: string;'], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## retrieve\n\n`client.cards.retrieve(card_token: string): object`\n\n**get** `/v1/cards/{card_token}`\n\nGet card configuration such as spend limit and state.\n\n### Parameters\n\n- `card_token: string`\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(card);", + }, + python: { + method: 'cards.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(card)', + }, + java: { + method: 'cards().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Card card = client.cards().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val card: Card = client.cards().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/cards/{card_token}', + httpMethod: 'patch', + summary: 'Update card', + description: + 'Update the specified properties of the card. Unsupplied properties will remain unchanged.\n\n*Note: setting a card to a `CLOSED` state is a final action that cannot be undone.*\n', + stainlessPath: '(resource) cards > (method) update', + qualified: 'client.cards.update', + params: [ + 'card_token: string;', + 'comment?: string;', + 'digital_card_art_token?: string;', + 'memo?: string;', + 'network_program_token?: string;', + 'pin?: string;', + "pin_status?: 'OK';", + 'spend_limit?: number;', + "spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';", + "state?: 'CLOSED' | 'OPEN' | 'PAUSED';", + 'substatus?: string;', + ], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## update\n\n`client.cards.update(card_token: string, comment?: string, digital_card_art_token?: string, memo?: string, network_program_token?: string, pin?: string, pin_status?: 'OK', spend_limit?: number, spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION', state?: 'CLOSED' | 'OPEN' | 'PAUSED', substatus?: string): object`\n\n**patch** `/v1/cards/{card_token}`\n\nUpdate the specified properties of the card. Unsupplied properties will remain unchanged.\n\n*Note: setting a card to a `CLOSED` state is a final action that cannot be undone.*\n\n\n### Parameters\n\n- `card_token: string`\n\n- `comment?: string`\n Additional context or information related to the card.\n\n- `digital_card_art_token?: string`\n Specifies the digital card art to be displayed in the user’s digital wallet after tokenization. This artwork must be approved by Mastercard and configured by Lithic to use. See [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art).\n\n- `memo?: string`\n Friendly name to identify the card.\n\n- `network_program_token?: string`\n Globally unique identifier for the card's network program. Currently applicable to Visa cards participating in Account Level Management only.\n\n- `pin?: string`\n Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block).\n\n- `pin_status?: 'OK'`\n Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect attempts). Can only be set to `OK` to unblock a card.\n\n- `spend_limit?: number`\n Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,000 limit). Transaction requests above the spend limit will be declined. Note that a spend limit of 0 is effectively no limit, and should only be used to reset or remove a prior limit. Only a limit of 1 or above will result in declined transactions due to checks against the card limit.\n\n- `spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'`\n Spend limit duration values:\n\n* `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year.\n* `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the card.\n* `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. To support recurring monthly payments, which can occur on different day every month, the time window we consider for monthly velocity starts 6 days after the current calendar date one month prior.\n* `TRANSACTION` - Card will authorize multiple transactions if each individual transaction is under the spend limit.\n\n- `state?: 'CLOSED' | 'OPEN' | 'PAUSED'`\n Card state values:\n* `CLOSED` - Card will no longer approve authorizations. Closing a card cannot be undone.\n* `OPEN` - Card will approve authorizations (if they match card and account parameters).\n* `PAUSED` - Card will decline authorizations, but can be resumed at a later time.\n\n- `substatus?: string`\n Card state substatus values:\n* `LOST` - The physical card is no longer in the cardholder's possession due to being lost or never received by the cardholder.\n* `COMPROMISED` - Card information has been exposed, potentially leading to unauthorized access. This may involve physical card theft, cloning, or online data breaches.\n* `DAMAGED` - The physical card is not functioning properly, such as having chip failures or a demagnetized magnetic stripe.\n* `END_USER_REQUEST` - The cardholder requested the closure of the card for reasons unrelated to fraud or damage, such as switching to a different product or closing the account.\n* `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud or damage, such as account inactivity, product or policy changes, or technology upgrades.\n* `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified period, applicable to statuses like `PAUSED` or `CLOSED`.\n* `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or activities that require review. This can involve prompting the cardholder to confirm legitimate use or report confirmed fraud.\n* `INTERNAL_REVIEW` - The card is temporarily paused pending further internal review.\n* `EXPIRED` - The card has expired and has been closed without being reissued.\n* `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been returned.\n* `OTHER` - The reason for the status does not fall into any of the above categories. A comment should be provided to specify the reason.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n memo: 'Updated Name',\n spend_limit: 100,\n spend_limit_duration: 'FOREVER',\n state: 'OPEN',\n});\n\nconsole.log(card);", + }, + python: { + method: 'cards.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.update(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n memo="Updated Name",\n spend_limit=100,\n spend_limit_duration="FOREVER",\n state="OPEN",\n)\nprint(card)', + }, + java: { + method: 'cards().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Card card = client.cards().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val card: Card = client.cards().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardUpdateParams{\n\t\t\tMemo: lithic.F("Updated Name"),\n\t\t\tSpendLimit: lithic.F(int64(100)),\n\t\t\tSpendLimitDuration: lithic.F(lithic.SpendLimitDurationForever),\n\t\t\tState: lithic.F(lithic.CardUpdateParamsStateOpen),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "digital_card_art_token": "00000000-0000-0000-1000-000000000000",\n "memo": "Updated Name",\n "network_program_token": "00000000-0000-0000-1000-000000000000",\n "spend_limit": 100,\n "spend_limit_duration": "FOREVER",\n "state": "OPEN"\n }\'', + }, + }, + }, + { + name: 'provision', + endpoint: '/v1/cards/{card_token}/provision', + httpMethod: 'post', + summary: 'Provision card (Digital Wallet)', + description: + "Allow your cardholders to directly add payment cards to the device's digital wallet (e.g. Apple Pay) with one touch from your app.\n\nThis requires some additional setup and configuration. Please [Contact Us](https://lithic.com/contact) or your Customer Success representative for more information.\n", + stainlessPath: '(resource) cards > (method) provision', + qualified: 'client.cards.provision', + params: [ + 'card_token: string;', + 'certificate?: string;', + 'client_device_id?: string;', + 'client_wallet_account_id?: string;', + "digital_wallet?: 'APPLE_PAY' | 'GOOGLE_PAY' | 'SAMSUNG_PAY';", + 'nonce?: string;', + 'nonce_signature?: string;', + ], + response: + '{ provisioning_payload?: string | { activationData?: string; encryptedData?: string; ephemeralPublicKey?: string; }; }', + markdown: + "## provision\n\n`client.cards.provision(card_token: string, certificate?: string, client_device_id?: string, client_wallet_account_id?: string, digital_wallet?: 'APPLE_PAY' | 'GOOGLE_PAY' | 'SAMSUNG_PAY', nonce?: string, nonce_signature?: string): { provisioning_payload?: string | provision_response; }`\n\n**post** `/v1/cards/{card_token}/provision`\n\nAllow your cardholders to directly add payment cards to the device's digital wallet (e.g. Apple Pay) with one touch from your app.\n\nThis requires some additional setup and configuration. Please [Contact Us](https://lithic.com/contact) or your Customer Success representative for more information.\n\n\n### Parameters\n\n- `card_token: string`\n\n- `certificate?: string`\n Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activationData` in the response. Apple's public leaf certificate. Base64 encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers omitted. Provided by the device's wallet.\n\n- `client_device_id?: string`\n Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the card is on the Visa network. Stable device identification set by the wallet provider.\n\n- `client_wallet_account_id?: string`\n Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the card is on the Visa network. Consumer ID that identifies the wallet account holder entity.\n\n- `digital_wallet?: 'APPLE_PAY' | 'GOOGLE_PAY' | 'SAMSUNG_PAY'`\n Name of digital wallet provider.\n\n- `nonce?: string`\n Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activationData` in the response. Base64 cryptographic nonce provided by the device's wallet.\n\n- `nonce_signature?: string`\n Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activationData` in the response. Base64 cryptographic nonce provided by the device's wallet.\n\n### Returns\n\n- `{ provisioning_payload?: string | { activationData?: string; encryptedData?: string; ephemeralPublicKey?: string; }; }`\n\n - `provisioning_payload?: string | { activationData?: string; encryptedData?: string; ephemeralPublicKey?: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.cards.provision('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.cards.provision', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cards.provision('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n digital_wallet: 'GOOGLE_PAY',\n});\n\nconsole.log(response.provisioning_payload);", + }, + python: { + method: 'cards.provision', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cards.provision(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n digital_wallet="GOOGLE_PAY",\n)\nprint(response.provisioning_payload)', + }, + java: { + method: 'cards().provision', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardProvisionParams;\nimport com.lithic.api.models.CardProvisionResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardProvisionResponse response = client.cards().provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().provision', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardProvisionParams\nimport com.lithic.api.models.CardProvisionResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: CardProvisionResponse = client.cards().provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.Provision', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Cards.Provision(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardProvisionParams{\n\t\t\tDigitalWallet: lithic.F(lithic.CardProvisionParamsDigitalWalletGooglePay),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ProvisioningPayload)\n}\n', + }, + ruby: { + method: 'cards.provision', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.cards.provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/provision \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "digital_wallet": "GOOGLE_PAY"\n }\'', + }, + }, + }, + { + name: 'reissue', + endpoint: '/v1/cards/{card_token}/reissue', + httpMethod: 'post', + summary: 'Reissue physical card', + description: + 'Initiate print and shipment of a duplicate physical card (e.g. card is physically damaged). The PAN, expiry, and CVC2 will remain the same and the original card can continue to be used until the new card is activated.\nOnly applies to cards of type `PHYSICAL`. A card can be reissued or renewed a total of 8 times.', + stainlessPath: '(resource) cards > (method) reissue', + qualified: 'client.cards.reissue', + params: [ + 'card_token: string;', + 'carrier?: { qr_code_url?: string; };', + 'product_id?: string;', + 'shipping_address?: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; };', + "shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING';", + ], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## reissue\n\n`client.cards.reissue(card_token: string, carrier?: { qr_code_url?: string; }, product_id?: string, shipping_address?: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }, shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'): object`\n\n**post** `/v1/cards/{card_token}/reissue`\n\nInitiate print and shipment of a duplicate physical card (e.g. card is physically damaged). The PAN, expiry, and CVC2 will remain the same and the original card can continue to be used until the new card is activated.\nOnly applies to cards of type `PHYSICAL`. A card can be reissued or renewed a total of 8 times.\n\n### Parameters\n\n- `card_token: string`\n\n- `carrier?: { qr_code_url?: string; }`\n If omitted, the previous carrier will be used.\n - `qr_code_url?: string`\n QR code URL to display on the card carrier. The `qr_code_url` field requires your domain to be allowlisted by Lithic before use. Contact Support to configure your QR code domain\n\n- `product_id?: string`\n Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be configured with Lithic before use.\n\n\n- `shipping_address?: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }`\n If omitted, the previous shipping address will be used.\n - `address1: string`\n Valid USPS routable address.\n - `city: string`\n City\n - `country: string`\n Uppercase ISO 3166-1 alpha-3 three character abbreviation.\n - `first_name: string`\n Customer's first name. This will be the first name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `last_name: string`\n Customer's surname (family name). This will be the last name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `postal_code: string`\n Postal code (formerly zipcode). For US addresses, either five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.\n - `state: string`\n Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 characters for other countries.\n - `address2?: string`\n Unit number (if applicable).\n - `email?: string`\n Email address to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n - `line2_text?: string`\n Text to be printed on line two of the physical card. Use of this field requires additional permissions.\n - `phone_number?: string`\n Cardholder's phone number in E.164 format to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n\n- `shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'`\n Shipping method for the card. Only applies to cards of type PHYSICAL.\nUse of options besides `STANDARD` require additional permissions.\n\n* `STANDARD` - USPS regular mail or similar international option, with no tracking\n* `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with tracking\n* `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking\n* `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day shipping, with tracking\n* `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking\n* `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar international option, with tracking\n* `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and timeline are inherited from the parent bulk order.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.reissue('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.reissue', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.reissue('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n carrier: { qr_code_url: 'https://lithic.com/activate-card/1' },\n product_id: '100',\n shipping_address: {\n address1: '5 Broad Street',\n address2: 'Unit 5A',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Janet',\n last_name: 'Yellen',\n postal_code: '10001',\n state: 'NY',\n },\n shipping_method: 'STANDARD',\n});\n\nconsole.log(card);", + }, + python: { + method: 'cards.reissue', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.reissue(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n carrier={\n "qr_code_url": "https://lithic.com/activate-card/1"\n },\n product_id="100",\n shipping_address={\n "address1": "5 Broad Street",\n "address2": "Unit 5A",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Janet",\n "last_name": "Yellen",\n "postal_code": "10001",\n "state": "NY",\n },\n shipping_method="STANDARD",\n)\nprint(card)', + }, + java: { + method: 'cards().reissue', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardReissueParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Card card = client.cards().reissue("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().reissue', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardReissueParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val card: Card = client.cards().reissue("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.Reissue', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n\t"github.com/lithic-com/lithic-go/shared"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.Reissue(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardReissueParams{\n\t\t\tCarrier: lithic.F(shared.CarrierParam{\n\t\t\t\tQrCodeURL: lithic.F("https://lithic.com/activate-card/1"),\n\t\t\t}),\n\t\t\tProductID: lithic.F("100"),\n\t\t\tShippingAddress: lithic.F(shared.ShippingAddressParam{\n\t\t\t\tAddress1: lithic.F("5 Broad Street"),\n\t\t\t\tAddress2: lithic.F("Unit 5A"),\n\t\t\t\tCity: lithic.F("NEW YORK"),\n\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\tFirstName: lithic.F("Janet"),\n\t\t\t\tLastName: lithic.F("Yellen"),\n\t\t\t\tPostalCode: lithic.F("10001"),\n\t\t\t\tState: lithic.F("NY"),\n\t\t\t}),\n\t\t\tShippingMethod: lithic.F(lithic.CardReissueParamsShippingMethodStandard),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.reissue', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.reissue("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/reissue \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "carrier": {\n "qr_code_url": "https://lithic.com/activate-card/1"\n },\n "product_id": "100",\n "shipping_address": {\n "address1": "5 Broad Street",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Janet",\n "last_name": "Yellen",\n "postal_code": "10001",\n "state": "NY",\n "address2": "Unit 5A"\n },\n "shipping_method": "STANDARD"\n }\'', + }, + }, + }, + { + name: 'embed', + endpoint: '/v1/embed/card', + httpMethod: 'get', + summary: 'Embedded card UI', + description: + '**Deprecated.** Use the modern embedded card flow instead: create a session with `POST /v1/cards/{card_token}/embed` and render it via `GET /v1/embed`.\n\nHandling full card PANs and CVV codes requires that you comply with the Payment Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce their compliance obligations by leveraging our embedded card UI solution documented below.\n\nIn this setup, PANs and CVV codes are presented to the end-user via a card UI that we provide, optionally styled in the customer\'s branding using a specified css stylesheet. A user\'s browser makes the request directly to api.lithic.com, so card PANs and CVVs never touch the API customer\'s servers while full card data is displayed to their end-users. The response contains an HTML document (see Embedded Card UI or Changelog for upcoming changes in January). This means that the url for the request can be inserted straight into the `src` attribute of an iframe.\n\n```html\n\n```\n\nYou should compute the request payload on the server side. You can render it (or the whole iframe) on the server or make an ajax call from your front end code, but **do not ever embed your API key into front end code, as doing so introduces a serious security vulnerability**.\n', + stainlessPath: '(resource) cards > (method) embed', + qualified: 'client.cards.embed', + params: ['embed_request: string;', 'hmac: string;'], + response: 'string', + markdown: + "## embed\n\n`client.cards.embed(embed_request: string, hmac: string): string`\n\n**get** `/v1/embed/card`\n\n**Deprecated.** Use the modern embedded card flow instead: create a session with `POST /v1/cards/{card_token}/embed` and render it via `GET /v1/embed`.\n\nHandling full card PANs and CVV codes requires that you comply with the Payment Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce their compliance obligations by leveraging our embedded card UI solution documented below.\n\nIn this setup, PANs and CVV codes are presented to the end-user via a card UI that we provide, optionally styled in the customer's branding using a specified css stylesheet. A user's browser makes the request directly to api.lithic.com, so card PANs and CVVs never touch the API customer's servers while full card data is displayed to their end-users. The response contains an HTML document (see Embedded Card UI or Changelog for upcoming changes in January). This means that the url for the request can be inserted straight into the `src` attribute of an iframe.\n\n```html\n\n```\n\nYou should compute the request payload on the server side. You can render it (or the whole iframe) on the server or make an ajax call from your front end code, but **do not ever embed your API key into front end code, as doing so introduces a serious security vulnerability**.\n\n\n### Parameters\n\n- `embed_request: string`\n A base64 encoded JSON string of an EmbedRequest to specify which card to load.\n\n- `hmac: string`\n SHA256 HMAC of the embed_request JSON string with base64 digest.\n\n### Returns\n\n- `string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.cards.embed({ embed_request: 'embed_request', hmac: 'hmac' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.cards.embed', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cards.embed({ embed_request: 'embed_request', hmac: 'hmac' });\n\nconsole.log(response);", + }, + python: { + method: 'cards.embed', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cards.embed(\n embed_request="embed_request",\n hmac="hmac",\n)\nprint(response)', + }, + java: { + method: 'cards().embed', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardEmbedParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardEmbedParams params = CardEmbedParams.builder()\n .embedRequest("embed_request")\n .hmac("hmac")\n .build();\n String response = client.cards().embed(params);\n }\n}', + }, + kotlin: { + method: 'cards().embed', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardEmbedParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardEmbedParams = CardEmbedParams.builder()\n .embedRequest("embed_request")\n .hmac("hmac")\n .build()\n val response: String = client.cards().embed(params)\n}', + }, + go: { + method: 'client.Cards.Embed', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Cards.Embed(context.TODO(), lithic.CardEmbedParams{\n\t\tEmbedRequest: lithic.F("embed_request"),\n\t\tHmac: lithic.F("hmac"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + }, + ruby: { + method: 'cards.embed', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.cards.embed(embed_request: "embed_request", hmac: "hmac")\n\nputs(response)', + }, + http: { + example: 'curl https://api.lithic.com/v1/embed/card \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_spend_limits', + endpoint: '/v1/cards/{card_token}/spend_limits', + httpMethod: 'get', + summary: "Get card's available spend limit", + description: + "Get a Card's available spend limit, which is based on the spend limit configured on the Card and the amount already spent over the spend limit's duration. For example, if the Card has a monthly spend limit of $1000 configured, and has spent $600 in the last month, the available spend limit returned would be $400.", + stainlessPath: '(resource) cards > (method) retrieve_spend_limits', + qualified: 'client.cards.retrieveSpendLimits', + params: ['card_token: string;'], + response: + '{ available_spend_limit: { annually?: number; forever?: number; monthly?: number; }; spend_limit?: { annually?: number; forever?: number; monthly?: number; }; spend_velocity?: { annually?: number; forever?: number; monthly?: number; }; }', + markdown: + "## retrieve_spend_limits\n\n`client.cards.retrieveSpendLimits(card_token: string): { available_spend_limit: object; spend_limit?: object; spend_velocity?: object; }`\n\n**get** `/v1/cards/{card_token}/spend_limits`\n\nGet a Card's available spend limit, which is based on the spend limit configured on the Card and the amount already spent over the spend limit's duration. For example, if the Card has a monthly spend limit of $1000 configured, and has spent $600 in the last month, the available spend limit returned would be $400.\n\n### Parameters\n\n- `card_token: string`\n\n### Returns\n\n- `{ available_spend_limit: { annually?: number; forever?: number; monthly?: number; }; spend_limit?: { annually?: number; forever?: number; monthly?: number; }; spend_velocity?: { annually?: number; forever?: number; monthly?: number; }; }`\n\n - `available_spend_limit: { annually?: number; forever?: number; monthly?: number; }`\n - `spend_limit?: { annually?: number; forever?: number; monthly?: number; }`\n - `spend_velocity?: { annually?: number; forever?: number; monthly?: number; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst cardSpendLimits = await client.cards.retrieveSpendLimits('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(cardSpendLimits);\n```", + perLanguage: { + typescript: { + method: 'client.cards.retrieveSpendLimits', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst cardSpendLimits = await client.cards.retrieveSpendLimits(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(cardSpendLimits.available_spend_limit);", + }, + python: { + method: 'cards.retrieve_spend_limits', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard_spend_limits = client.cards.retrieve_spend_limits(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(card_spend_limits.available_spend_limit)', + }, + java: { + method: 'cards().retrieveSpendLimits', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardRetrieveSpendLimitsParams;\nimport com.lithic.api.models.CardSpendLimits;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardSpendLimits cardSpendLimits = client.cards().retrieveSpendLimits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().retrieveSpendLimits', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardRetrieveSpendLimitsParams\nimport com.lithic.api.models.CardSpendLimits\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val cardSpendLimits: CardSpendLimits = client.cards().retrieveSpendLimits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.GetSpendLimits', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcardSpendLimits, err := client.Cards.GetSpendLimits(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", cardSpendLimits.AvailableSpendLimit)\n}\n', + }, + ruby: { + method: 'cards.retrieve_spend_limits', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard_spend_limits = lithic.cards.retrieve_spend_limits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(card_spend_limits)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/spend_limits \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_signals', + endpoint: '/v1/cards/{card_token}/signals', + httpMethod: 'get', + summary: 'Fetch card signals', + description: + "Returns behavioral feature state derived from a card's transaction history.\n\nThese signals expose the same data used by behavioral rule attributes (e.g. `AMOUNT_Z_SCORE` with `scope: CARD`, `IS_NEW_COUNTRY` with `scope: CARD`) and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect feature values before writing rules and debug rule behavior.\n", + stainlessPath: '(resource) cards > (method) retrieve_signals', + qualified: 'client.cards.retrieveSignals', + params: ['card_token: string;'], + response: + '{ approved_txn_amount_m2: number; approved_txn_amount_m2_30d: number; approved_txn_amount_m2_7d: number; approved_txn_amount_m2_90d: number; approved_txn_count: number; approved_txn_count_30d: number; approved_txn_count_7d: number; approved_txn_count_90d: number; avg_transaction_amount: number; avg_transaction_amount_30d: number; avg_transaction_amount_7d: number; avg_transaction_amount_90d: number; distinct_country_count: number; distinct_mcc_count: number; first_txn_at: string; is_first_transaction: boolean; last_cp_country: string; last_cp_postal_code: string; last_cp_timestamp: string; last_txn_approved_at: string; seen_countries: string[]; seen_mccs: string[]; seen_merchants: string[]; stdev_transaction_amount: number; stdev_transaction_amount_30d: number; stdev_transaction_amount_7d: number; stdev_transaction_amount_90d: number; three_ds_success_count: number; three_ds_success_rate: number; three_ds_total_count: number; time_since_last_transaction_days: number; }', + markdown: + "## retrieve_signals\n\n`client.cards.retrieveSignals(card_token: string): { approved_txn_amount_m2: number; approved_txn_amount_m2_30d: number; approved_txn_amount_m2_7d: number; approved_txn_amount_m2_90d: number; approved_txn_count: number; approved_txn_count_30d: number; approved_txn_count_7d: number; approved_txn_count_90d: number; avg_transaction_amount: number; avg_transaction_amount_30d: number; avg_transaction_amount_7d: number; avg_transaction_amount_90d: number; distinct_country_count: number; distinct_mcc_count: number; first_txn_at: string; is_first_transaction: boolean; last_cp_country: string; last_cp_postal_code: string; last_cp_timestamp: string; last_txn_approved_at: string; seen_countries: string[]; seen_mccs: string[]; seen_merchants: string[]; stdev_transaction_amount: number; stdev_transaction_amount_30d: number; stdev_transaction_amount_7d: number; stdev_transaction_amount_90d: number; three_ds_success_count: number; three_ds_success_rate: number; three_ds_total_count: number; time_since_last_transaction_days: number; }`\n\n**get** `/v1/cards/{card_token}/signals`\n\nReturns behavioral feature state derived from a card's transaction history.\n\nThese signals expose the same data used by behavioral rule attributes (e.g. `AMOUNT_Z_SCORE` with `scope: CARD`, `IS_NEW_COUNTRY` with `scope: CARD`) and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect feature values before writing rules and debug rule behavior.\n\n\n### Parameters\n\n- `card_token: string`\n\n### Returns\n\n- `{ approved_txn_amount_m2: number; approved_txn_amount_m2_30d: number; approved_txn_amount_m2_7d: number; approved_txn_amount_m2_90d: number; approved_txn_count: number; approved_txn_count_30d: number; approved_txn_count_7d: number; approved_txn_count_90d: number; avg_transaction_amount: number; avg_transaction_amount_30d: number; avg_transaction_amount_7d: number; avg_transaction_amount_90d: number; distinct_country_count: number; distinct_mcc_count: number; first_txn_at: string; is_first_transaction: boolean; last_cp_country: string; last_cp_postal_code: string; last_cp_timestamp: string; last_txn_approved_at: string; seen_countries: string[]; seen_mccs: string[]; seen_merchants: string[]; stdev_transaction_amount: number; stdev_transaction_amount_30d: number; stdev_transaction_amount_7d: number; stdev_transaction_amount_90d: number; three_ds_success_count: number; three_ds_success_rate: number; three_ds_total_count: number; time_since_last_transaction_days: number; }`\n Behavioral feature state for a card or account derived from its transaction history.\n\nDerived statistical features (averages, standard deviations, z-scores) are computed using Welford's online algorithm over approved transactions. Average fields are null when fewer than 5 approved transactions have been recorded. Standard deviation fields are null when fewer than 30 approved transactions have been recorded.\n\n3DS fields (`three_ds_success_rate`, `three_ds_success_count`, `three_ds_total_count`) are card-scoped and will be null for account responses.\n\nRaw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are included so clients can compute their own transaction-specific derivations, such as checking whether a new transaction's country is in `seen_countries` to determine `is_new_country`, or computing a z-score using the raw mean and M2 values.\n\n - `approved_txn_amount_m2: number`\n - `approved_txn_amount_m2_30d: number`\n - `approved_txn_amount_m2_7d: number`\n - `approved_txn_amount_m2_90d: number`\n - `approved_txn_count: number`\n - `approved_txn_count_30d: number`\n - `approved_txn_count_7d: number`\n - `approved_txn_count_90d: number`\n - `avg_transaction_amount: number`\n - `avg_transaction_amount_30d: number`\n - `avg_transaction_amount_7d: number`\n - `avg_transaction_amount_90d: number`\n - `distinct_country_count: number`\n - `distinct_mcc_count: number`\n - `first_txn_at: string`\n - `is_first_transaction: boolean`\n - `last_cp_country: string`\n - `last_cp_postal_code: string`\n - `last_cp_timestamp: string`\n - `last_txn_approved_at: string`\n - `seen_countries: string[]`\n - `seen_mccs: string[]`\n - `seen_merchants: string[]`\n - `stdev_transaction_amount: number`\n - `stdev_transaction_amount_30d: number`\n - `stdev_transaction_amount_7d: number`\n - `stdev_transaction_amount_90d: number`\n - `three_ds_success_count: number`\n - `three_ds_success_rate: number`\n - `three_ds_total_count: number`\n - `time_since_last_transaction_days: number`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst signalsResponse = await client.cards.retrieveSignals('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(signalsResponse);\n```", + perLanguage: { + typescript: { + method: 'client.cards.retrieveSignals', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst signalsResponse = await client.cards.retrieveSignals('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(signalsResponse.approved_txn_amount_m2);", + }, + python: { + method: 'cards.retrieve_signals', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nsignals_response = client.cards.retrieve_signals(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(signals_response.approved_txn_amount_m2)', + }, + java: { + method: 'cards().retrieveSignals', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardRetrieveSignalsParams;\nimport com.lithic.api.models.SignalsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n SignalsResponse signalsResponse = client.cards().retrieveSignals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().retrieveSignals', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardRetrieveSignalsParams\nimport com.lithic.api.models.SignalsResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val signalsResponse: SignalsResponse = client.cards().retrieveSignals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.GetSignals', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tsignalsResponse, err := client.Cards.GetSignals(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", signalsResponse.ApprovedTxnAmountM2)\n}\n', + }, + ruby: { + method: 'cards.retrieve_signals', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nsignals_response = lithic.cards.retrieve_signals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(signals_response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/signals \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'renew', + endpoint: '/v1/cards/{card_token}/renew', + httpMethod: 'post', + summary: 'Renew a card', + description: + 'Applies to card types `PHYSICAL` and `VIRTUAL`.\nFor `PHYSICAL`, creates a new card with the same card token and PAN, but updated expiry and CVC2 code. The original card will keep working for card-present transactions until the new card is activated. For card-not-present transactions, the original card details (expiry, CVC2) will also keep working until the new card is activated.\nA `PHYSICAL` card can be reissued or renewed a total of 8 times.\nFor `VIRTUAL`, the card will retain the same card token and PAN and receive an updated expiry and CVC2 code.\n`product_id`, `shipping_method`, `shipping_address`, `carrier` are only relevant for renewing `PHYSICAL` cards.', + stainlessPath: '(resource) cards > (method) renew', + qualified: 'client.cards.renew', + params: [ + 'card_token: string;', + 'shipping_address: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; };', + 'carrier?: { qr_code_url?: string; };', + 'exp_month?: string;', + 'exp_year?: string;', + 'product_id?: string;', + "shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING';", + ], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## renew\n\n`client.cards.renew(card_token: string, shipping_address: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }, carrier?: { qr_code_url?: string; }, exp_month?: string, exp_year?: string, product_id?: string, shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'): object`\n\n**post** `/v1/cards/{card_token}/renew`\n\nApplies to card types `PHYSICAL` and `VIRTUAL`.\nFor `PHYSICAL`, creates a new card with the same card token and PAN, but updated expiry and CVC2 code. The original card will keep working for card-present transactions until the new card is activated. For card-not-present transactions, the original card details (expiry, CVC2) will also keep working until the new card is activated.\nA `PHYSICAL` card can be reissued or renewed a total of 8 times.\nFor `VIRTUAL`, the card will retain the same card token and PAN and receive an updated expiry and CVC2 code.\n`product_id`, `shipping_method`, `shipping_address`, `carrier` are only relevant for renewing `PHYSICAL` cards.\n\n### Parameters\n\n- `card_token: string`\n\n- `shipping_address: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }`\n The shipping address this card will be sent to.\n - `address1: string`\n Valid USPS routable address.\n - `city: string`\n City\n - `country: string`\n Uppercase ISO 3166-1 alpha-3 three character abbreviation.\n - `first_name: string`\n Customer's first name. This will be the first name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `last_name: string`\n Customer's surname (family name). This will be the last name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `postal_code: string`\n Postal code (formerly zipcode). For US addresses, either five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.\n - `state: string`\n Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 characters for other countries.\n - `address2?: string`\n Unit number (if applicable).\n - `email?: string`\n Email address to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n - `line2_text?: string`\n Text to be printed on line two of the physical card. Use of this field requires additional permissions.\n - `phone_number?: string`\n Cardholder's phone number in E.164 format to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n\n- `carrier?: { qr_code_url?: string; }`\n If omitted, the previous carrier will be used.\n - `qr_code_url?: string`\n QR code URL to display on the card carrier. The `qr_code_url` field requires your domain to be allowlisted by Lithic before use. Contact Support to configure your QR code domain\n\n- `exp_month?: string`\n Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an expiration date five years in the future will be generated. Five years is the maximum expiration date.\n\n- `exp_year?: string`\n Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an expiration date five years in the future will be generated. Five years is the maximum expiration date.\n\n- `product_id?: string`\n Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be configured with Lithic before use.\n\n\n- `shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'`\n Shipping method for the card. Only applies to cards of type PHYSICAL.\nUse of options besides `STANDARD` require additional permissions.\n\n* `STANDARD` - USPS regular mail or similar international option, with no tracking\n* `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with tracking\n* `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking\n* `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day shipping, with tracking\n* `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking\n* `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar international option, with tracking\n* `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and timeline are inherited from the parent bulk order.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.renew('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { shipping_address: {\n address1: '5 Broad Street',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Janet',\n last_name: 'Yellen',\n postal_code: '10001',\n state: 'NY',\n} });\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.renew', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.renew('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n shipping_address: {\n address1: '5 Broad Street',\n address2: 'Unit 5A',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Janet',\n last_name: 'Yellen',\n postal_code: '10001',\n state: 'NY',\n },\n carrier: { qr_code_url: 'https://lithic.com/activate-card/1' },\n product_id: '100',\n shipping_method: 'STANDARD',\n});\n\nconsole.log(card);", + }, + python: { + method: 'cards.renew', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.renew(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n shipping_address={\n "address1": "5 Broad Street",\n "address2": "Unit 5A",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Janet",\n "last_name": "Yellen",\n "postal_code": "10001",\n "state": "NY",\n },\n carrier={\n "qr_code_url": "https://lithic.com/activate-card/1"\n },\n product_id="100",\n shipping_method="STANDARD",\n)\nprint(card)', + }, + java: { + method: 'cards().renew', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardRenewParams;\nimport com.lithic.api.models.ShippingAddress;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardRenewParams params = CardRenewParams.builder()\n .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .shippingAddress(ShippingAddress.builder()\n .address1("5 Broad Street")\n .city("NEW YORK")\n .country("USA")\n .firstName("Janet")\n .lastName("Yellen")\n .postalCode("10001")\n .state("NY")\n .build())\n .build();\n Card card = client.cards().renew(params);\n }\n}', + }, + kotlin: { + method: 'cards().renew', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardRenewParams\nimport com.lithic.api.models.ShippingAddress\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardRenewParams = CardRenewParams.builder()\n .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .shippingAddress(ShippingAddress.builder()\n .address1("5 Broad Street")\n .city("NEW YORK")\n .country("USA")\n .firstName("Janet")\n .lastName("Yellen")\n .postalCode("10001")\n .state("NY")\n .build())\n .build()\n val card: Card = client.cards().renew(params)\n}', + }, + go: { + method: 'client.Cards.Renew', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n\t"github.com/lithic-com/lithic-go/shared"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.Renew(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardRenewParams{\n\t\t\tShippingAddress: lithic.F(shared.ShippingAddressParam{\n\t\t\t\tAddress1: lithic.F("5 Broad Street"),\n\t\t\t\tAddress2: lithic.F("Unit 5A"),\n\t\t\t\tCity: lithic.F("NEW YORK"),\n\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\tFirstName: lithic.F("Janet"),\n\t\t\t\tLastName: lithic.F("Yellen"),\n\t\t\t\tPostalCode: lithic.F("10001"),\n\t\t\t\tState: lithic.F("NY"),\n\t\t\t}),\n\t\t\tCarrier: lithic.F(shared.CarrierParam{\n\t\t\t\tQrCodeURL: lithic.F("https://lithic.com/activate-card/1"),\n\t\t\t}),\n\t\t\tProductID: lithic.F("100"),\n\t\t\tShippingMethod: lithic.F(lithic.CardRenewParamsShippingMethodStandard),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.renew', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.renew(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n shipping_address: {\n address1: "5 Broad Street",\n city: "NEW YORK",\n country: "USA",\n first_name: "Janet",\n last_name: "Yellen",\n postal_code: "10001",\n state: "NY"\n }\n)\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/renew \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "shipping_address": {\n "address1": "5 Broad Street",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Janet",\n "last_name": "Yellen",\n "postal_code": "10001",\n "state": "NY",\n "address2": "Unit 5A"\n },\n "carrier": {\n "qr_code_url": "https://lithic.com/activate-card/1"\n },\n "exp_month": "06",\n "exp_year": "2027",\n "product_id": "100",\n "shipping_method": "STANDARD"\n }\'', + }, + }, + }, + { + name: 'search_by_pan', + endpoint: '/v1/cards/search_by_pan', + httpMethod: 'post', + summary: 'Search for card by PAN', + description: + 'Get card configuration such as spend limit and state. Customers must be PCI compliant to use this endpoint. Please contact [support.lithic.com](https://support.lithic.com/) for questions.\n*Note: this is a `POST` endpoint because it is more secure to send sensitive data in a request body than in a URL.*', + stainlessPath: '(resource) cards > (method) search_by_pan', + qualified: 'client.cards.searchByPan', + params: ['pan: string;'], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## search_by_pan\n\n`client.cards.searchByPan(pan: string): object`\n\n**post** `/v1/cards/search_by_pan`\n\nGet card configuration such as spend limit and state. Customers must be PCI compliant to use this endpoint. Please contact [support.lithic.com](https://support.lithic.com/) for questions.\n*Note: this is a `POST` endpoint because it is more secure to send sensitive data in a request body than in a URL.*\n\n### Parameters\n\n- `pan: string`\n The PAN for the card being retrieved.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.searchByPan({ pan: '4111111289144142' });\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.searchByPan', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.searchByPan({ pan: '4111111289144142' });\n\nconsole.log(card);", + }, + python: { + method: 'cards.search_by_pan', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.search_by_pan(\n pan="4111111289144142",\n)\nprint(card)', + }, + java: { + method: 'cards().searchByPan', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardSearchByPanParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardSearchByPanParams params = CardSearchByPanParams.builder()\n .pan("4111111289144142")\n .build();\n Card card = client.cards().searchByPan(params);\n }\n}', + }, + kotlin: { + method: 'cards().searchByPan', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardSearchByPanParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardSearchByPanParams = CardSearchByPanParams.builder()\n .pan("4111111289144142")\n .build()\n val card: Card = client.cards().searchByPan(params)\n}', + }, + go: { + method: 'client.Cards.SearchByPan', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.SearchByPan(context.TODO(), lithic.CardSearchByPanParams{\n\t\tPan: lithic.F("4111111289144142"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.search_by_pan', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.search_by_pan(pan: "4111111289144142")\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/search_by_pan \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "pan": "4111111289144142"\n }\'', + }, + }, + }, + { + name: 'convert_physical', + endpoint: '/v1/cards/{card_token}/convert_physical', + httpMethod: 'post', + summary: 'Convert virtual to physical card', + description: + "Convert a virtual card into a physical card and manufacture it.\nCustomer must supply relevant fields for physical card creation including `product_id`, `carrier`, `shipping_method`, and `shipping_address`.\nThe card token will be unchanged. The card's type will be altered to `PHYSICAL`.\nThe card will be set to state `PENDING_FULFILLMENT` and fulfilled at next fulfillment cycle.\nVirtual cards created on card programs which do not support physical cards cannot be converted. The card program cannot be changed as part of the conversion. Cards must be in an `OPEN` state to be converted.\nOnly applies to cards of type `VIRTUAL` (or existing cards with deprecated types of `DIGITAL_WALLET` and `UNLOCKED`).", + stainlessPath: '(resource) cards > (method) convert_physical', + qualified: 'client.cards.convertPhysical', + params: [ + 'card_token: string;', + 'shipping_address: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; };', + 'carrier?: { qr_code_url?: string; };', + 'product_id?: string;', + "shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING';", + ], + response: + "{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }", + markdown: + "## convert_physical\n\n`client.cards.convertPhysical(card_token: string, shipping_address: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }, carrier?: { qr_code_url?: string; }, product_id?: string, shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'): object`\n\n**post** `/v1/cards/{card_token}/convert_physical`\n\nConvert a virtual card into a physical card and manufacture it.\nCustomer must supply relevant fields for physical card creation including `product_id`, `carrier`, `shipping_method`, and `shipping_address`.\nThe card token will be unchanged. The card's type will be altered to `PHYSICAL`.\nThe card will be set to state `PENDING_FULFILLMENT` and fulfilled at next fulfillment cycle.\nVirtual cards created on card programs which do not support physical cards cannot be converted. The card program cannot be changed as part of the conversion. Cards must be in an `OPEN` state to be converted.\nOnly applies to cards of type `VIRTUAL` (or existing cards with deprecated types of `DIGITAL_WALLET` and `UNLOCKED`).\n\n### Parameters\n\n- `card_token: string`\n\n- `shipping_address: { address1: string; city: string; country: string; first_name: string; last_name: string; postal_code: string; state: string; address2?: string; email?: string; line2_text?: string; phone_number?: string; }`\n The shipping address this card will be sent to.\n - `address1: string`\n Valid USPS routable address.\n - `city: string`\n City\n - `country: string`\n Uppercase ISO 3166-1 alpha-3 three character abbreviation.\n - `first_name: string`\n Customer's first name. This will be the first name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `last_name: string`\n Customer's surname (family name). This will be the last name printed on the physical card. The combined length of `first_name` and `last_name` may not exceed 25 characters.\n - `postal_code: string`\n Postal code (formerly zipcode). For US addresses, either five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.\n - `state: string`\n Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 characters for other countries.\n - `address2?: string`\n Unit number (if applicable).\n - `email?: string`\n Email address to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n - `line2_text?: string`\n Text to be printed on line two of the physical card. Use of this field requires additional permissions.\n - `phone_number?: string`\n Cardholder's phone number in E.164 format to be contacted for expedited shipping process purposes. Required if `shipping_method` is `EXPEDITED`.\n\n- `carrier?: { qr_code_url?: string; }`\n If omitted, the previous carrier will be used.\n - `qr_code_url?: string`\n QR code URL to display on the card carrier. The `qr_code_url` field requires your domain to be allowlisted by Lithic before use. Contact Support to configure your QR code domain\n\n- `product_id?: string`\n Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be configured with Lithic before use.\n\n\n- `shipping_method?: '2_DAY' | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' | 'STANDARD' | 'STANDARD_WITH_TRACKING'`\n Shipping method for the card. Only applies to cards of type PHYSICAL.\nUse of options besides `STANDARD` require additional permissions.\n\n* `STANDARD` - USPS regular mail or similar international option, with no tracking\n* `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with tracking\n* `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking\n* `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day shipping, with tracking\n* `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with tracking\n* `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight or similar international option, with tracking\n* `BULK` - Card will be shipped as part of a bulk fulfillment order. The shipping method and timeline are inherited from the parent bulk order.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; created: string; funding: { token: string; created: string; last_four: string; state: 'DELETED' | 'ENABLED' | 'PENDING'; type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS'; account_name?: string; nickname?: string; }; last_four: string; pin_status: 'OK' | 'BLOCKED' | 'NOT_SET'; spend_limit: number; spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; type: 'MERCHANT_LOCKED' | 'PHYSICAL' | 'SINGLE_USE' | 'VIRTUAL' | 'UNLOCKED' | 'DIGITAL_WALLET'; auth_rule_tokens?: string[]; bulk_order_token?: string; cardholder_currency?: string; comment?: string; digital_card_art_token?: string; exp_month?: string; exp_year?: string; hostname?: string; memo?: string; network_program_token?: string; pending_commands?: string[]; product_id?: string; replacement_for?: string; substatus?: string; }`\n Card details with potentially PCI sensitive information for Enterprise customers\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst card = await client.cards.convertPhysical('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { shipping_address: {\n address1: '5 Broad Street',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Janet',\n last_name: 'Yellen',\n postal_code: '10001',\n state: 'NY',\n} });\n\nconsole.log(card);\n```", + perLanguage: { + typescript: { + method: 'client.cards.convertPhysical', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.convertPhysical('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n shipping_address: {\n address1: '5 Broad Street',\n address2: 'Unit 5A',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Janet',\n last_name: 'Yellen',\n postal_code: '10001',\n state: 'NY',\n },\n carrier: { qr_code_url: 'https://lithic.com/activate-card/1' },\n product_id: '100',\n shipping_method: 'STANDARD',\n});\n\nconsole.log(card);", + }, + python: { + method: 'cards.convert_physical', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard = client.cards.convert_physical(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n shipping_address={\n "address1": "5 Broad Street",\n "address2": "Unit 5A",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Janet",\n "last_name": "Yellen",\n "postal_code": "10001",\n "state": "NY",\n },\n carrier={\n "qr_code_url": "https://lithic.com/activate-card/1"\n },\n product_id="100",\n shipping_method="STANDARD",\n)\nprint(card)', + }, + java: { + method: 'cards().convertPhysical', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardConvertPhysicalParams;\nimport com.lithic.api.models.ShippingAddress;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardConvertPhysicalParams params = CardConvertPhysicalParams.builder()\n .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .shippingAddress(ShippingAddress.builder()\n .address1("5 Broad Street")\n .city("NEW YORK")\n .country("USA")\n .firstName("Janet")\n .lastName("Yellen")\n .postalCode("10001")\n .state("NY")\n .build())\n .build();\n Card card = client.cards().convertPhysical(params);\n }\n}', + }, + kotlin: { + method: 'cards().convertPhysical', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardConvertPhysicalParams\nimport com.lithic.api.models.ShippingAddress\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardConvertPhysicalParams = CardConvertPhysicalParams.builder()\n .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .shippingAddress(ShippingAddress.builder()\n .address1("5 Broad Street")\n .city("NEW YORK")\n .country("USA")\n .firstName("Janet")\n .lastName("Yellen")\n .postalCode("10001")\n .state("NY")\n .build())\n .build()\n val card: Card = client.cards().convertPhysical(params)\n}', + }, + go: { + method: 'client.Cards.ConvertPhysical', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n\t"github.com/lithic-com/lithic-go/shared"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcard, err := client.Cards.ConvertPhysical(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardConvertPhysicalParams{\n\t\t\tShippingAddress: lithic.F(shared.ShippingAddressParam{\n\t\t\t\tAddress1: lithic.F("5 Broad Street"),\n\t\t\t\tAddress2: lithic.F("Unit 5A"),\n\t\t\t\tCity: lithic.F("NEW YORK"),\n\t\t\t\tCountry: lithic.F("USA"),\n\t\t\t\tFirstName: lithic.F("Janet"),\n\t\t\t\tLastName: lithic.F("Yellen"),\n\t\t\t\tPostalCode: lithic.F("10001"),\n\t\t\t\tState: lithic.F("NY"),\n\t\t\t}),\n\t\t\tCarrier: lithic.F(shared.CarrierParam{\n\t\t\t\tQrCodeURL: lithic.F("https://lithic.com/activate-card/1"),\n\t\t\t}),\n\t\t\tProductID: lithic.F("100"),\n\t\t\tShippingMethod: lithic.F(lithic.CardConvertPhysicalParamsShippingMethodStandard),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card)\n}\n', + }, + ruby: { + method: 'cards.convert_physical', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.convert_physical(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n shipping_address: {\n address1: "5 Broad Street",\n city: "NEW YORK",\n country: "USA",\n first_name: "Janet",\n last_name: "Yellen",\n postal_code: "10001",\n state: "NY"\n }\n)\n\nputs(card)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/convert_physical \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "shipping_address": {\n "address1": "5 Broad Street",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Janet",\n "last_name": "Yellen",\n "postal_code": "10001",\n "state": "NY",\n "address2": "Unit 5A"\n },\n "carrier": {\n "qr_code_url": "https://lithic.com/activate-card/1"\n },\n "product_id": "100",\n "shipping_method": "STANDARD"\n }\'', + }, + }, + }, + { + name: 'web_provision', + endpoint: '/v1/cards/{card_token}/web_provision', + httpMethod: 'post', + summary: 'Web Push Provision card (Digital Wallet)', + description: + "Allow your cardholders to directly add payment cards to the device's digital wallet from a browser on the web.\n\nThis requires some additional setup and configuration. Please [Contact Us](https://lithic.com/contact) or your Customer Success representative for more information.\n", + stainlessPath: '(resource) cards > (method) web_provision', + qualified: 'client.cards.webProvision', + params: [ + 'card_token: string;', + 'client_device_id?: string;', + 'client_wallet_account_id?: string;', + "digital_wallet?: 'APPLE_PAY' | 'GOOGLE_PAY';", + 'server_session_id?: string;', + ], + response: + '{ jws: { header?: { kid?: string; }; payload?: string; protected?: string; signature?: string; }; state: string; } | { google_opc?: string; tsp_opc?: string; }', + markdown: + "## web_provision\n\n`client.cards.webProvision(card_token: string, client_device_id?: string, client_wallet_account_id?: string, digital_wallet?: 'APPLE_PAY' | 'GOOGLE_PAY', server_session_id?: string): { jws: object; state: string; } | { google_opc?: string; tsp_opc?: string; }`\n\n**post** `/v1/cards/{card_token}/web_provision`\n\nAllow your cardholders to directly add payment cards to the device's digital wallet from a browser on the web.\n\nThis requires some additional setup and configuration. Please [Contact Us](https://lithic.com/contact) or your Customer Success representative for more information.\n\n\n### Parameters\n\n- `card_token: string`\n\n- `client_device_id?: string`\n Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provisioning device identifier required for the tokenization flow\n\n- `client_wallet_account_id?: string`\n Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provisioning wallet account identifier required for the tokenization flow\n\n- `digital_wallet?: 'APPLE_PAY' | 'GOOGLE_PAY'`\n Name of digital wallet provider.\n\n- `server_session_id?: string`\n Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provisioning session identifier required for the FPAN flow.\n\n### Returns\n\n- `{ jws: { header?: { kid?: string; }; payload?: string; protected?: string; signature?: string; }; state: string; } | { google_opc?: string; tsp_opc?: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.cards.webProvision('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.cards.webProvision', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.cards.webProvision('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n digital_wallet: 'APPLE_PAY',\n});\n\nconsole.log(response);", + }, + python: { + method: 'cards.web_provision', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.cards.web_provision(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n digital_wallet="APPLE_PAY",\n)\nprint(response)', + }, + java: { + method: 'cards().webProvision', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardWebProvisionParams;\nimport com.lithic.api.models.CardWebProvisionResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardWebProvisionResponse response = client.cards().webProvision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().webProvision', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardWebProvisionParams\nimport com.lithic.api.models.CardWebProvisionResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: CardWebProvisionResponse = client.cards().webProvision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.WebProvision', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Cards.WebProvision(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardWebProvisionParams{\n\t\t\tDigitalWallet: lithic.F(lithic.CardWebProvisionParamsDigitalWalletApplePay),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + }, + ruby: { + method: 'cards.web_provision', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.cards.web_provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/web_provision \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "digital_wallet": "APPLE_PAY"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/cards/{card_token}/balances', + httpMethod: 'get', + summary: 'Get card balances', + description: 'Get the balances for a given card.', + stainlessPath: '(resource) cards.balances > (method) list', + qualified: 'client.cards.balances.list', + params: ['card_token: string;', 'balance_date?: string;', 'last_transaction_event_token?: string;'], + response: + "{ token: string; available_amount: number; created: string; currency: string; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; updated: string; }", + markdown: + "## list\n\n`client.cards.balances.list(card_token: string, balance_date?: string, last_transaction_event_token?: string): { token: string; available_amount: number; created: string; currency: string; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; updated: string; }`\n\n**get** `/v1/cards/{card_token}/balances`\n\nGet the balances for a given card.\n\n### Parameters\n\n- `card_token: string`\n\n- `balance_date?: string`\n UTC date of the balance to retrieve. Defaults to latest available balance\n\n- `last_transaction_event_token?: string`\n Balance after a given financial event occured.\nFor example, passing the event_token of a $5 CARD_CLEARING financial event will return a balance decreased by $5\n\n\n### Returns\n\n- `{ token: string; available_amount: number; created: string; currency: string; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; updated: string; }`\n Balance of a Financial Account\n\n - `token: string`\n - `available_amount: number`\n - `created: string`\n - `currency: string`\n - `last_transaction_event_token: string`\n - `last_transaction_token: string`\n - `pending_amount: number`\n - `total_amount: number`\n - `type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const financialAccountBalance of client.cards.balances.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(financialAccountBalance);\n}\n```", + perLanguage: { + typescript: { + method: 'client.cards.balances.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const financialAccountBalance of client.cards.balances.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(financialAccountBalance.token);\n}", + }, + python: { + method: 'cards.balances.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.cards.balances.list(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'cards().balances().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardBalanceListPage;\nimport com.lithic.api.models.CardBalanceListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardBalanceListPage page = client.cards().balances().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().balances().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardBalanceListPage\nimport com.lithic.api.models.CardBalanceListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: CardBalanceListPage = client.cards().balances().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.Balances.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Cards.Balances.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardBalanceListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'cards.balances.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.cards.balances.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/balances \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/cards/{card_token}/financial_transactions', + httpMethod: 'get', + summary: 'List card financial transactions', + description: 'List the financial transactions for a given card.', + stainlessPath: '(resource) cards.financial_transactions > (method) list', + qualified: 'client.cards.financialTransactions.list', + params: [ + 'card_token: string;', + 'begin?: string;', + "category?: 'CARD' | 'TRANSFER';", + 'end?: string;', + 'ending_before?: string;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED';", + ], + response: + "{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }", + markdown: + "## list\n\n`client.cards.financialTransactions.list(card_token: string, begin?: string, category?: 'CARD' | 'TRANSFER', end?: string, ending_before?: string, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'): { token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: financial_event[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n**get** `/v1/cards/{card_token}/financial_transactions`\n\nList the financial transactions for a given card.\n\n### Parameters\n\n- `card_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `category?: 'CARD' | 'TRANSFER'`\n Financial Transaction category to be returned.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `result?: 'APPROVED' | 'DECLINED'`\n Financial Transaction result to be returned.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'`\n Financial Transaction status to be returned.\n\n### Returns\n\n- `{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n - `token: string`\n - `category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'`\n - `created: string`\n - `currency: string`\n - `descriptor: string`\n - `events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const financialTransaction of client.cards.financialTransactions.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(financialTransaction);\n}\n```", + perLanguage: { + typescript: { + method: 'client.cards.financialTransactions.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const financialTransaction of client.cards.financialTransactions.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(financialTransaction.token);\n}", + }, + python: { + method: 'cards.financial_transactions.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.cards.financial_transactions.list(\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'cards().financialTransactions().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardFinancialTransactionListPage;\nimport com.lithic.api.models.CardFinancialTransactionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardFinancialTransactionListPage page = client.cards().financialTransactions().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cards().financialTransactions().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardFinancialTransactionListPage\nimport com.lithic.api.models.CardFinancialTransactionListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: CardFinancialTransactionListPage = client.cards().financialTransactions().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Cards.FinancialTransactions.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Cards.FinancialTransactions.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardFinancialTransactionListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'cards.financial_transactions.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.cards.financial_transactions.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/financial_transactions \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/cards/{card_token}/financial_transactions/{financial_transaction_token}', + httpMethod: 'get', + summary: 'Get card financial transaction', + description: 'Get the card financial transaction for the provided token.', + stainlessPath: '(resource) cards.financial_transactions > (method) retrieve', + qualified: 'client.cards.financialTransactions.retrieve', + params: ['card_token: string;', 'financial_transaction_token: string;'], + response: + "{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }", + markdown: + "## retrieve\n\n`client.cards.financialTransactions.retrieve(card_token: string, financial_transaction_token: string): { token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: financial_event[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n**get** `/v1/cards/{card_token}/financial_transactions/{financial_transaction_token}`\n\nGet the card financial transaction for the provided token.\n\n### Parameters\n\n- `card_token: string`\n\n- `financial_transaction_token: string`\n\n### Returns\n\n- `{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n - `token: string`\n - `category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'`\n - `created: string`\n - `currency: string`\n - `descriptor: string`\n - `events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialTransaction = await client.cards.financialTransactions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { card_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(financialTransaction);\n```", + perLanguage: { + typescript: { + method: 'client.cards.financialTransactions.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialTransaction = await client.cards.financialTransactions.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { card_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(financialTransaction.token);", + }, + python: { + method: 'cards.financial_transactions.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_transaction = client.cards.financial_transactions.retrieve(\n financial_transaction_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(financial_transaction.token)', + }, + java: { + method: 'cards().financialTransactions().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardFinancialTransactionRetrieveParams;\nimport com.lithic.api.models.FinancialTransaction;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardFinancialTransactionRetrieveParams params = CardFinancialTransactionRetrieveParams.builder()\n .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n FinancialTransaction financialTransaction = client.cards().financialTransactions().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'cards().financialTransactions().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardFinancialTransactionRetrieveParams\nimport com.lithic.api.models.FinancialTransaction\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardFinancialTransactionRetrieveParams = CardFinancialTransactionRetrieveParams.builder()\n .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val financialTransaction: FinancialTransaction = client.cards().financialTransactions().retrieve(params)\n}', + }, + go: { + method: 'client.Cards.FinancialTransactions.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialTransaction, err := client.Cards.FinancialTransactions.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialTransaction.Token)\n}\n', + }, + ruby: { + method: 'cards.financial_transactions.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_transaction = lithic.cards.financial_transactions.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n card_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(financial_transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/cards/$CARD_TOKEN/financial_transactions/$FINANCIAL_TRANSACTION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'challenge_response', + endpoint: '/v1/card_authorizations/{event_token}/challenge_response', + httpMethod: 'post', + summary: 'Respond to Authorization Challenge', + description: + "Card program's response to Authorization Challenge.\nPrograms that have Authorization Challenges configured as Out of Band receive a [card_authorization.challenge](https://docs.lithic.com/reference/cardauthorizationchallengewebhook) webhook when an authorization attempt triggers a challenge.\nThe card program should respond using this endpoint after the cardholder completes the challenge.", + stainlessPath: '(resource) card_authorizations > (method) challenge_response', + qualified: 'client.cardAuthorizations.challengeResponse', + params: ['event_token: string;', "response: 'APPROVE' | 'DECLINE';"], + markdown: + "## challenge_response\n\n`client.cardAuthorizations.challengeResponse(event_token: string, response: 'APPROVE' | 'DECLINE'): void`\n\n**post** `/v1/card_authorizations/{event_token}/challenge_response`\n\nCard program's response to Authorization Challenge.\nPrograms that have Authorization Challenges configured as Out of Band receive a [card_authorization.challenge](https://docs.lithic.com/reference/cardauthorizationchallengewebhook) webhook when an authorization attempt triggers a challenge.\nThe card program should respond using this endpoint after the cardholder completes the challenge.\n\n### Parameters\n\n- `event_token: string`\n\n- `response: 'APPROVE' | 'DECLINE'`\n Whether the cardholder has approved or declined the issued challenge\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.cardAuthorizations.challengeResponse('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { response: 'APPROVE' })\n```", + perLanguage: { + typescript: { + method: 'client.cardAuthorizations.challengeResponse', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.cardAuthorizations.challengeResponse('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n response: 'APPROVE',\n});", + }, + python: { + method: 'card_authorizations.challenge_response', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.card_authorizations.challenge_response(\n event_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n response="APPROVE",\n)', + }, + java: { + method: 'cardAuthorizations().challengeResponse', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardAuthorizationChallengeResponseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardAuthorizationChallengeResponseParams params = CardAuthorizationChallengeResponseParams.builder()\n .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .response(CardAuthorizationChallengeResponseParams.Response.APPROVE)\n .build();\n client.cardAuthorizations().challengeResponse(params);\n }\n}', + }, + kotlin: { + method: 'cardAuthorizations().challengeResponse', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardAuthorizationChallengeResponseParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardAuthorizationChallengeResponseParams = CardAuthorizationChallengeResponseParams.builder()\n .eventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .response(CardAuthorizationChallengeResponseParams.Response.APPROVE)\n .build()\n client.cardAuthorizations().challengeResponse(params)\n}', + }, + go: { + method: 'client.CardAuthorizations.ChallengeResponse', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.CardAuthorizations.ChallengeResponse(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardAuthorizationChallengeResponseParams{\n\t\t\tResponse: lithic.F(lithic.CardAuthorizationChallengeResponseParamsResponseApprove),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'card_authorizations.challenge_response', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.card_authorizations.challenge_response("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", response: :APPROVE)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/card_authorizations/$EVENT_TOKEN/challenge_response \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "response": "APPROVE"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/card_bulk_orders', + httpMethod: 'get', + summary: 'List bulk orders', + description: 'List bulk orders for physical card shipments', + stainlessPath: '(resource) card_bulk_orders > (method) list', + qualified: 'client.cardBulkOrders.list', + params: [ + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }", + markdown: + "## list\n\n`client.cardBulkOrders.list(begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n\n**get** `/v1/card_bulk_orders`\n\nList bulk orders for physical card shipments\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n Represents a bulk order for physical card shipments\n\n - `token: string`\n - `card_tokens: string[]`\n - `created: string`\n - `customer_product_id: string`\n - `shipping_address: object`\n - `shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'`\n - `status: 'OPEN' | 'LOCKED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const cardBulkOrder of client.cardBulkOrders.list()) {\n console.log(cardBulkOrder);\n}\n```", + perLanguage: { + typescript: { + method: 'client.cardBulkOrders.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const cardBulkOrder of client.cardBulkOrders.list()) {\n console.log(cardBulkOrder.customer_product_id);\n}", + }, + python: { + method: 'card_bulk_orders.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.card_bulk_orders.list()\npage = page.data[0]\nprint(page.customer_product_id)', + }, + java: { + method: 'cardBulkOrders().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardBulkOrderListPage;\nimport com.lithic.api.models.CardBulkOrderListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardBulkOrderListPage page = client.cardBulkOrders().list();\n }\n}', + }, + kotlin: { + method: 'cardBulkOrders().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardBulkOrderListPage\nimport com.lithic.api.models.CardBulkOrderListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: CardBulkOrderListPage = client.cardBulkOrders().list()\n}', + }, + go: { + method: 'client.CardBulkOrders.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.CardBulkOrders.List(context.TODO(), lithic.CardBulkOrderListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'card_bulk_orders.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.card_bulk_orders.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/card_bulk_orders \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/card_bulk_orders', + httpMethod: 'post', + summary: 'Create bulk order', + description: + 'Create a new bulk order for physical card shipments. Cards can be added to the order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your Customer Success Manager and card personalization bureau to ensure bulk shipping is supported for your program.', + stainlessPath: '(resource) card_bulk_orders > (method) create', + qualified: 'client.cardBulkOrders.create', + params: [ + 'customer_product_id: string;', + 'shipping_address: object;', + "shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS';", + ], + response: + "{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }", + markdown: + "## create\n\n`client.cardBulkOrders.create(customer_product_id: string, shipping_address: object, shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'): { token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n\n**post** `/v1/card_bulk_orders`\n\nCreate a new bulk order for physical card shipments. Cards can be added to the order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work with your Customer Success Manager and card personalization bureau to ensure bulk shipping is supported for your program.\n\n### Parameters\n\n- `customer_product_id: string`\n Customer-specified product configuration for physical card manufacturing. This must be configured with Lithic before use\n\n- `shipping_address: object`\n Shipping address for all cards in this bulk order\n\n- `shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'`\n Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and BULK_EXPRESS are only available with Perfect Plastic Printing\n\n### Returns\n\n- `{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n Represents a bulk order for physical card shipments\n\n - `token: string`\n - `card_tokens: string[]`\n - `created: string`\n - `customer_product_id: string`\n - `shipping_address: object`\n - `shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'`\n - `status: 'OPEN' | 'LOCKED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst cardBulkOrder = await client.cardBulkOrders.create({\n customer_product_id: 'custom-card-design-123',\n shipping_address: {\n address1: '123 Main Street',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Johnny',\n last_name: 'Appleseed',\n postal_code: '10001',\n state: 'NY',\n},\n shipping_method: 'BULK_EXPEDITED',\n});\n\nconsole.log(cardBulkOrder);\n```", + perLanguage: { + typescript: { + method: 'client.cardBulkOrders.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst cardBulkOrder = await client.cardBulkOrders.create({\n customer_product_id: 'custom-card-design-123',\n shipping_address: {\n address1: '123 Main Street',\n city: 'NEW YORK',\n country: 'USA',\n first_name: 'Johnny',\n last_name: 'Appleseed',\n postal_code: '10001',\n state: 'NY',\n },\n shipping_method: 'BULK_EXPEDITED',\n});\n\nconsole.log(cardBulkOrder.customer_product_id);", + }, + python: { + method: 'card_bulk_orders.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard_bulk_order = client.card_bulk_orders.create(\n customer_product_id="custom-card-design-123",\n shipping_address={\n "address1": "123 Main Street",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Johnny",\n "last_name": "Appleseed",\n "postal_code": "10001",\n "state": "NY",\n },\n shipping_method="BULK_EXPEDITED",\n)\nprint(card_bulk_order.customer_product_id)', + }, + java: { + method: 'cardBulkOrders().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.core.JsonValue;\nimport com.lithic.api.models.CardBulkOrder;\nimport com.lithic.api.models.CardBulkOrderCreateParams;\nimport java.util.Map;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardBulkOrderCreateParams params = CardBulkOrderCreateParams.builder()\n .customerProductId("custom-card-design-123")\n .shippingAddress(JsonValue.from(Map.of(\n "address1",\n "123 Main Street",\n "city",\n "NEW YORK",\n "country",\n "USA",\n "first_name",\n "Johnny",\n "last_name",\n "Appleseed",\n "postal_code",\n "10001",\n "state",\n "NY"\n )))\n .shippingMethod(CardBulkOrderCreateParams.ShippingMethod.BULK_EXPEDITED)\n .build();\n CardBulkOrder cardBulkOrder = client.cardBulkOrders().create(params);\n }\n}', + }, + kotlin: { + method: 'cardBulkOrders().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.core.JsonValue\nimport com.lithic.api.models.CardBulkOrder\nimport com.lithic.api.models.CardBulkOrderCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardBulkOrderCreateParams = CardBulkOrderCreateParams.builder()\n .customerProductId("custom-card-design-123")\n .shippingAddress(JsonValue.from(mapOf(\n "address1" to "123 Main Street",\n "city" to "NEW YORK",\n "country" to "USA",\n "first_name" to "Johnny",\n "last_name" to "Appleseed",\n "postal_code" to "10001",\n "state" to "NY",\n )))\n .shippingMethod(CardBulkOrderCreateParams.ShippingMethod.BULK_EXPEDITED)\n .build()\n val cardBulkOrder: CardBulkOrder = client.cardBulkOrders().create(params)\n}', + }, + go: { + method: 'client.CardBulkOrders.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcardBulkOrder, err := client.CardBulkOrders.New(context.TODO(), lithic.CardBulkOrderNewParams{\n\t\tCustomerProductID: lithic.F("custom-card-design-123"),\n\t\tShippingAddress: lithic.F[any](map[string]interface{}{\n\t\t\t"address1": "123 Main Street",\n\t\t\t"city": "NEW YORK",\n\t\t\t"country": "USA",\n\t\t\t"first_name": "Johnny",\n\t\t\t"last_name": "Appleseed",\n\t\t\t"postal_code": "10001",\n\t\t\t"state": "NY",\n\t\t}),\n\t\tShippingMethod: lithic.F(lithic.CardBulkOrderNewParamsShippingMethodBulkExpedited),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", cardBulkOrder.CustomerProductID)\n}\n', + }, + ruby: { + method: 'card_bulk_orders.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard_bulk_order = lithic.card_bulk_orders.create(\n customer_product_id: "custom-card-design-123",\n shipping_address: {\n address1: "123 Main Street",\n city: "NEW YORK",\n country: "USA",\n first_name: "Johnny",\n last_name: "Appleseed",\n postal_code: "10001",\n state: "NY"\n },\n shipping_method: :BULK_EXPEDITED\n)\n\nputs(card_bulk_order)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/card_bulk_orders \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "customer_product_id": "custom-card-design-123",\n "shipping_address": {\n "address1": "123 Main Street",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Johnny",\n "last_name": "Appleseed",\n "postal_code": "10001",\n "state": "NY"\n },\n "shipping_method": "BULK_EXPEDITED"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/card_bulk_orders/{bulk_order_token}', + httpMethod: 'get', + summary: 'Get bulk order', + description: 'Retrieve a specific bulk order by token', + stainlessPath: '(resource) card_bulk_orders > (method) retrieve', + qualified: 'client.cardBulkOrders.retrieve', + params: ['bulk_order_token: string;'], + response: + "{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }", + markdown: + "## retrieve\n\n`client.cardBulkOrders.retrieve(bulk_order_token: string): { token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n\n**get** `/v1/card_bulk_orders/{bulk_order_token}`\n\nRetrieve a specific bulk order by token\n\n### Parameters\n\n- `bulk_order_token: string`\n\n### Returns\n\n- `{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n Represents a bulk order for physical card shipments\n\n - `token: string`\n - `card_tokens: string[]`\n - `created: string`\n - `customer_product_id: string`\n - `shipping_address: object`\n - `shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'`\n - `status: 'OPEN' | 'LOCKED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst cardBulkOrder = await client.cardBulkOrders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(cardBulkOrder);\n```", + perLanguage: { + typescript: { + method: 'client.cardBulkOrders.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst cardBulkOrder = await client.cardBulkOrders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(cardBulkOrder.customer_product_id);", + }, + python: { + method: 'card_bulk_orders.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard_bulk_order = client.card_bulk_orders.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(card_bulk_order.customer_product_id)', + }, + java: { + method: 'cardBulkOrders().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardBulkOrder;\nimport com.lithic.api.models.CardBulkOrderRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardBulkOrder cardBulkOrder = client.cardBulkOrders().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cardBulkOrders().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardBulkOrder\nimport com.lithic.api.models.CardBulkOrderRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val cardBulkOrder: CardBulkOrder = client.cardBulkOrders().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.CardBulkOrders.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcardBulkOrder, err := client.CardBulkOrders.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", cardBulkOrder.CustomerProductID)\n}\n', + }, + ruby: { + method: 'card_bulk_orders.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard_bulk_order = lithic.card_bulk_orders.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(card_bulk_order)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/card_bulk_orders/$BULK_ORDER_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/card_bulk_orders/{bulk_order_token}', + httpMethod: 'patch', + summary: 'Update bulk order', + description: + 'Update a bulk order. Primarily used to lock the order, preventing additional cards from being added', + stainlessPath: '(resource) card_bulk_orders > (method) update', + qualified: 'client.cardBulkOrders.update', + params: ['bulk_order_token: string;', "status: 'LOCKED';"], + response: + "{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }", + markdown: + "## update\n\n`client.cardBulkOrders.update(bulk_order_token: string, status: 'LOCKED'): { token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n\n**patch** `/v1/card_bulk_orders/{bulk_order_token}`\n\nUpdate a bulk order. Primarily used to lock the order, preventing additional cards from being added\n\n### Parameters\n\n- `bulk_order_token: string`\n\n- `status: 'LOCKED'`\n Status to update the bulk order to. Use LOCKED to finalize the order\n\n### Returns\n\n- `{ token: string; card_tokens: string[]; created: string; customer_product_id: string; shipping_address: object; shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; status: 'OPEN' | 'LOCKED'; updated: string; }`\n Represents a bulk order for physical card shipments\n\n - `token: string`\n - `card_tokens: string[]`\n - `created: string`\n - `customer_product_id: string`\n - `shipping_address: object`\n - `shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'`\n - `status: 'OPEN' | 'LOCKED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst cardBulkOrder = await client.cardBulkOrders.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { status: 'LOCKED' });\n\nconsole.log(cardBulkOrder);\n```", + perLanguage: { + typescript: { + method: 'client.cardBulkOrders.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst cardBulkOrder = await client.cardBulkOrders.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n status: 'LOCKED',\n});\n\nconsole.log(cardBulkOrder.customer_product_id);", + }, + python: { + method: 'card_bulk_orders.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard_bulk_order = client.card_bulk_orders.update(\n bulk_order_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n status="LOCKED",\n)\nprint(card_bulk_order.customer_product_id)', + }, + java: { + method: 'cardBulkOrders().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardBulkOrder;\nimport com.lithic.api.models.CardBulkOrderUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardBulkOrderUpdateParams params = CardBulkOrderUpdateParams.builder()\n .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .status(CardBulkOrderUpdateParams.Status.LOCKED)\n .build();\n CardBulkOrder cardBulkOrder = client.cardBulkOrders().update(params);\n }\n}', + }, + kotlin: { + method: 'cardBulkOrders().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardBulkOrder\nimport com.lithic.api.models.CardBulkOrderUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CardBulkOrderUpdateParams = CardBulkOrderUpdateParams.builder()\n .bulkOrderToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .status(CardBulkOrderUpdateParams.Status.LOCKED)\n .build()\n val cardBulkOrder: CardBulkOrder = client.cardBulkOrders().update(params)\n}', + }, + go: { + method: 'client.CardBulkOrders.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcardBulkOrder, err := client.CardBulkOrders.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.CardBulkOrderUpdateParams{\n\t\t\tStatus: lithic.F(lithic.CardBulkOrderUpdateParamsStatusLocked),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", cardBulkOrder.CustomerProductID)\n}\n', + }, + ruby: { + method: 'card_bulk_orders.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard_bulk_order = lithic.card_bulk_orders.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", status: :LOCKED)\n\nputs(card_bulk_order)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/card_bulk_orders/$BULK_ORDER_TOKEN \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "status": "LOCKED"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/balances', + httpMethod: 'get', + summary: 'List balances', + description: 'Get the balances for a program, business, or a given end-user account', + stainlessPath: '(resource) balances > (method) list', + qualified: 'client.balances.list', + params: [ + 'account_token?: string;', + 'balance_date?: string;', + 'business_account_token?: string;', + "financial_account_type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY';", + ], + response: + "{ available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }", + markdown: + "## list\n\n`client.balances.list(account_token?: string, balance_date?: string, business_account_token?: string, financial_account_type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'): { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }`\n\n**get** `/v1/balances`\n\nGet the balances for a program, business, or a given end-user account\n\n### Parameters\n\n- `account_token?: string`\n List balances for all financial accounts of a given account_token.\n\n- `balance_date?: string`\n UTC date and time of the balances to retrieve. Defaults to latest available balances\n\n- `business_account_token?: string`\n List balances for all financial accounts of a given business_account_token.\n\n- `financial_account_type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'`\n List balances for a given Financial Account type.\n\n### Returns\n\n- `{ available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }`\n Balance\n\n - `available_amount: number`\n - `created: string`\n - `currency: string`\n - `financial_account_token: string`\n - `financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'`\n - `last_transaction_event_token: string`\n - `last_transaction_token: string`\n - `pending_amount: number`\n - `total_amount: number`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const balance of client.balances.list()) {\n console.log(balance);\n}\n```", + perLanguage: { + typescript: { + method: 'client.balances.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const balance of client.balances.list()) {\n console.log(balance.available_amount);\n}", + }, + python: { + method: 'balances.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.balances.list()\npage = page.data[0]\nprint(page.available_amount)', + }, + java: { + method: 'balances().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.BalanceListPage;\nimport com.lithic.api.models.BalanceListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BalanceListPage page = client.balances().list();\n }\n}', + }, + kotlin: { + method: 'balances().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.BalanceListPage\nimport com.lithic.api.models.BalanceListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: BalanceListPage = client.balances().list()\n}', + }, + go: { + method: 'client.Balances.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Balances.List(context.TODO(), lithic.BalanceListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'balances.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.balances.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/balances \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/disputes', + httpMethod: 'get', + summary: 'List chargeback requests', + description: 'List chargeback requests.', + stainlessPath: '(resource) disputes > (method) list', + qualified: 'client.disputes.list', + params: [ + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + 'status?: string;', + 'transaction_tokens?: string[];', + ], + response: + '{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }', + markdown: + "## list\n\n`client.disputes.list(begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string, status?: string, transaction_tokens?: string[]): { token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n\n**get** `/v1/disputes`\n\nList chargeback requests.\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: string`\n Filter by status.\n\n- `transaction_tokens?: string[]`\n Transaction tokens to filter by.\n\n### Returns\n\n- `{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n Dispute.\n\n - `token: string`\n - `amount: number`\n - `arbitration_date: string`\n - `created: string`\n - `customer_filed_date: string`\n - `customer_note: string`\n - `network_claim_ids: string[]`\n - `network_filed_date: string`\n - `network_reason_code: string`\n - `prearbitration_date: string`\n - `primary_claim_id: string`\n - `reason: string`\n - `representment_date: string`\n - `resolution_date: string`\n - `resolution_note: string`\n - `resolution_reason: string`\n - `status: string`\n - `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const dispute of client.disputes.list()) {\n console.log(dispute);\n}\n```", + perLanguage: { + typescript: { + method: 'client.disputes.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const dispute of client.disputes.list()) {\n console.log(dispute.network_claim_ids);\n}", + }, + python: { + method: 'disputes.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.disputes.list()\npage = page.data[0]\nprint(page.network_claim_ids)', + }, + java: { + method: 'disputes().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputeListPage;\nimport com.lithic.api.models.DisputeListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeListPage page = client.disputes().list();\n }\n}', + }, + kotlin: { + method: 'disputes().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputeListPage\nimport com.lithic.api.models.DisputeListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: DisputeListPage = client.disputes().list()\n}', + }, + go: { + method: 'client.Disputes.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Disputes.List(context.TODO(), lithic.DisputeListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'disputes.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.disputes.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/disputes \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/disputes', + httpMethod: 'post', + summary: 'Request chargeback', + description: 'Request a chargeback.', + stainlessPath: '(resource) disputes > (method) create', + qualified: 'client.disputes.create', + params: [ + 'amount: number;', + 'reason: string;', + 'transaction_token: string;', + 'customer_filed_date?: string;', + 'customer_note?: string;', + ], + response: + '{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }', + markdown: + "## create\n\n`client.disputes.create(amount: number, reason: string, transaction_token: string, customer_filed_date?: string, customer_note?: string): { token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n\n**post** `/v1/disputes`\n\nRequest a chargeback.\n\n### Parameters\n\n- `amount: number`\n Amount for chargeback\n\n- `reason: string`\n Reason for chargeback\n\n- `transaction_token: string`\n Transaction for chargeback\n\n- `customer_filed_date?: string`\n Date the customer filed the chargeback request\n\n- `customer_note?: string`\n Customer description\n\n### Returns\n\n- `{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n Dispute.\n\n - `token: string`\n - `amount: number`\n - `arbitration_date: string`\n - `created: string`\n - `customer_filed_date: string`\n - `customer_note: string`\n - `network_claim_ids: string[]`\n - `network_filed_date: string`\n - `network_reason_code: string`\n - `prearbitration_date: string`\n - `primary_claim_id: string`\n - `reason: string`\n - `representment_date: string`\n - `resolution_date: string`\n - `resolution_note: string`\n - `resolution_reason: string`\n - `status: string`\n - `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst dispute = await client.disputes.create({\n amount: 10000,\n reason: 'FRAUD_CARD_PRESENT',\n transaction_token: '12345624-aa69-4cbc-a946-30d90181b621',\n});\n\nconsole.log(dispute);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst dispute = await client.disputes.create({\n amount: 10000,\n reason: 'FRAUD_CARD_PRESENT',\n transaction_token: '12345624-aa69-4cbc-a946-30d90181b621',\n customer_filed_date: '2021-06-28T22:53:15Z',\n});\n\nconsole.log(dispute.network_claim_ids);", + }, + python: { + method: 'disputes.create', + example: + 'import os\nfrom datetime import datetime\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute = client.disputes.create(\n amount=10000,\n reason="FRAUD_CARD_PRESENT",\n transaction_token="12345624-aa69-4cbc-a946-30d90181b621",\n customer_filed_date=datetime.fromisoformat("2021-06-28T22:53:15"),\n)\nprint(dispute.network_claim_ids)', + }, + java: { + method: 'disputes().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Dispute;\nimport com.lithic.api.models.DisputeCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeCreateParams params = DisputeCreateParams.builder()\n .amount(10000L)\n .reason(DisputeCreateParams.Reason.FRAUD_CARD_PRESENT)\n .transactionToken("12345624-aa69-4cbc-a946-30d90181b621")\n .build();\n Dispute dispute = client.disputes().create(params);\n }\n}', + }, + kotlin: { + method: 'disputes().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Dispute\nimport com.lithic.api.models.DisputeCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: DisputeCreateParams = DisputeCreateParams.builder()\n .amount(10000L)\n .reason(DisputeCreateParams.Reason.FRAUD_CARD_PRESENT)\n .transactionToken("12345624-aa69-4cbc-a946-30d90181b621")\n .build()\n val dispute: Dispute = client.disputes().create(params)\n}', + }, + go: { + method: 'client.Disputes.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdispute, err := client.Disputes.New(context.TODO(), lithic.DisputeNewParams{\n\t\tAmount: lithic.F(int64(10000)),\n\t\tReason: lithic.F(lithic.DisputeNewParamsReasonFraudCardPresent),\n\t\tTransactionToken: lithic.F("12345624-aa69-4cbc-a946-30d90181b621"),\n\t\tCustomerFiledDate: lithic.F(time.Now()),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", dispute.NetworkClaimIDs)\n}\n', + }, + ruby: { + method: 'disputes.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute = lithic.disputes.create(\n amount: 10000,\n reason: :FRAUD_CARD_PRESENT,\n transaction_token: "12345624-aa69-4cbc-a946-30d90181b621"\n)\n\nputs(dispute)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 10000,\n "reason": "FRAUD_CARD_PRESENT",\n "transaction_token": "12345624-aa69-4cbc-a946-30d90181b621",\n "customer_filed_date": "2021-06-28T22:53:15Z"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/disputes/{dispute_token}', + httpMethod: 'get', + summary: 'Get chargeback request', + description: 'Get chargeback request.', + stainlessPath: '(resource) disputes > (method) retrieve', + qualified: 'client.disputes.retrieve', + params: ['dispute_token: string;'], + response: + '{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }', + markdown: + "## retrieve\n\n`client.disputes.retrieve(dispute_token: string): { token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n\n**get** `/v1/disputes/{dispute_token}`\n\nGet chargeback request.\n\n### Parameters\n\n- `dispute_token: string`\n\n### Returns\n\n- `{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n Dispute.\n\n - `token: string`\n - `amount: number`\n - `arbitration_date: string`\n - `created: string`\n - `customer_filed_date: string`\n - `customer_note: string`\n - `network_claim_ids: string[]`\n - `network_filed_date: string`\n - `network_reason_code: string`\n - `prearbitration_date: string`\n - `primary_claim_id: string`\n - `reason: string`\n - `representment_date: string`\n - `resolution_date: string`\n - `resolution_note: string`\n - `resolution_reason: string`\n - `status: string`\n - `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst dispute = await client.disputes.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(dispute);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst dispute = await client.disputes.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(dispute.network_claim_ids);", + }, + python: { + method: 'disputes.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute = client.disputes.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute.network_claim_ids)', + }, + java: { + method: 'disputes().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Dispute;\nimport com.lithic.api.models.DisputeRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Dispute dispute = client.disputes().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'disputes().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Dispute\nimport com.lithic.api.models.DisputeRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val dispute: Dispute = client.disputes().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Disputes.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdispute, err := client.Disputes.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", dispute.NetworkClaimIDs)\n}\n', + }, + ruby: { + method: 'disputes.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute = lithic.disputes.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(dispute)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/disputes/{dispute_token}', + httpMethod: 'delete', + summary: 'Withdraw chargeback request', + description: 'Withdraw chargeback request.', + stainlessPath: '(resource) disputes > (method) delete', + qualified: 'client.disputes.delete', + params: ['dispute_token: string;'], + response: + '{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }', + markdown: + "## delete\n\n`client.disputes.delete(dispute_token: string): { token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n\n**delete** `/v1/disputes/{dispute_token}`\n\nWithdraw chargeback request.\n\n### Parameters\n\n- `dispute_token: string`\n\n### Returns\n\n- `{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n Dispute.\n\n - `token: string`\n - `amount: number`\n - `arbitration_date: string`\n - `created: string`\n - `customer_filed_date: string`\n - `customer_note: string`\n - `network_claim_ids: string[]`\n - `network_filed_date: string`\n - `network_reason_code: string`\n - `prearbitration_date: string`\n - `primary_claim_id: string`\n - `reason: string`\n - `representment_date: string`\n - `resolution_date: string`\n - `resolution_note: string`\n - `resolution_reason: string`\n - `status: string`\n - `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst dispute = await client.disputes.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(dispute);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst dispute = await client.disputes.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(dispute.network_claim_ids);", + }, + python: { + method: 'disputes.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute = client.disputes.delete(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute.network_claim_ids)', + }, + java: { + method: 'disputes().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Dispute;\nimport com.lithic.api.models.DisputeDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Dispute dispute = client.disputes().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'disputes().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Dispute\nimport com.lithic.api.models.DisputeDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val dispute: Dispute = client.disputes().delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Disputes.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdispute, err := client.Disputes.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", dispute.NetworkClaimIDs)\n}\n', + }, + ruby: { + method: 'disputes.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute = lithic.disputes.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(dispute)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/disputes/{dispute_token}', + httpMethod: 'patch', + summary: 'Update chargeback request', + description: 'Update chargeback request. Can only be modified if status is `NEW`.', + stainlessPath: '(resource) disputes > (method) update', + qualified: 'client.disputes.update', + params: [ + 'dispute_token: string;', + 'amount?: number;', + 'customer_filed_date?: string;', + 'customer_note?: string;', + 'reason?: string;', + ], + response: + '{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }', + markdown: + "## update\n\n`client.disputes.update(dispute_token: string, amount?: number, customer_filed_date?: string, customer_note?: string, reason?: string): { token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n\n**patch** `/v1/disputes/{dispute_token}`\n\nUpdate chargeback request. Can only be modified if status is `NEW`.\n\n### Parameters\n\n- `dispute_token: string`\n\n- `amount?: number`\n Amount for chargeback\n\n- `customer_filed_date?: string`\n Date the customer filed the chargeback request\n\n- `customer_note?: string`\n Customer description\n\n- `reason?: string`\n Reason for chargeback\n\n### Returns\n\n- `{ token: string; amount: number; arbitration_date: string; created: string; customer_filed_date: string; customer_note: string; network_claim_ids: string[]; network_filed_date: string; network_reason_code: string; prearbitration_date: string; primary_claim_id: string; reason: string; representment_date: string; resolution_date: string; resolution_note: string; resolution_reason: string; status: string; transaction_token: string; }`\n Dispute.\n\n - `token: string`\n - `amount: number`\n - `arbitration_date: string`\n - `created: string`\n - `customer_filed_date: string`\n - `customer_note: string`\n - `network_claim_ids: string[]`\n - `network_filed_date: string`\n - `network_reason_code: string`\n - `prearbitration_date: string`\n - `primary_claim_id: string`\n - `reason: string`\n - `representment_date: string`\n - `resolution_date: string`\n - `resolution_note: string`\n - `resolution_reason: string`\n - `status: string`\n - `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst dispute = await client.disputes.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(dispute);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst dispute = await client.disputes.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(dispute.network_claim_ids);", + }, + python: { + method: 'disputes.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute = client.disputes.update(\n dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute.network_claim_ids)', + }, + java: { + method: 'disputes().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Dispute;\nimport com.lithic.api.models.DisputeUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Dispute dispute = client.disputes().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'disputes().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Dispute\nimport com.lithic.api.models.DisputeUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val dispute: Dispute = client.disputes().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Disputes.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdispute, err := client.Disputes.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.DisputeUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", dispute.NetworkClaimIDs)\n}\n', + }, + ruby: { + method: 'disputes.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute = lithic.disputes.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(dispute)', + }, + http: { + example: + "curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'list_evidences', + endpoint: '/v1/disputes/{dispute_token}/evidences', + httpMethod: 'get', + summary: 'List evidence', + description: 'List evidence for a chargeback request.', + stainlessPath: '(resource) disputes > (method) list_evidences', + qualified: 'client.disputes.listEvidences', + params: [ + 'dispute_token: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }", + markdown: + "## list_evidences\n\n`client.disputes.listEvidences(dispute_token: string, begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n\n**get** `/v1/disputes/{dispute_token}/evidences`\n\nList evidence for a chargeback request.\n\n### Parameters\n\n- `dispute_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n Dispute evidence.\n\n - `token: string`\n - `created: string`\n - `dispute_token: string`\n - `upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'`\n - `download_url?: string`\n - `filename?: string`\n - `upload_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const disputeEvidence of client.disputes.listEvidences('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(disputeEvidence);\n}\n```", + perLanguage: { + typescript: { + method: 'client.disputes.listEvidences', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const disputeEvidence of client.disputes.listEvidences(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(disputeEvidence.token);\n}", + }, + python: { + method: 'disputes.list_evidences', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.disputes.list_evidences(\n dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'disputes().listEvidences', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputeListEvidencesPage;\nimport com.lithic.api.models.DisputeListEvidencesParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeListEvidencesPage page = client.disputes().listEvidences("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'disputes().listEvidences', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputeListEvidencesPage\nimport com.lithic.api.models.DisputeListEvidencesParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: DisputeListEvidencesPage = client.disputes().listEvidences("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Disputes.ListEvidences', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Disputes.ListEvidences(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.DisputeListEvidencesParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'disputes.list_evidences', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.disputes.list_evidences("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN/evidences \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'initiate_evidence_upload', + endpoint: '/v1/disputes/{dispute_token}/evidences', + httpMethod: 'post', + summary: 'Upload evidence', + description: + 'Use this endpoint to upload evidence for a chargeback request. It will return a URL to upload your documents to. The URL will expire in 30 minutes.\n\nUploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be less than 5 GiB.\n', + stainlessPath: '(resource) disputes > (method) initiate_evidence_upload', + qualified: 'client.disputes.initiateEvidenceUpload', + params: ['dispute_token: string;', 'filename?: string;'], + response: + "{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }", + markdown: + "## initiate_evidence_upload\n\n`client.disputes.initiateEvidenceUpload(dispute_token: string, filename?: string): { token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n\n**post** `/v1/disputes/{dispute_token}/evidences`\n\nUse this endpoint to upload evidence for a chargeback request. It will return a URL to upload your documents to. The URL will expire in 30 minutes.\n\nUploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be less than 5 GiB.\n\n\n### Parameters\n\n- `dispute_token: string`\n\n- `filename?: string`\n Filename of the evidence.\n\n### Returns\n\n- `{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n Dispute evidence.\n\n - `token: string`\n - `created: string`\n - `dispute_token: string`\n - `upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'`\n - `download_url?: string`\n - `filename?: string`\n - `upload_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst disputeEvidence = await client.disputes.initiateEvidenceUpload('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(disputeEvidence);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.initiateEvidenceUpload', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst disputeEvidence = await client.disputes.initiateEvidenceUpload(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(disputeEvidence.token);", + }, + python: { + method: 'disputes.initiate_evidence_upload', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute_evidence = client.disputes.initiate_evidence_upload(\n dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute_evidence.token)', + }, + java: { + method: 'disputes().initiateEvidenceUpload', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputeEvidence;\nimport com.lithic.api.models.DisputeInitiateEvidenceUploadParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeEvidence disputeEvidence = client.disputes().initiateEvidenceUpload("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'disputes().initiateEvidenceUpload', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputeEvidence\nimport com.lithic.api.models.DisputeInitiateEvidenceUploadParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val disputeEvidence: DisputeEvidence = client.disputes().initiateEvidenceUpload("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Disputes.InitiateEvidenceUpload', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdisputeEvidence, err := client.Disputes.InitiateEvidenceUpload(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.DisputeInitiateEvidenceUploadParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disputeEvidence.Token)\n}\n', + }, + ruby: { + method: 'disputes.initiate_evidence_upload', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute_evidence = lithic.disputes.initiate_evidence_upload("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(dispute_evidence)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN/evidences \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_evidence', + endpoint: '/v1/disputes/{dispute_token}/evidences/{evidence_token}', + httpMethod: 'get', + summary: 'Get evidence', + description: 'Get evidence for a chargeback request.', + stainlessPath: '(resource) disputes > (method) retrieve_evidence', + qualified: 'client.disputes.retrieveEvidence', + params: ['dispute_token: string;', 'evidence_token: string;'], + response: + "{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }", + markdown: + "## retrieve_evidence\n\n`client.disputes.retrieveEvidence(dispute_token: string, evidence_token: string): { token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n\n**get** `/v1/disputes/{dispute_token}/evidences/{evidence_token}`\n\nGet evidence for a chargeback request.\n\n### Parameters\n\n- `dispute_token: string`\n\n- `evidence_token: string`\n\n### Returns\n\n- `{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n Dispute evidence.\n\n - `token: string`\n - `created: string`\n - `dispute_token: string`\n - `upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'`\n - `download_url?: string`\n - `filename?: string`\n - `upload_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst disputeEvidence = await client.disputes.retrieveEvidence('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { dispute_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(disputeEvidence);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.retrieveEvidence', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst disputeEvidence = await client.disputes.retrieveEvidence(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { dispute_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(disputeEvidence.token);", + }, + python: { + method: 'disputes.retrieve_evidence', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute_evidence = client.disputes.retrieve_evidence(\n evidence_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute_evidence.token)', + }, + java: { + method: 'disputes().retrieveEvidence', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputeEvidence;\nimport com.lithic.api.models.DisputeRetrieveEvidenceParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeRetrieveEvidenceParams params = DisputeRetrieveEvidenceParams.builder()\n .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n DisputeEvidence disputeEvidence = client.disputes().retrieveEvidence(params);\n }\n}', + }, + kotlin: { + method: 'disputes().retrieveEvidence', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputeEvidence\nimport com.lithic.api.models.DisputeRetrieveEvidenceParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: DisputeRetrieveEvidenceParams = DisputeRetrieveEvidenceParams.builder()\n .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val disputeEvidence: DisputeEvidence = client.disputes().retrieveEvidence(params)\n}', + }, + go: { + method: 'client.Disputes.GetEvidence', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdisputeEvidence, err := client.Disputes.GetEvidence(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disputeEvidence.Token)\n}\n', + }, + ruby: { + method: 'disputes.retrieve_evidence', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute_evidence = lithic.disputes.retrieve_evidence(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n dispute_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(dispute_evidence)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN/evidences/$EVIDENCE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'delete_evidence', + endpoint: '/v1/disputes/{dispute_token}/evidences/{evidence_token}', + httpMethod: 'delete', + summary: 'Delete evidence', + description: + 'Soft delete evidence for a chargeback request. Evidence will not be reviewed or submitted by Lithic after it is withdrawn.', + stainlessPath: '(resource) disputes > (method) delete_evidence', + qualified: 'client.disputes.deleteEvidence', + params: ['dispute_token: string;', 'evidence_token: string;'], + response: + "{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }", + markdown: + "## delete_evidence\n\n`client.disputes.deleteEvidence(dispute_token: string, evidence_token: string): { token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n\n**delete** `/v1/disputes/{dispute_token}/evidences/{evidence_token}`\n\nSoft delete evidence for a chargeback request. Evidence will not be reviewed or submitted by Lithic after it is withdrawn.\n\n### Parameters\n\n- `dispute_token: string`\n\n- `evidence_token: string`\n\n### Returns\n\n- `{ token: string; created: string; dispute_token: string; upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'; download_url?: string; filename?: string; upload_url?: string; }`\n Dispute evidence.\n\n - `token: string`\n - `created: string`\n - `dispute_token: string`\n - `upload_status: 'DELETED' | 'ERROR' | 'PENDING' | 'REJECTED' | 'UPLOADED'`\n - `download_url?: string`\n - `filename?: string`\n - `upload_url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst disputeEvidence = await client.disputes.deleteEvidence('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { dispute_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(disputeEvidence);\n```", + perLanguage: { + typescript: { + method: 'client.disputes.deleteEvidence', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst disputeEvidence = await client.disputes.deleteEvidence(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { dispute_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(disputeEvidence.token);", + }, + python: { + method: 'disputes.delete_evidence', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute_evidence = client.disputes.delete_evidence(\n evidence_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute_evidence.token)', + }, + java: { + method: 'disputes().deleteEvidence', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputeDeleteEvidenceParams;\nimport com.lithic.api.models.DisputeEvidence;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeDeleteEvidenceParams params = DisputeDeleteEvidenceParams.builder()\n .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n DisputeEvidence disputeEvidence = client.disputes().deleteEvidence(params);\n }\n}', + }, + kotlin: { + method: 'disputes().deleteEvidence', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputeDeleteEvidenceParams\nimport com.lithic.api.models.DisputeEvidence\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: DisputeDeleteEvidenceParams = DisputeDeleteEvidenceParams.builder()\n .disputeToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .evidenceToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val disputeEvidence: DisputeEvidence = client.disputes().deleteEvidence(params)\n}', + }, + go: { + method: 'client.Disputes.DeleteEvidence', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdisputeEvidence, err := client.Disputes.DeleteEvidence(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disputeEvidence.Token)\n}\n', + }, + ruby: { + method: 'disputes.delete_evidence', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute_evidence = lithic.disputes.delete_evidence(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n dispute_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(dispute_evidence)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/disputes/$DISPUTE_TOKEN/evidences/$EVIDENCE_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v2/disputes', + httpMethod: 'get', + summary: 'List disputes', + description: 'Returns a paginated list of disputes.', + stainlessPath: '(resource) disputes_v2 > (method) list', + qualified: 'client.disputesV2.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'card_token?: string;', + 'disputed_transaction_token?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; account_token: string; card_token: string; case_id: string; created: string; currency: string; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; events: { token: string; created: string; data: object | object | object; type: 'WORKFLOW' | 'FINANCIAL' | 'CARDHOLDER_LIABILITY'; }[]; liability_allocation: { denied_amount: number; original_amount: number; recovered_amount: number; remaining_amount: number; written_off_amount: number; }; merchant: object; network: 'VISA' | 'MASTERCARD'; status: 'OPEN' | 'CLOSED'; transaction_series: { related_transaction_event_token: string; related_transaction_token: string; type: 'DISPUTE'; }; updated: string; }", + markdown: + "## list\n\n`client.disputesV2.list(account_token?: string, begin?: string, card_token?: string, disputed_transaction_token?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; account_token: string; card_token: string; case_id: string; created: string; currency: string; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; events: object[]; liability_allocation: object; merchant: merchant; network: 'VISA' | 'MASTERCARD'; status: 'OPEN' | 'CLOSED'; transaction_series: object; updated: string; }`\n\n**get** `/v2/disputes`\n\nReturns a paginated list of disputes.\n\n### Parameters\n\n- `account_token?: string`\n Filter by account token.\n\n- `begin?: string`\n RFC 3339 timestamp for filtering by created date, inclusive.\n\n- `card_token?: string`\n Filter by card token.\n\n- `disputed_transaction_token?: string`\n Filter by the token of the transaction being disputed. Corresponds with transaction_series.related_transaction_token in the Dispute.\n\n- `end?: string`\n RFC 3339 timestamp for filtering by created date, inclusive.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Number of items to return.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_token: string; card_token: string; case_id: string; created: string; currency: string; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; events: { token: string; created: string; data: { action: 'OPENED' | 'CLOSED' | 'REOPENED'; amount: number; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; reason: string; stage: 'CLAIM'; type: 'WORKFLOW'; } | { amount: number; polarity: 'CREDIT' | 'DEBIT'; stage: 'CHARGEBACK' | 'REPRESENTMENT' | 'PREARBITRATION' | 'ARBITRATION' | 'COLLABORATION'; type: 'FINANCIAL'; } | { action: 'PROVISIONAL_CREDIT_GRANTED' | 'PROVISIONAL_CREDIT_REVERSED' | 'WRITTEN_OFF'; amount: number; reason: string; type: 'CARDHOLDER_LIABILITY'; }; type: 'WORKFLOW' | 'FINANCIAL' | 'CARDHOLDER_LIABILITY'; }[]; liability_allocation: { denied_amount: number; original_amount: number; recovered_amount: number; remaining_amount: number; written_off_amount: number; }; merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }; network: 'VISA' | 'MASTERCARD'; status: 'OPEN' | 'CLOSED'; transaction_series: { related_transaction_event_token: string; related_transaction_token: string; type: 'DISPUTE'; }; updated: string; }`\n The Dispute object tracks the progression of a dispute throughout its lifecycle.\n\n - `token: string`\n - `account_token: string`\n - `card_token: string`\n - `case_id: string`\n - `created: string`\n - `currency: string`\n - `disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'`\n - `events: { token: string; created: string; data: { action: 'OPENED' | 'CLOSED' | 'REOPENED'; amount: number; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; reason: string; stage: 'CLAIM'; type: 'WORKFLOW'; } | { amount: number; polarity: 'CREDIT' | 'DEBIT'; stage: 'CHARGEBACK' | 'REPRESENTMENT' | 'PREARBITRATION' | 'ARBITRATION' | 'COLLABORATION'; type: 'FINANCIAL'; } | { action: 'PROVISIONAL_CREDIT_GRANTED' | 'PROVISIONAL_CREDIT_REVERSED' | 'WRITTEN_OFF'; amount: number; reason: string; type: 'CARDHOLDER_LIABILITY'; }; type: 'WORKFLOW' | 'FINANCIAL' | 'CARDHOLDER_LIABILITY'; }[]`\n - `liability_allocation: { denied_amount: number; original_amount: number; recovered_amount: number; remaining_amount: number; written_off_amount: number; }`\n - `merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }`\n - `network: 'VISA' | 'MASTERCARD'`\n - `status: 'OPEN' | 'CLOSED'`\n - `transaction_series: { related_transaction_event_token: string; related_transaction_token: string; type: 'DISPUTE'; }`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const disputeV2 of client.disputesV2.list()) {\n console.log(disputeV2);\n}\n```", + perLanguage: { + typescript: { + method: 'client.disputesV2.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const disputeV2 of client.disputesV2.list()) {\n console.log(disputeV2.case_id);\n}", + }, + python: { + method: 'disputes_v2.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.disputes_v2.list()\npage = page.data[0]\nprint(page.case_id)', + }, + java: { + method: 'disputesV2().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputesV2ListPage;\nimport com.lithic.api.models.DisputesV2ListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputesV2ListPage page = client.disputesV2().list();\n }\n}', + }, + kotlin: { + method: 'disputesV2().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputesV2ListPage\nimport com.lithic.api.models.DisputesV2ListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: DisputesV2ListPage = client.disputesV2().list()\n}', + }, + go: { + method: 'client.DisputesV2.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.DisputesV2.List(context.TODO(), lithic.DisputesV2ListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'disputes_v2.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.disputes_v2.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v2/disputes \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v2/disputes/{dispute_token}', + httpMethod: 'get', + summary: 'Retrieve a dispute', + description: 'Retrieves a specific dispute by its token.', + stainlessPath: '(resource) disputes_v2 > (method) retrieve', + qualified: 'client.disputesV2.retrieve', + params: ['dispute_token: string;'], + response: + "{ token: string; account_token: string; card_token: string; case_id: string; created: string; currency: string; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; events: { token: string; created: string; data: object | object | object; type: 'WORKFLOW' | 'FINANCIAL' | 'CARDHOLDER_LIABILITY'; }[]; liability_allocation: { denied_amount: number; original_amount: number; recovered_amount: number; remaining_amount: number; written_off_amount: number; }; merchant: object; network: 'VISA' | 'MASTERCARD'; status: 'OPEN' | 'CLOSED'; transaction_series: { related_transaction_event_token: string; related_transaction_token: string; type: 'DISPUTE'; }; updated: string; }", + markdown: + "## retrieve\n\n`client.disputesV2.retrieve(dispute_token: string): { token: string; account_token: string; card_token: string; case_id: string; created: string; currency: string; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; events: object[]; liability_allocation: object; merchant: merchant; network: 'VISA' | 'MASTERCARD'; status: 'OPEN' | 'CLOSED'; transaction_series: object; updated: string; }`\n\n**get** `/v2/disputes/{dispute_token}`\n\nRetrieves a specific dispute by its token.\n\n### Parameters\n\n- `dispute_token: string`\n\n### Returns\n\n- `{ token: string; account_token: string; card_token: string; case_id: string; created: string; currency: string; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; events: { token: string; created: string; data: { action: 'OPENED' | 'CLOSED' | 'REOPENED'; amount: number; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; reason: string; stage: 'CLAIM'; type: 'WORKFLOW'; } | { amount: number; polarity: 'CREDIT' | 'DEBIT'; stage: 'CHARGEBACK' | 'REPRESENTMENT' | 'PREARBITRATION' | 'ARBITRATION' | 'COLLABORATION'; type: 'FINANCIAL'; } | { action: 'PROVISIONAL_CREDIT_GRANTED' | 'PROVISIONAL_CREDIT_REVERSED' | 'WRITTEN_OFF'; amount: number; reason: string; type: 'CARDHOLDER_LIABILITY'; }; type: 'WORKFLOW' | 'FINANCIAL' | 'CARDHOLDER_LIABILITY'; }[]; liability_allocation: { denied_amount: number; original_amount: number; recovered_amount: number; remaining_amount: number; written_off_amount: number; }; merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }; network: 'VISA' | 'MASTERCARD'; status: 'OPEN' | 'CLOSED'; transaction_series: { related_transaction_event_token: string; related_transaction_token: string; type: 'DISPUTE'; }; updated: string; }`\n The Dispute object tracks the progression of a dispute throughout its lifecycle.\n\n - `token: string`\n - `account_token: string`\n - `card_token: string`\n - `case_id: string`\n - `created: string`\n - `currency: string`\n - `disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'`\n - `events: { token: string; created: string; data: { action: 'OPENED' | 'CLOSED' | 'REOPENED'; amount: number; disposition: 'WON' | 'LOST' | 'PARTIALLY_WON' | 'WITHDRAWN' | 'DENIED'; reason: string; stage: 'CLAIM'; type: 'WORKFLOW'; } | { amount: number; polarity: 'CREDIT' | 'DEBIT'; stage: 'CHARGEBACK' | 'REPRESENTMENT' | 'PREARBITRATION' | 'ARBITRATION' | 'COLLABORATION'; type: 'FINANCIAL'; } | { action: 'PROVISIONAL_CREDIT_GRANTED' | 'PROVISIONAL_CREDIT_REVERSED' | 'WRITTEN_OFF'; amount: number; reason: string; type: 'CARDHOLDER_LIABILITY'; }; type: 'WORKFLOW' | 'FINANCIAL' | 'CARDHOLDER_LIABILITY'; }[]`\n - `liability_allocation: { denied_amount: number; original_amount: number; recovered_amount: number; remaining_amount: number; written_off_amount: number; }`\n - `merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }`\n - `network: 'VISA' | 'MASTERCARD'`\n - `status: 'OPEN' | 'CLOSED'`\n - `transaction_series: { related_transaction_event_token: string; related_transaction_token: string; type: 'DISPUTE'; }`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst disputeV2 = await client.disputesV2.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(disputeV2);\n```", + perLanguage: { + typescript: { + method: 'client.disputesV2.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst disputeV2 = await client.disputesV2.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(disputeV2.case_id);", + }, + python: { + method: 'disputes_v2.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndispute_v2 = client.disputes_v2.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(dispute_v2.case_id)', + }, + java: { + method: 'disputesV2().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DisputeV2;\nimport com.lithic.api.models.DisputesV2RetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DisputeV2 disputeV2 = client.disputesV2().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'disputesV2().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DisputeV2\nimport com.lithic.api.models.DisputesV2RetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val disputeV2: DisputeV2 = client.disputesV2().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.DisputesV2.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdisputeV2, err := client.DisputesV2.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disputeV2.CaseID)\n}\n', + }, + ruby: { + method: 'disputes_v2.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndispute_v2 = lithic.disputes_v2.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(dispute_v2)', + }, + http: { + example: + 'curl https://api.lithic.com/v2/disputes/$DISPUTE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/events', + httpMethod: 'get', + summary: 'List events', + description: 'List all events.', + stainlessPath: '(resource) events > (method) list', + qualified: 'client.events.list', + params: [ + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'event_types?: string[];', + 'page_size?: number;', + 'starting_after?: string;', + 'with_content?: boolean;', + ], + response: '{ token: string; created: string; event_type: string; payload: object; }', + markdown: + "## list\n\n`client.events.list(begin?: string, end?: string, ending_before?: string, event_types?: string[], page_size?: number, starting_after?: string, with_content?: boolean): { token: string; created: string; event_type: string; payload: object; }`\n\n**get** `/v1/events`\n\nList all events.\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `event_types?: string[]`\n Event types to filter events by.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `with_content?: boolean`\n Whether to include the event payload content in the response.\n\n### Returns\n\n- `{ token: string; created: string; event_type: string; payload: object; }`\n A single event that affects the transaction state and lifecycle.\n\n - `token: string`\n - `created: string`\n - `event_type: string`\n - `payload: object`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const event of client.events.list()) {\n console.log(event);\n}\n```", + perLanguage: { + typescript: { + method: 'client.events.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const event of client.events.list()) {\n console.log(event.token);\n}", + }, + python: { + method: 'events.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.events.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'events().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventListPage;\nimport com.lithic.api.models.EventListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventListPage page = client.events().list();\n }\n}', + }, + kotlin: { + method: 'events().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventListPage\nimport com.lithic.api.models.EventListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: EventListPage = client.events().list()\n}', + }, + go: { + method: 'client.Events.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Events.List(context.TODO(), lithic.EventListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'events.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.events.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/events \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/events/{event_token}', + httpMethod: 'get', + summary: 'Get event', + description: 'Get an event.', + stainlessPath: '(resource) events > (method) retrieve', + qualified: 'client.events.retrieve', + params: ['event_token: string;'], + response: '{ token: string; created: string; event_type: string; payload: object; }', + markdown: + "## retrieve\n\n`client.events.retrieve(event_token: string): { token: string; created: string; event_type: string; payload: object; }`\n\n**get** `/v1/events/{event_token}`\n\nGet an event.\n\n### Parameters\n\n- `event_token: string`\n\n### Returns\n\n- `{ token: string; created: string; event_type: string; payload: object; }`\n A single event that affects the transaction state and lifecycle.\n\n - `token: string`\n - `created: string`\n - `event_type: string`\n - `payload: object`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst event = await client.events.retrieve('event_token');\n\nconsole.log(event);\n```", + perLanguage: { + typescript: { + method: 'client.events.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst event = await client.events.retrieve('event_token');\n\nconsole.log(event.token);", + }, + python: { + method: 'events.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nevent = client.events.retrieve(\n "event_token",\n)\nprint(event.token)', + }, + java: { + method: 'events().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Event;\nimport com.lithic.api.models.EventRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Event event = client.events().retrieve("event_token");\n }\n}', + }, + kotlin: { + method: 'events().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Event\nimport com.lithic.api.models.EventRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val event: Event = client.events().retrieve("event_token")\n}', + }, + go: { + method: 'client.Events.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tevent, err := client.Events.Get(context.TODO(), "event_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", event.Token)\n}\n', + }, + ruby: { + method: 'events.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nevent = lithic.events.retrieve("event_token")\n\nputs(event)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/events/$EVENT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list_attempts', + endpoint: '/v1/events/{event_token}/attempts', + httpMethod: 'get', + summary: 'List message attempts for an event', + description: 'List all the message attempts for a given event.', + stainlessPath: '(resource) events > (method) list_attempts', + qualified: 'client.events.listAttempts', + params: [ + 'event_token: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + "status?: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS';", + ], + response: + "{ token: string; created: string; event_subscription_token: string; event_token: string; response: string; response_status_code: number; status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'; url: string; }", + markdown: + "## list_attempts\n\n`client.events.listAttempts(event_token: string, begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string, status?: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'): { token: string; created: string; event_subscription_token: string; event_token: string; response: string; response_status_code: number; status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'; url: string; }`\n\n**get** `/v1/events/{event_token}/attempts`\n\nList all the message attempts for a given event.\n\n### Parameters\n\n- `event_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'`\n\n### Returns\n\n- `{ token: string; created: string; event_subscription_token: string; event_token: string; response: string; response_status_code: number; status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'; url: string; }`\n A subscription to specific event types.\n\n - `token: string`\n - `created: string`\n - `event_subscription_token: string`\n - `event_token: string`\n - `response: string`\n - `response_status_code: number`\n - `status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'`\n - `url: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const messageAttempt of client.events.listAttempts('event_token')) {\n console.log(messageAttempt);\n}\n```", + perLanguage: { + typescript: { + method: 'client.events.listAttempts', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const messageAttempt of client.events.listAttempts('event_token')) {\n console.log(messageAttempt.token);\n}", + }, + python: { + method: 'events.list_attempts', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.events.list_attempts(\n event_token="event_token",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'events().listAttempts', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventListAttemptsPage;\nimport com.lithic.api.models.EventListAttemptsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventListAttemptsPage page = client.events().listAttempts("event_token");\n }\n}', + }, + kotlin: { + method: 'events().listAttempts', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventListAttemptsPage\nimport com.lithic.api.models.EventListAttemptsParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: EventListAttemptsPage = client.events().listAttempts("event_token")\n}', + }, + go: { + method: 'client.Events.ListAttempts', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Events.ListAttempts(\n\t\tcontext.TODO(),\n\t\t"event_token",\n\t\tlithic.EventListAttemptsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'events.list_attempts', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.events.list_attempts("event_token")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/events/$EVENT_TOKEN/attempts \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/event_subscriptions', + httpMethod: 'get', + summary: 'List event subscriptions', + description: 'List all the event subscriptions.', + stainlessPath: '(resource) events.subscriptions > (method) list', + qualified: 'client.events.subscriptions.list', + params: ['ending_before?: string;', 'page_size?: number;', 'starting_after?: string;'], + response: + '{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }', + markdown: + "## list\n\n`client.events.subscriptions.list(ending_before?: string, page_size?: number, starting_after?: string): { token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n\n**get** `/v1/event_subscriptions`\n\nList all the event subscriptions.\n\n### Parameters\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n A subscription to specific event types.\n\n - `token: string`\n - `description: string`\n - `disabled: boolean`\n - `url: string`\n - `event_types?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const eventSubscription of client.events.subscriptions.list()) {\n console.log(eventSubscription);\n}\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const eventSubscription of client.events.subscriptions.list()) {\n console.log(eventSubscription.token);\n}", + }, + python: { + method: 'events.subscriptions.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.events.subscriptions.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'events().subscriptions().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionListPage;\nimport com.lithic.api.models.EventSubscriptionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventSubscriptionListPage page = client.events().subscriptions().list();\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionListPage\nimport com.lithic.api.models.EventSubscriptionListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: EventSubscriptionListPage = client.events().subscriptions().list()\n}', + }, + go: { + method: 'client.Events.Subscriptions.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Events.Subscriptions.List(context.TODO(), lithic.EventSubscriptionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'events.subscriptions.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.events.subscriptions.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/event_subscriptions', + httpMethod: 'post', + summary: 'Create event subscription', + description: 'Create a new event subscription.', + stainlessPath: '(resource) events.subscriptions > (method) create', + qualified: 'client.events.subscriptions.create', + params: ['url: string;', 'description?: string;', 'disabled?: boolean;', 'event_types?: string[];'], + response: + '{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }', + markdown: + "## create\n\n`client.events.subscriptions.create(url: string, description?: string, disabled?: boolean, event_types?: string[]): { token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n\n**post** `/v1/event_subscriptions`\n\nCreate a new event subscription.\n\n### Parameters\n\n- `url: string`\n URL to which event webhooks will be sent. URL must be a valid HTTPS address.\n\n- `description?: string`\n Event subscription description.\n\n- `disabled?: boolean`\n Whether the event subscription is active (false) or inactive (true).\n\n- `event_types?: string[]`\n Indicates types of events that will be sent to this subscription. If left blank, all types will be sent.\n\n### Returns\n\n- `{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n A subscription to specific event types.\n\n - `token: string`\n - `description: string`\n - `disabled: boolean`\n - `url: string`\n - `event_types?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst eventSubscription = await client.events.subscriptions.create({ url: 'https://example.com' });\n\nconsole.log(eventSubscription);\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst eventSubscription = await client.events.subscriptions.create({ url: 'https://example.com' });\n\nconsole.log(eventSubscription.token);", + }, + python: { + method: 'events.subscriptions.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nevent_subscription = client.events.subscriptions.create(\n url="https://example.com",\n)\nprint(event_subscription.token)', + }, + java: { + method: 'events().subscriptions().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscription;\nimport com.lithic.api.models.EventSubscriptionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventSubscriptionCreateParams params = EventSubscriptionCreateParams.builder()\n .url("https://example.com")\n .build();\n EventSubscription eventSubscription = client.events().subscriptions().create(params);\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscription\nimport com.lithic.api.models.EventSubscriptionCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: EventSubscriptionCreateParams = EventSubscriptionCreateParams.builder()\n .url("https://example.com")\n .build()\n val eventSubscription: EventSubscription = client.events().subscriptions().create(params)\n}', + }, + go: { + method: 'client.Events.Subscriptions.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\teventSubscription, err := client.Events.Subscriptions.New(context.TODO(), lithic.EventSubscriptionNewParams{\n\t\tURL: lithic.F("https://example.com"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", eventSubscription.Token)\n}\n', + }, + ruby: { + method: 'events.subscriptions.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nevent_subscription = lithic.events.subscriptions.create(url: "https://example.com")\n\nputs(event_subscription)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "url": "https://example.com"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/event_subscriptions/{event_subscription_token}', + httpMethod: 'get', + summary: 'Get event subscription', + description: 'Get an event subscription.', + stainlessPath: '(resource) events.subscriptions > (method) retrieve', + qualified: 'client.events.subscriptions.retrieve', + params: ['event_subscription_token: string;'], + response: + '{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }', + markdown: + "## retrieve\n\n`client.events.subscriptions.retrieve(event_subscription_token: string): { token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n\n**get** `/v1/event_subscriptions/{event_subscription_token}`\n\nGet an event subscription.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n### Returns\n\n- `{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n A subscription to specific event types.\n\n - `token: string`\n - `description: string`\n - `disabled: boolean`\n - `url: string`\n - `event_types?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst eventSubscription = await client.events.subscriptions.retrieve('event_subscription_token');\n\nconsole.log(eventSubscription);\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst eventSubscription = await client.events.subscriptions.retrieve('event_subscription_token');\n\nconsole.log(eventSubscription.token);", + }, + python: { + method: 'events.subscriptions.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nevent_subscription = client.events.subscriptions.retrieve(\n "event_subscription_token",\n)\nprint(event_subscription.token)', + }, + java: { + method: 'events().subscriptions().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscription;\nimport com.lithic.api.models.EventSubscriptionRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventSubscription eventSubscription = client.events().subscriptions().retrieve("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscription\nimport com.lithic.api.models.EventSubscriptionRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val eventSubscription: EventSubscription = client.events().subscriptions().retrieve("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\teventSubscription, err := client.Events.Subscriptions.Get(context.TODO(), "event_subscription_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", eventSubscription.Token)\n}\n', + }, + ruby: { + method: 'events.subscriptions.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nevent_subscription = lithic.events.subscriptions.retrieve("event_subscription_token")\n\nputs(event_subscription)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/event_subscriptions/{event_subscription_token}', + httpMethod: 'patch', + summary: 'Update event subscription', + description: 'Update an event subscription.', + stainlessPath: '(resource) events.subscriptions > (method) update', + qualified: 'client.events.subscriptions.update', + params: [ + 'event_subscription_token: string;', + 'url: string;', + 'description?: string;', + 'disabled?: boolean;', + 'event_types?: string[];', + ], + response: + '{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }', + markdown: + "## update\n\n`client.events.subscriptions.update(event_subscription_token: string, url: string, description?: string, disabled?: boolean, event_types?: string[]): { token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n\n**patch** `/v1/event_subscriptions/{event_subscription_token}`\n\nUpdate an event subscription.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n- `url: string`\n URL to which event webhooks will be sent. URL must be a valid HTTPS address.\n\n- `description?: string`\n Event subscription description.\n\n- `disabled?: boolean`\n Whether the event subscription is active (false) or inactive (true).\n\n- `event_types?: string[]`\n Indicates types of events that will be sent to this subscription. If left blank, all types will be sent.\n\n### Returns\n\n- `{ token: string; description: string; disabled: boolean; url: string; event_types?: string[]; }`\n A subscription to specific event types.\n\n - `token: string`\n - `description: string`\n - `disabled: boolean`\n - `url: string`\n - `event_types?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst eventSubscription = await client.events.subscriptions.update('event_subscription_token', { url: 'https://example.com' });\n\nconsole.log(eventSubscription);\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst eventSubscription = await client.events.subscriptions.update('event_subscription_token', {\n url: 'https://example.com',\n});\n\nconsole.log(eventSubscription.token);", + }, + python: { + method: 'events.subscriptions.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nevent_subscription = client.events.subscriptions.update(\n event_subscription_token="event_subscription_token",\n url="https://example.com",\n)\nprint(event_subscription.token)', + }, + java: { + method: 'events().subscriptions().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscription;\nimport com.lithic.api.models.EventSubscriptionUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventSubscriptionUpdateParams params = EventSubscriptionUpdateParams.builder()\n .eventSubscriptionToken("event_subscription_token")\n .url("https://example.com")\n .build();\n EventSubscription eventSubscription = client.events().subscriptions().update(params);\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscription\nimport com.lithic.api.models.EventSubscriptionUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: EventSubscriptionUpdateParams = EventSubscriptionUpdateParams.builder()\n .eventSubscriptionToken("event_subscription_token")\n .url("https://example.com")\n .build()\n val eventSubscription: EventSubscription = client.events().subscriptions().update(params)\n}', + }, + go: { + method: 'client.Events.Subscriptions.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\teventSubscription, err := client.Events.Subscriptions.Update(\n\t\tcontext.TODO(),\n\t\t"event_subscription_token",\n\t\tlithic.EventSubscriptionUpdateParams{\n\t\t\tURL: lithic.F("https://example.com"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", eventSubscription.Token)\n}\n', + }, + ruby: { + method: 'events.subscriptions.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nevent_subscription = lithic.events.subscriptions.update("event_subscription_token", url: "https://example.com")\n\nputs(event_subscription)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "url": "https://example.com"\n }\'', + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/event_subscriptions/{event_subscription_token}', + httpMethod: 'delete', + summary: 'Delete event subscription', + description: 'Delete an event subscription.', + stainlessPath: '(resource) events.subscriptions > (method) delete', + qualified: 'client.events.subscriptions.delete', + params: ['event_subscription_token: string;'], + markdown: + "## delete\n\n`client.events.subscriptions.delete(event_subscription_token: string): void`\n\n**delete** `/v1/event_subscriptions/{event_subscription_token}`\n\nDelete an event subscription.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.events.subscriptions.delete('event_subscription_token')\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.events.subscriptions.delete('event_subscription_token');", + }, + python: { + method: 'events.subscriptions.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.events.subscriptions.delete(\n "event_subscription_token",\n)', + }, + java: { + method: 'events().subscriptions().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.events().subscriptions().delete("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.events().subscriptions().delete("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Events.Subscriptions.Delete(context.TODO(), "event_subscription_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'events.subscriptions.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.events.subscriptions.delete("event_subscription_token")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'recover', + endpoint: '/v1/event_subscriptions/{event_subscription_token}/recover', + httpMethod: 'post', + summary: 'Resend failed messages', + description: 'Resend all failed messages since a given time.', + stainlessPath: '(resource) events.subscriptions > (method) recover', + qualified: 'client.events.subscriptions.recover', + params: ['event_subscription_token: string;', 'begin?: string;', 'end?: string;'], + markdown: + "## recover\n\n`client.events.subscriptions.recover(event_subscription_token: string, begin?: string, end?: string): void`\n\n**post** `/v1/event_subscriptions/{event_subscription_token}/recover`\n\nResend all failed messages since a given time.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.events.subscriptions.recover('event_subscription_token')\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.recover', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.events.subscriptions.recover('event_subscription_token');", + }, + python: { + method: 'events.subscriptions.recover', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.events.subscriptions.recover(\n event_subscription_token="event_subscription_token",\n)', + }, + java: { + method: 'events().subscriptions().recover', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionRecoverParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.events().subscriptions().recover("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().recover', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionRecoverParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.events().subscriptions().recover("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.Recover', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Events.Subscriptions.Recover(\n\t\tcontext.TODO(),\n\t\t"event_subscription_token",\n\t\tlithic.EventSubscriptionRecoverParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'events.subscriptions.recover', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.events.subscriptions.recover("event_subscription_token")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/recover \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list_attempts', + endpoint: '/v1/event_subscriptions/{event_subscription_token}/attempts', + httpMethod: 'get', + summary: 'List message attempts for an event subscription', + description: 'List all the message attempts for a given event subscription.', + stainlessPath: '(resource) events.subscriptions > (method) list_attempts', + qualified: 'client.events.subscriptions.listAttempts', + params: [ + 'event_subscription_token: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + "status?: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS';", + ], + response: + "{ token: string; created: string; event_subscription_token: string; event_token: string; response: string; response_status_code: number; status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'; url: string; }", + markdown: + "## list_attempts\n\n`client.events.subscriptions.listAttempts(event_subscription_token: string, begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string, status?: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'): { token: string; created: string; event_subscription_token: string; event_token: string; response: string; response_status_code: number; status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'; url: string; }`\n\n**get** `/v1/event_subscriptions/{event_subscription_token}/attempts`\n\nList all the message attempts for a given event subscription.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'`\n\n### Returns\n\n- `{ token: string; created: string; event_subscription_token: string; event_token: string; response: string; response_status_code: number; status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'; url: string; }`\n A subscription to specific event types.\n\n - `token: string`\n - `created: string`\n - `event_subscription_token: string`\n - `event_token: string`\n - `response: string`\n - `response_status_code: number`\n - `status: 'FAILED' | 'PENDING' | 'SENDING' | 'SUCCESS'`\n - `url: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const messageAttempt of client.events.subscriptions.listAttempts('event_subscription_token')) {\n console.log(messageAttempt);\n}\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.listAttempts', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const messageAttempt of client.events.subscriptions.listAttempts(\n 'event_subscription_token',\n)) {\n console.log(messageAttempt.token);\n}", + }, + python: { + method: 'events.subscriptions.list_attempts', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.events.subscriptions.list_attempts(\n event_subscription_token="event_subscription_token",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'events().subscriptions().listAttempts', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionListAttemptsPage;\nimport com.lithic.api.models.EventSubscriptionListAttemptsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventSubscriptionListAttemptsPage page = client.events().subscriptions().listAttempts("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().listAttempts', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionListAttemptsPage\nimport com.lithic.api.models.EventSubscriptionListAttemptsParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: EventSubscriptionListAttemptsPage = client.events().subscriptions().listAttempts("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.ListAttempts', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Events.Subscriptions.ListAttempts(\n\t\tcontext.TODO(),\n\t\t"event_subscription_token",\n\t\tlithic.EventSubscriptionListAttemptsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'events.subscriptions.list_attempts', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.events.subscriptions.list_attempts("event_subscription_token")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/attempts \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'replay_missing', + endpoint: '/v1/event_subscriptions/{event_subscription_token}/replay_missing', + httpMethod: 'post', + summary: 'Replay missing messages', + description: + 'Replays messages to the endpoint. Only messages that were created after `begin` will be sent. Messages that were previously sent to the endpoint are not resent.\nMessage will be retried if endpoint responds with a non-2xx status code. See [Retry Schedule](https://docs.lithic.com/docs/events-api#retry-schedule) for details.\n', + stainlessPath: '(resource) events.subscriptions > (method) replay_missing', + qualified: 'client.events.subscriptions.replayMissing', + params: ['event_subscription_token: string;', 'begin?: string;', 'end?: string;'], + markdown: + "## replay_missing\n\n`client.events.subscriptions.replayMissing(event_subscription_token: string, begin?: string, end?: string): void`\n\n**post** `/v1/event_subscriptions/{event_subscription_token}/replay_missing`\n\nReplays messages to the endpoint. Only messages that were created after `begin` will be sent. Messages that were previously sent to the endpoint are not resent.\nMessage will be retried if endpoint responds with a non-2xx status code. See [Retry Schedule](https://docs.lithic.com/docs/events-api#retry-schedule) for details.\n\n\n### Parameters\n\n- `event_subscription_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.events.subscriptions.replayMissing('event_subscription_token')\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.replayMissing', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.events.subscriptions.replayMissing('event_subscription_token');", + }, + python: { + method: 'events.subscriptions.replay_missing', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.events.subscriptions.replay_missing(\n event_subscription_token="event_subscription_token",\n)', + }, + java: { + method: 'events().subscriptions().replayMissing', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionReplayMissingParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.events().subscriptions().replayMissing("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().replayMissing', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionReplayMissingParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.events().subscriptions().replayMissing("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.ReplayMissing', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Events.Subscriptions.ReplayMissing(\n\t\tcontext.TODO(),\n\t\t"event_subscription_token",\n\t\tlithic.EventSubscriptionReplayMissingParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'events.subscriptions.replay_missing', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.events.subscriptions.replay_missing("event_subscription_token")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/replay_missing \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_secret', + endpoint: '/v1/event_subscriptions/{event_subscription_token}/secret', + httpMethod: 'get', + summary: 'Get event subscription secret', + description: 'Get the secret for an event subscription.', + stainlessPath: '(resource) events.subscriptions > (method) retrieve_secret', + qualified: 'client.events.subscriptions.retrieveSecret', + params: ['event_subscription_token: string;'], + response: '{ secret?: string; }', + markdown: + "## retrieve_secret\n\n`client.events.subscriptions.retrieveSecret(event_subscription_token: string): { secret?: string; }`\n\n**get** `/v1/event_subscriptions/{event_subscription_token}/secret`\n\nGet the secret for an event subscription.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n### Returns\n\n- `{ secret?: string; }`\n\n - `secret?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.events.subscriptions.retrieveSecret('event_subscription_token');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.retrieveSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.events.subscriptions.retrieveSecret('event_subscription_token');\n\nconsole.log(response.secret);", + }, + python: { + method: 'events.subscriptions.retrieve_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.events.subscriptions.retrieve_secret(\n "event_subscription_token",\n)\nprint(response.secret)', + }, + java: { + method: 'events().subscriptions().retrieveSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionRetrieveSecretParams;\nimport com.lithic.api.models.SubscriptionRetrieveSecretResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n SubscriptionRetrieveSecretResponse response = client.events().subscriptions().retrieveSecret("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().retrieveSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionRetrieveSecretParams\nimport com.lithic.api.models.SubscriptionRetrieveSecretResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: SubscriptionRetrieveSecretResponse = client.events().subscriptions().retrieveSecret("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.GetSecret', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Events.Subscriptions.GetSecret(context.TODO(), "event_subscription_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Secret)\n}\n', + }, + ruby: { + method: 'events.subscriptions.retrieve_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.events.subscriptions.retrieve_secret("event_subscription_token")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/secret \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'rotate_secret', + endpoint: '/v1/event_subscriptions/{event_subscription_token}/secret/rotate', + httpMethod: 'post', + summary: 'Rotate event subscription secret', + description: + 'Rotate the secret for an event subscription. The previous secret will be valid for the next 24 hours.\n', + stainlessPath: '(resource) events.subscriptions > (method) rotate_secret', + qualified: 'client.events.subscriptions.rotateSecret', + params: ['event_subscription_token: string;'], + markdown: + "## rotate_secret\n\n`client.events.subscriptions.rotateSecret(event_subscription_token: string): void`\n\n**post** `/v1/event_subscriptions/{event_subscription_token}/secret/rotate`\n\nRotate the secret for an event subscription. The previous secret will be valid for the next 24 hours.\n\n\n### Parameters\n\n- `event_subscription_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.events.subscriptions.rotateSecret('event_subscription_token')\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.rotateSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.events.subscriptions.rotateSecret('event_subscription_token');", + }, + python: { + method: 'events.subscriptions.rotate_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.events.subscriptions.rotate_secret(\n "event_subscription_token",\n)', + }, + java: { + method: 'events().subscriptions().rotateSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionRotateSecretParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.events().subscriptions().rotateSecret("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().rotateSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionRotateSecretParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.events().subscriptions().rotateSecret("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.RotateSecret', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Events.Subscriptions.RotateSecret(context.TODO(), "event_subscription_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'events.subscriptions.rotate_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.events.subscriptions.rotate_secret("event_subscription_token")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/secret/rotate \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'send_simulated_example', + endpoint: '/v1/simulate/event_subscriptions/{event_subscription_token}/send_example', + httpMethod: 'post', + summary: 'Send event type example message', + description: 'Send an example message for event.', + stainlessPath: '(resource) events.subscriptions > (method) send_simulated_example', + qualified: 'client.events.subscriptions.sendSimulatedExample', + params: ['event_subscription_token: string;', 'event_type?: string;'], + markdown: + "## send_simulated_example\n\n`client.events.subscriptions.sendSimulatedExample(event_subscription_token: string, event_type?: string): void`\n\n**post** `/v1/simulate/event_subscriptions/{event_subscription_token}/send_example`\n\nSend an example message for event.\n\n### Parameters\n\n- `event_subscription_token: string`\n\n- `event_type?: string`\n Event type to send example message for.\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.events.subscriptions.sendSimulatedExample('event_subscription_token')\n```", + perLanguage: { + typescript: { + method: 'client.events.subscriptions.sendSimulatedExample', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.events.subscriptions.sendSimulatedExample('event_subscription_token');", + }, + python: { + method: 'events.subscriptions.send_simulated_example', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.events.subscriptions.send_simulated_example(\n event_subscription_token="event_subscription_token",\n)', + }, + java: { + method: 'events().subscriptions().sendSimulatedExample', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventSubscriptionSendSimulatedExampleParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.events().subscriptions().sendSimulatedExample("event_subscription_token");\n }\n}', + }, + kotlin: { + method: 'events().subscriptions().sendSimulatedExample', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventSubscriptionSendSimulatedExampleParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.events().subscriptions().sendSimulatedExample("event_subscription_token")\n}', + }, + go: { + method: 'client.Events.Subscriptions.SendSimulatedExample', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Events.Subscriptions.SendSimulatedExample(\n\t\tcontext.TODO(),\n\t\t"event_subscription_token",\n\t\tlithic.EventSubscriptionSendSimulatedExampleParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'events.subscriptions.send_simulated_example', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.events.subscriptions.send_simulated_example("event_subscription_token")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/send_example \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'resend', + endpoint: '/v1/events/{event_token}/event_subscriptions/{event_subscription_token}/resend', + httpMethod: 'post', + summary: 'Resend event', + description: 'Resend an event to an event subscription.', + stainlessPath: '(resource) events.event_subscriptions > (method) resend', + qualified: 'client.events.eventSubscriptions.resend', + params: ['event_token: string;', 'event_subscription_token: string;'], + markdown: + "## resend\n\n`client.events.eventSubscriptions.resend(event_token: string, event_subscription_token: string): void`\n\n**post** `/v1/events/{event_token}/event_subscriptions/{event_subscription_token}/resend`\n\nResend an event to an event subscription.\n\n### Parameters\n\n- `event_token: string`\n\n- `event_subscription_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.events.eventSubscriptions.resend('event_subscription_token', { event_token: 'event_token' })\n```", + perLanguage: { + typescript: { + method: 'client.events.eventSubscriptions.resend', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.events.eventSubscriptions.resend('event_subscription_token', {\n event_token: 'event_token',\n});", + }, + python: { + method: 'events.event_subscriptions.resend', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.events.event_subscriptions.resend(\n event_subscription_token="event_subscription_token",\n event_token="event_token",\n)', + }, + java: { + method: 'events().eventSubscriptions().resend', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EventEventSubscriptionResendParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EventEventSubscriptionResendParams params = EventEventSubscriptionResendParams.builder()\n .eventToken("event_token")\n .eventSubscriptionToken("event_subscription_token")\n .build();\n client.events().eventSubscriptions().resend(params);\n }\n}', + }, + kotlin: { + method: 'events().eventSubscriptions().resend', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EventEventSubscriptionResendParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: EventEventSubscriptionResendParams = EventEventSubscriptionResendParams.builder()\n .eventToken("event_token")\n .eventSubscriptionToken("event_subscription_token")\n .build()\n client.events().eventSubscriptions().resend(params)\n}', + }, + go: { + method: 'client.Events.EventSubscriptions.Resend', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Events.EventSubscriptions.Resend(\n\t\tcontext.TODO(),\n\t\t"event_token",\n\t\t"event_subscription_token",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'events.event_subscriptions.resend', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.events.event_subscriptions.resend("event_subscription_token", event_token: "event_token")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/events/$EVENT_TOKEN/event_subscriptions/$EVENT_SUBSCRIPTION_TOKEN/resend \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/transfer', + httpMethod: 'post', + summary: 'Transfer funds within Lithic', + description: 'Transfer funds between two financial accounts or between a financial account and card', + stainlessPath: '(resource) transfers > (method) create', + qualified: 'client.transfers.create', + params: ['amount: number;', 'from: string;', 'to: string;', 'token?: string;', 'memo?: string;'], + response: + "{ token?: string; category?: 'TRANSFER'; created?: string; currency?: string; descriptor?: string; events?: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; from_balance?: { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }[]; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; to_balance?: { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }[]; updated?: string; }", + markdown: + "## create\n\n`client.transfers.create(amount: number, from: string, to: string, token?: string, memo?: string): { token?: string; category?: 'TRANSFER'; created?: string; currency?: string; descriptor?: string; events?: financial_event[]; from_balance?: balance[]; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; to_balance?: balance[]; updated?: string; }`\n\n**post** `/v1/transfer`\n\nTransfer funds between two financial accounts or between a financial account and card\n\n### Parameters\n\n- `amount: number`\n Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). This should always be a positive value.\n\n- `from: string`\n Globally unique identifier for the financial account or card that will send the funds. Accepted type dependent on the program's use case.\n\n- `to: string`\n Globally unique identifier for the financial account or card that will receive the funds. Accepted type dependent on the program's use case.\n\n- `token?: string`\n Customer-provided token that will serve as an idempotency token. This token will become the transaction token.\n\n- `memo?: string`\n Optional descriptor for the transfer.\n\n### Returns\n\n- `{ token?: string; category?: 'TRANSFER'; created?: string; currency?: string; descriptor?: string; events?: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; from_balance?: { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }[]; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; to_balance?: { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }[]; updated?: string; }`\n\n - `token?: string`\n - `category?: 'TRANSFER'`\n - `created?: string`\n - `currency?: string`\n - `descriptor?: string`\n - `events?: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]`\n - `from_balance?: { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }[]`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'`\n - `to_balance?: { available_amount: number; created: string; currency: string; financial_account_token: string; financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; updated: string; }[]`\n - `updated?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst transfer = await client.transfers.create({\n amount: 0,\n from: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n to: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(transfer);\n```", + perLanguage: { + typescript: { + method: 'client.transfers.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst transfer = await client.transfers.create({\n amount: 0,\n from: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n to: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(transfer.token);", + }, + java: { + method: 'transfers().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Transfer;\nimport com.lithic.api.models.TransferCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransferCreateParams params = TransferCreateParams.builder()\n .amount(0L)\n .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n Transfer transfer = client.transfers().create(params);\n }\n}', + }, + kotlin: { + method: 'transfers().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Transfer\nimport com.lithic.api.models.TransferCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransferCreateParams = TransferCreateParams.builder()\n .amount(0L)\n .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val transfer: Transfer = client.transfers().create(params)\n}', + }, + go: { + method: 'client.Transfers.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttransfer, err := client.Transfers.New(context.TODO(), lithic.TransferNewParams{\n\t\tAmount: lithic.F(int64(0)),\n\t\tFrom: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tTo: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", transfer.Token)\n}\n', + }, + ruby: { + method: 'transfers.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntransfer = lithic.transfers.create(\n amount: 0,\n from: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n to: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(transfer)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transfer \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 0,\n "from": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "to": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts', + httpMethod: 'get', + summary: 'List financial accounts', + description: 'Retrieve information on your financial accounts including routing and account number.', + stainlessPath: '(resource) financial_accounts > (method) list', + qualified: 'client.financialAccounts.list', + params: [ + 'account_token?: string;', + 'business_account_token?: string;', + "type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY' | 'EARLY_DIRECT_DEPOSIT_FLOAT';", + ], + response: + "{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }", + markdown: + "## list\n\n`client.financialAccounts.list(account_token?: string, business_account_token?: string, type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY' | 'EARLY_DIRECT_DEPOSIT_FLOAT'): { token: string; account_token: string; created: string; credit_configuration: object; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n**get** `/v1/financial_accounts`\n\nRetrieve information on your financial accounts including routing and account number.\n\n### Parameters\n\n- `account_token?: string`\n List financial accounts for a given account_token or business_account_token\n\n- `business_account_token?: string`\n List financial accounts for a given business_account_token\n\n- `type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY' | 'EARLY_DIRECT_DEPOSIT_FLOAT'`\n List financial accounts of a given type\n\n### Returns\n\n- `{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `created: string`\n - `credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n - `is_for_benefit_of: boolean`\n - `nickname: string`\n - `status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'`\n - `substatus: string`\n - `type: string`\n - `updated: string`\n - `user_defined_status: string`\n - `account_number?: string`\n - `routing_number?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const financialAccount of client.financialAccounts.list()) {\n console.log(financialAccount);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const financialAccount of client.financialAccounts.list()) {\n console.log(financialAccount.token);\n}", + }, + python: { + method: 'financial_accounts.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'financialAccounts().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountListPage;\nimport com.lithic.api.models.FinancialAccountListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountListPage page = client.financialAccounts().list();\n }\n}', + }, + kotlin: { + method: 'financialAccounts().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountListPage\nimport com.lithic.api.models.FinancialAccountListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FinancialAccountListPage = client.financialAccounts().list()\n}', + }, + go: { + method: 'client.FinancialAccounts.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.List(context.TODO(), lithic.FinancialAccountListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/financial_accounts/{financial_account_token}', + httpMethod: 'get', + summary: 'Get financial account', + description: 'Get a financial account', + stainlessPath: '(resource) financial_accounts > (method) retrieve', + qualified: 'client.financialAccounts.retrieve', + params: ['financial_account_token: string;'], + response: + "{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }", + markdown: + "## retrieve\n\n`client.financialAccounts.retrieve(financial_account_token: string): { token: string; account_token: string; created: string; credit_configuration: object; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}`\n\nGet a financial account\n\n### Parameters\n\n- `financial_account_token: string`\n\n### Returns\n\n- `{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `created: string`\n - `credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n - `is_for_benefit_of: boolean`\n - `nickname: string`\n - `status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'`\n - `substatus: string`\n - `type: string`\n - `updated: string`\n - `user_defined_status: string`\n - `account_number?: string`\n - `routing_number?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialAccount = await client.financialAccounts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(financialAccount);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialAccount = await client.financialAccounts.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(financialAccount.token);", + }, + python: { + method: 'financial_accounts.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_account = client.financial_accounts.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(financial_account.token)', + }, + java: { + method: 'financialAccounts().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccount;\nimport com.lithic.api.models.FinancialAccountRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccount financialAccount = client.financialAccounts().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccount\nimport com.lithic.api.models.FinancialAccountRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val financialAccount: FinancialAccount = client.financialAccounts().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialAccount, err := client.FinancialAccounts.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialAccount.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_account = lithic.financial_accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(financial_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/financial_accounts/{financial_account_token}', + httpMethod: 'patch', + summary: 'Update financial account', + description: 'Update a financial account', + stainlessPath: '(resource) financial_accounts > (method) update', + qualified: 'client.financialAccounts.update', + params: ['financial_account_token: string;', 'nickname?: string;'], + response: + "{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }", + markdown: + "## update\n\n`client.financialAccounts.update(financial_account_token: string, nickname?: string): { token: string; account_token: string; created: string; credit_configuration: object; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n**patch** `/v1/financial_accounts/{financial_account_token}`\n\nUpdate a financial account\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `nickname?: string`\n\n### Returns\n\n- `{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `created: string`\n - `credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n - `is_for_benefit_of: boolean`\n - `nickname: string`\n - `status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'`\n - `substatus: string`\n - `type: string`\n - `updated: string`\n - `user_defined_status: string`\n - `account_number?: string`\n - `routing_number?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialAccount = await client.financialAccounts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(financialAccount);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialAccount = await client.financialAccounts.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(financialAccount.token);", + }, + python: { + method: 'financial_accounts.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_account = client.financial_accounts.update(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(financial_account.token)', + }, + java: { + method: 'financialAccounts().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccount;\nimport com.lithic.api.models.FinancialAccountUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccount financialAccount = client.financialAccounts().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccount\nimport com.lithic.api.models.FinancialAccountUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val financialAccount: FinancialAccount = client.financialAccounts().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialAccount, err := client.FinancialAccounts.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialAccount.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_account = lithic.financial_accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(financial_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN \\\n -X PATCH \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update_status', + endpoint: '/v1/financial_accounts/{financial_account_token}/update_status', + httpMethod: 'post', + summary: 'Update financial account status', + description: 'Update financial account status', + stainlessPath: '(resource) financial_accounts > (method) update_status', + qualified: 'client.financialAccounts.updateStatus', + params: [ + 'financial_account_token: string;', + "status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING';", + 'substatus: string;', + 'user_defined_status?: string;', + ], + response: + "{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }", + markdown: + "## update_status\n\n`client.financialAccounts.updateStatus(financial_account_token: string, status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING', substatus: string, user_defined_status?: string): { token: string; account_token: string; created: string; credit_configuration: object; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n**post** `/v1/financial_accounts/{financial_account_token}/update_status`\n\nUpdate financial account status\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'`\n Status of the financial account\n\n- `substatus: string`\n Substatus for the financial account\n\n- `user_defined_status?: string`\n User-defined status for the financial account\n\n### Returns\n\n- `{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `created: string`\n - `credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n - `is_for_benefit_of: boolean`\n - `nickname: string`\n - `status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'`\n - `substatus: string`\n - `type: string`\n - `updated: string`\n - `user_defined_status: string`\n - `account_number?: string`\n - `routing_number?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialAccount = await client.financialAccounts.updateStatus('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { status: 'CLOSED', substatus: 'END_USER_REQUEST' });\n\nconsole.log(financialAccount);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.updateStatus', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialAccount = await client.financialAccounts.updateStatus(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { status: 'CLOSED', substatus: 'END_USER_REQUEST' },\n);\n\nconsole.log(financialAccount.token);", + }, + python: { + method: 'financial_accounts.update_status', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_account = client.financial_accounts.update_status(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n status="CLOSED",\n substatus="END_USER_REQUEST",\n)\nprint(financial_account.token)', + }, + java: { + method: 'financialAccounts().updateStatus', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccount;\nimport com.lithic.api.models.FinancialAccountUpdateStatusParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountUpdateStatusParams params = FinancialAccountUpdateStatusParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .status(FinancialAccountUpdateStatusParams.FinancialAccountStatus.CLOSED)\n .substatus(FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus.END_USER_REQUEST)\n .build();\n FinancialAccount financialAccount = client.financialAccounts().updateStatus(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().updateStatus', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccount\nimport com.lithic.api.models.FinancialAccountUpdateStatusParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountUpdateStatusParams = FinancialAccountUpdateStatusParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .status(FinancialAccountUpdateStatusParams.FinancialAccountStatus.CLOSED)\n .substatus(FinancialAccountUpdateStatusParams.UpdateFinancialAccountSubstatus.END_USER_REQUEST)\n .build()\n val financialAccount: FinancialAccount = client.financialAccounts().updateStatus(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.UpdateStatus', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialAccount, err := client.FinancialAccounts.UpdateStatus(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountUpdateStatusParams{\n\t\t\tStatus: lithic.F(lithic.FinancialAccountUpdateStatusParamsStatusClosed),\n\t\t\tSubstatus: lithic.F(lithic.FinancialAccountUpdateStatusParamsSubstatusEndUserRequest),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialAccount.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.update_status', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_account = lithic.financial_accounts.update_status(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n status: :CLOSED,\n substatus: :END_USER_REQUEST\n)\n\nputs(financial_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/update_status \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "status": "CLOSED",\n "substatus": "END_USER_REQUEST"\n }\'', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/financial_accounts', + httpMethod: 'post', + summary: 'Create financial account', + description: 'Create a new financial account', + stainlessPath: '(resource) financial_accounts > (method) create', + qualified: 'client.financialAccounts.create', + params: [ + 'nickname: string;', + "type: 'OPERATING';", + 'account_token?: string;', + 'is_for_benefit_of?: boolean;', + 'Idempotency-Key?: string;', + ], + response: + "{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }", + markdown: + "## create\n\n`client.financialAccounts.create(nickname: string, type: 'OPERATING', account_token?: string, is_for_benefit_of?: boolean, Idempotency-Key?: string): { token: string; account_token: string; created: string; credit_configuration: object; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n**post** `/v1/financial_accounts`\n\nCreate a new financial account\n\n### Parameters\n\n- `nickname: string`\n\n- `type: 'OPERATING'`\n\n- `account_token?: string`\n\n- `is_for_benefit_of?: boolean`\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ token: string; account_token: string; created: string; credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }; is_for_benefit_of: boolean; nickname: string; status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus: string; type: string; updated: string; user_defined_status: string; account_number?: string; routing_number?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `created: string`\n - `credit_configuration: { auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n - `is_for_benefit_of: boolean`\n - `nickname: string`\n - `status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'`\n - `substatus: string`\n - `type: string`\n - `updated: string`\n - `user_defined_status: string`\n - `account_number?: string`\n - `routing_number?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialAccount = await client.financialAccounts.create({ nickname: 'nickname', type: 'OPERATING' });\n\nconsole.log(financialAccount);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialAccount = await client.financialAccounts.create({\n nickname: 'nickname',\n type: 'OPERATING',\n});\n\nconsole.log(financialAccount.token);", + }, + python: { + method: 'financial_accounts.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_account = client.financial_accounts.create(\n nickname="nickname",\n type="OPERATING",\n)\nprint(financial_account.token)', + }, + java: { + method: 'financialAccounts().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccount;\nimport com.lithic.api.models.FinancialAccountCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountCreateParams params = FinancialAccountCreateParams.builder()\n .nickname("nickname")\n .type(FinancialAccountCreateParams.Type.OPERATING)\n .build();\n FinancialAccount financialAccount = client.financialAccounts().create(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccount\nimport com.lithic.api.models.FinancialAccountCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountCreateParams = FinancialAccountCreateParams.builder()\n .nickname("nickname")\n .type(FinancialAccountCreateParams.Type.OPERATING)\n .build()\n val financialAccount: FinancialAccount = client.financialAccounts().create(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialAccount, err := client.FinancialAccounts.New(context.TODO(), lithic.FinancialAccountNewParams{\n\t\tNickname: lithic.F("nickname"),\n\t\tType: lithic.F(lithic.FinancialAccountNewParamsTypeOperating),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialAccount.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_account = lithic.financial_accounts.create(nickname: "nickname", type: :OPERATING)\n\nputs(financial_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "nickname": "nickname",\n "type": "OPERATING"\n }\'', + }, + }, + }, + { + name: 'register_account_number', + endpoint: '/v1/financial_accounts/{financial_account_token}/register_account_number', + httpMethod: 'post', + summary: 'Register Account Number', + description: 'Register account number', + stainlessPath: '(resource) financial_accounts > (method) register_account_number', + qualified: 'client.financialAccounts.registerAccountNumber', + params: ['financial_account_token: string;', 'account_number: string;'], + markdown: + "## register_account_number\n\n`client.financialAccounts.registerAccountNumber(financial_account_token: string, account_number: string): void`\n\n**post** `/v1/financial_accounts/{financial_account_token}/register_account_number`\n\nRegister account number\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `account_number: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.financialAccounts.registerAccountNumber('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_number: 'account_number' })\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.registerAccountNumber', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.financialAccounts.registerAccountNumber('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n account_number: 'account_number',\n});", + }, + python: { + method: 'financial_accounts.register_account_number', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.financial_accounts.register_account_number(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n account_number="account_number",\n)', + }, + java: { + method: 'financialAccounts().registerAccountNumber', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountRegisterAccountNumberParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountRegisterAccountNumberParams params = FinancialAccountRegisterAccountNumberParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .accountNumber("account_number")\n .build();\n client.financialAccounts().registerAccountNumber(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().registerAccountNumber', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountRegisterAccountNumberParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountRegisterAccountNumberParams = FinancialAccountRegisterAccountNumberParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .accountNumber("account_number")\n .build()\n client.financialAccounts().registerAccountNumber(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.RegisterAccountNumber', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.FinancialAccounts.RegisterAccountNumber(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountRegisterAccountNumberParams{\n\t\t\tAccountNumber: lithic.F("account_number"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'financial_accounts.register_account_number', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.financial_accounts.register_account_number(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n account_number: "account_number"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/register_account_number \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "account_number": "account_number"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/balances', + httpMethod: 'get', + summary: 'Get balances', + description: 'Get the balances for a given financial account.', + stainlessPath: '(resource) financial_accounts.balances > (method) list', + qualified: 'client.financialAccounts.balances.list', + params: [ + 'financial_account_token: string;', + 'balance_date?: string;', + 'last_transaction_event_token?: string;', + ], + response: + "{ token: string; available_amount: number; created: string; currency: string; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; updated: string; }", + markdown: + "## list\n\n`client.financialAccounts.balances.list(financial_account_token: string, balance_date?: string, last_transaction_event_token?: string): { token: string; available_amount: number; created: string; currency: string; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; updated: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/balances`\n\nGet the balances for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `balance_date?: string`\n UTC date of the balance to retrieve. Defaults to latest available balance\n\n- `last_transaction_event_token?: string`\n Balance after a given financial event occured.\nNote: if an account receives multiple events around the same time whose financial impacts cancel out, a balance lookup by one of those event tokens may return 404, since their combined impact on the account is zero.\n\n\n### Returns\n\n- `{ token: string; available_amount: number; created: string; currency: string; last_transaction_event_token: string; last_transaction_token: string; pending_amount: number; total_amount: number; type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; updated: string; }`\n Balance of a Financial Account\n\n - `token: string`\n - `available_amount: number`\n - `created: string`\n - `currency: string`\n - `last_transaction_event_token: string`\n - `last_transaction_token: string`\n - `pending_amount: number`\n - `total_amount: number`\n - `type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const financialAccountBalance of client.financialAccounts.balances.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(financialAccountBalance);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.balances.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const financialAccountBalance of client.financialAccounts.balances.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(financialAccountBalance.token);\n}", + }, + python: { + method: 'financial_accounts.balances.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.balances.list(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'financialAccounts().balances().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountBalanceListPage;\nimport com.lithic.api.models.FinancialAccountBalanceListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountBalanceListPage page = client.financialAccounts().balances().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().balances().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountBalanceListPage\nimport com.lithic.api.models.FinancialAccountBalanceListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FinancialAccountBalanceListPage = client.financialAccounts().balances().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.Balances.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.Balances.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountBalanceListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.balances.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.balances.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/balances \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/financial_transactions', + httpMethod: 'get', + summary: 'List financial transactions', + description: 'List the financial transactions for a given financial account.', + stainlessPath: '(resource) financial_accounts.financial_transactions > (method) list', + qualified: 'client.financialAccounts.financialTransactions.list', + params: [ + 'financial_account_token: string;', + 'begin?: string;', + "category?: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER';", + 'end?: string;', + 'ending_before?: string;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED';", + ], + response: + "{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }", + markdown: + "## list\n\n`client.financialAccounts.financialTransactions.list(financial_account_token: string, begin?: string, category?: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER', end?: string, ending_before?: string, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'): { token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: financial_event[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/financial_transactions`\n\nList the financial transactions for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `category?: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'`\n Financial Transaction category to be returned.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `result?: 'APPROVED' | 'DECLINED'`\n Financial Transaction result to be returned.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'`\n Financial Transaction status to be returned.\n\n### Returns\n\n- `{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n - `token: string`\n - `category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'`\n - `created: string`\n - `currency: string`\n - `descriptor: string`\n - `events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const financialTransaction of client.financialAccounts.financialTransactions.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(financialTransaction);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.financialTransactions.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const financialTransaction of client.financialAccounts.financialTransactions.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(financialTransaction.token);\n}", + }, + python: { + method: 'financial_accounts.financial_transactions.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.financial_transactions.list(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'financialAccounts().financialTransactions().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialTransactionListPage;\nimport com.lithic.api.models.FinancialTransactionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialTransactionListPage page = client.financialAccounts().financialTransactions().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().financialTransactions().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialTransactionListPage\nimport com.lithic.api.models.FinancialTransactionListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FinancialTransactionListPage = client.financialAccounts().financialTransactions().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.FinancialTransactions.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.FinancialTransactions.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialTransactionListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.financial_transactions.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.financial_transactions.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/financial_transactions \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: + '/v1/financial_accounts/{financial_account_token}/financial_transactions/{financial_transaction_token}', + httpMethod: 'get', + summary: 'Get financial transaction', + description: 'Get the financial transaction for the provided token.', + stainlessPath: '(resource) financial_accounts.financial_transactions > (method) retrieve', + qualified: 'client.financialAccounts.financialTransactions.retrieve', + params: ['financial_account_token: string;', 'financial_transaction_token: string;'], + response: + "{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }", + markdown: + "## retrieve\n\n`client.financialAccounts.financialTransactions.retrieve(financial_account_token: string, financial_transaction_token: string): { token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: financial_event[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/financial_transactions/{financial_transaction_token}`\n\nGet the financial transaction for the provided token.\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `financial_transaction_token: string`\n\n### Returns\n\n- `{ token: string; category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'; updated: string; }`\n\n - `token: string`\n - `category: 'ACH' | 'CARD' | 'INTERNAL' | 'TRANSFER'`\n - `created: string`\n - `currency: string`\n - `descriptor: string`\n - `events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED'`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialTransaction = await client.financialAccounts.financialTransactions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(financialTransaction);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.financialTransactions.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialTransaction = await client.financialAccounts.financialTransactions.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(financialTransaction.token);", + }, + python: { + method: 'financial_accounts.financial_transactions.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_transaction = client.financial_accounts.financial_transactions.retrieve(\n financial_transaction_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(financial_transaction.token)', + }, + java: { + method: 'financialAccounts().financialTransactions().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialTransaction;\nimport com.lithic.api.models.FinancialTransactionRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialTransactionRetrieveParams params = FinancialTransactionRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n FinancialTransaction financialTransaction = client.financialAccounts().financialTransactions().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().financialTransactions().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialTransaction\nimport com.lithic.api.models.FinancialTransactionRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialTransactionRetrieveParams = FinancialTransactionRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val financialTransaction: FinancialTransaction = client.financialAccounts().financialTransactions().retrieve(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.FinancialTransactions.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialTransaction, err := client.FinancialAccounts.FinancialTransactions.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialTransaction.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.financial_transactions.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_transaction = lithic.financial_accounts.financial_transactions.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(financial_transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/financial_transactions/$FINANCIAL_TRANSACTION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/financial_accounts/{financial_account_token}/credit_configuration', + httpMethod: 'get', + summary: 'Get account credit configuration', + description: "Get an Account's credit configuration", + stainlessPath: '(resource) financial_accounts.credit_configuration > (method) retrieve', + qualified: 'client.financialAccounts.creditConfiguration.retrieve', + params: ['financial_account_token: string;'], + response: + '{ account_token: string; auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }', + markdown: + "## retrieve\n\n`client.financialAccounts.creditConfiguration.retrieve(financial_account_token: string): { account_token: string; auto_collection_configuration: object; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/credit_configuration`\n\nGet an Account's credit configuration\n\n### Parameters\n\n- `financial_account_token: string`\n\n### Returns\n\n- `{ account_token: string; auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n\n - `account_token: string`\n - `auto_collection_configuration: { auto_collection_enabled: boolean; }`\n - `credit_limit: number`\n - `credit_product_token: string`\n - `external_bank_account_token: string`\n - `tier: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialAccountCreditConfig = await client.financialAccounts.creditConfiguration.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(financialAccountCreditConfig);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.creditConfiguration.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialAccountCreditConfig = await client.financialAccounts.creditConfiguration.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(financialAccountCreditConfig.account_token);", + }, + python: { + method: 'financial_accounts.credit_configuration.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_account_credit_config = client.financial_accounts.credit_configuration.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(financial_account_credit_config.account_token)', + }, + java: { + method: 'financialAccounts().creditConfiguration().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountCreditConfig;\nimport com.lithic.api.models.FinancialAccountCreditConfigurationRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountCreditConfig financialAccountCreditConfig = client.financialAccounts().creditConfiguration().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().creditConfiguration().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountCreditConfig\nimport com.lithic.api.models.FinancialAccountCreditConfigurationRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val financialAccountCreditConfig: FinancialAccountCreditConfig = client.financialAccounts().creditConfiguration().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.CreditConfiguration.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialAccountCreditConfig, err := client.FinancialAccounts.CreditConfiguration.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialAccountCreditConfig.AccountToken)\n}\n', + }, + ruby: { + method: 'financial_accounts.credit_configuration.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_account_credit_config = lithic.financial_accounts.credit_configuration.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(financial_account_credit_config)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/credit_configuration \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/financial_accounts/{financial_account_token}/credit_configuration', + httpMethod: 'patch', + summary: 'Update account credit configuration', + description: "Update an account's credit configuration", + stainlessPath: '(resource) financial_accounts.credit_configuration > (method) update', + qualified: 'client.financialAccounts.creditConfiguration.update', + params: [ + 'financial_account_token: string;', + 'auto_collection_configuration?: { auto_collection_enabled?: boolean; };', + 'credit_limit?: number;', + 'credit_product_token?: string;', + 'external_bank_account_token?: string;', + 'tier?: string;', + ], + response: + '{ account_token: string; auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }', + markdown: + "## update\n\n`client.financialAccounts.creditConfiguration.update(financial_account_token: string, auto_collection_configuration?: { auto_collection_enabled?: boolean; }, credit_limit?: number, credit_product_token?: string, external_bank_account_token?: string, tier?: string): { account_token: string; auto_collection_configuration: object; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n\n**patch** `/v1/financial_accounts/{financial_account_token}/credit_configuration`\n\nUpdate an account's credit configuration\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `auto_collection_configuration?: { auto_collection_enabled?: boolean; }`\n - `auto_collection_enabled?: boolean`\n If auto collection is enabled for this account\n\n- `credit_limit?: number`\n\n- `credit_product_token?: string`\n Globally unique identifier for the credit product\n\n- `external_bank_account_token?: string`\n\n- `tier?: string`\n Tier to assign to a financial account\n\n### Returns\n\n- `{ account_token: string; auto_collection_configuration: { auto_collection_enabled: boolean; }; credit_limit: number; credit_product_token: string; external_bank_account_token: string; tier: string; }`\n\n - `account_token: string`\n - `auto_collection_configuration: { auto_collection_enabled: boolean; }`\n - `credit_limit: number`\n - `credit_product_token: string`\n - `external_bank_account_token: string`\n - `tier: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst financialAccountCreditConfig = await client.financialAccounts.creditConfiguration.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(financialAccountCreditConfig);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.creditConfiguration.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst financialAccountCreditConfig = await client.financialAccounts.creditConfiguration.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(financialAccountCreditConfig.account_token);", + }, + python: { + method: 'financial_accounts.credit_configuration.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfinancial_account_credit_config = client.financial_accounts.credit_configuration.update(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(financial_account_credit_config.account_token)', + }, + java: { + method: 'financialAccounts().creditConfiguration().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountCreditConfig;\nimport com.lithic.api.models.FinancialAccountCreditConfigurationUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountCreditConfig financialAccountCreditConfig = client.financialAccounts().creditConfiguration().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().creditConfiguration().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountCreditConfig\nimport com.lithic.api.models.FinancialAccountCreditConfigurationUpdateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val financialAccountCreditConfig: FinancialAccountCreditConfig = client.financialAccounts().creditConfiguration().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.CreditConfiguration.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfinancialAccountCreditConfig, err := client.FinancialAccounts.CreditConfiguration.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountCreditConfigurationUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", financialAccountCreditConfig.AccountToken)\n}\n', + }, + ruby: { + method: 'financial_accounts.credit_configuration.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfinancial_account_credit_config = lithic.financial_accounts.credit_configuration.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(financial_account_credit_config)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/credit_configuration \\\n -X PATCH \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/statements', + httpMethod: 'get', + summary: 'List statements', + description: 'List the statements for a given financial account.', + stainlessPath: '(resource) financial_accounts.statements > (method) list', + qualified: 'client.financialAccounts.statements.list', + params: [ + 'financial_account_token: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'include_initial_statements?: boolean;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; account_standing: object; amount_due: object; available_credit: number; created: string; credit_limit: number; credit_product_token: string; days_in_billing_cycle: number; ending_balance: number; financial_account_token: string; payment_due_date: string; period_totals: statement_totals; starting_balance: number; statement_end_date: string; statement_start_date: string; statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'; updated: string; ytd_totals: statement_totals; interest_details?: object; next_payment_due_date?: string; next_statement_end_date?: string; payoff_details?: object; statement_totals?: statement_totals; }", + markdown: + "## list\n\n`client.financialAccounts.statements.list(financial_account_token: string, begin?: string, end?: string, ending_before?: string, include_initial_statements?: boolean, page_size?: number, starting_after?: string): { token: string; account_standing: object; amount_due: object; available_credit: number; created: string; credit_limit: number; credit_product_token: string; days_in_billing_cycle: number; ending_balance: number; financial_account_token: string; payment_due_date: string; period_totals: statement_totals; starting_balance: number; statement_end_date: string; statement_start_date: string; statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'; updated: string; ytd_totals: statement_totals; interest_details?: object; next_payment_due_date?: string; next_statement_end_date?: string; payoff_details?: object; statement_totals?: statement_totals; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/statements`\n\nList the statements for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n Globally unique identifier for financial account.\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified date will be included.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified date will be included.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `include_initial_statements?: boolean`\n Whether to include the initial statement. It is not included by default.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }; amount_due: { amount: number; past_due: number; }; available_credit: number; created: string; credit_limit: number; credit_product_token: string; days_in_billing_cycle: number; ending_balance: number; financial_account_token: string; payment_due_date: string; period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; starting_balance: number; statement_end_date: string; statement_start_date: string; statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'; updated: string; ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; interest_details?: { actual_interest_charged: number; daily_balance_amounts: object; effective_apr: object; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: object; prime_rate: string; minimum_interest_charged?: number; }; next_payment_due_date?: string; next_statement_end_date?: string; payoff_details?: { minimum_payment_months: string; minimum_payment_total: string; payoff_period_length_months: number; payoff_period_monthly_payment_amount: number; payoff_period_payment_total: number; }; statement_totals?: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; }`\n\n - `token: string`\n - `account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }`\n - `amount_due: { amount: number; past_due: number; }`\n - `available_credit: number`\n - `created: string`\n - `credit_limit: number`\n - `credit_product_token: string`\n - `days_in_billing_cycle: number`\n - `ending_balance: number`\n - `financial_account_token: string`\n - `payment_due_date: string`\n - `period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `starting_balance: number`\n - `statement_end_date: string`\n - `statement_start_date: string`\n - `statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'`\n - `updated: string`\n - `ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `interest_details?: { actual_interest_charged: number; daily_balance_amounts: { balance_transfers: string; cash_advances: string; purchases: string; }; effective_apr: { balance_transfers: string; cash_advances: string; purchases: string; }; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: { balance_transfers: string; cash_advances: string; purchases: string; }; prime_rate: string; minimum_interest_charged?: number; }`\n - `next_payment_due_date?: string`\n - `next_statement_end_date?: string`\n - `payoff_details?: { minimum_payment_months: string; minimum_payment_total: string; payoff_period_length_months: number; payoff_period_monthly_payment_amount: number; payoff_period_payment_total: number; }`\n - `statement_totals?: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const statement of client.financialAccounts.statements.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(statement);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.statements.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const statement of client.financialAccounts.statements.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(statement.token);\n}", + }, + python: { + method: 'financial_accounts.statements.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.statements.list(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'financialAccounts().statements().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountStatementListPage;\nimport com.lithic.api.models.FinancialAccountStatementListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountStatementListPage page = client.financialAccounts().statements().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().statements().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountStatementListPage\nimport com.lithic.api.models.FinancialAccountStatementListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FinancialAccountStatementListPage = client.financialAccounts().statements().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.Statements.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.Statements.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountStatementListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.statements.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.statements.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/statements \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/financial_accounts/{financial_account_token}/statements/{statement_token}', + httpMethod: 'get', + summary: 'Get statement by token', + description: 'Get a specific statement for a given financial account.', + stainlessPath: '(resource) financial_accounts.statements > (method) retrieve', + qualified: 'client.financialAccounts.statements.retrieve', + params: ['financial_account_token: string;', 'statement_token: string;'], + response: + "{ token: string; account_standing: object; amount_due: object; available_credit: number; created: string; credit_limit: number; credit_product_token: string; days_in_billing_cycle: number; ending_balance: number; financial_account_token: string; payment_due_date: string; period_totals: statement_totals; starting_balance: number; statement_end_date: string; statement_start_date: string; statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'; updated: string; ytd_totals: statement_totals; interest_details?: object; next_payment_due_date?: string; next_statement_end_date?: string; payoff_details?: object; statement_totals?: statement_totals; }", + markdown: + "## retrieve\n\n`client.financialAccounts.statements.retrieve(financial_account_token: string, statement_token: string): { token: string; account_standing: object; amount_due: object; available_credit: number; created: string; credit_limit: number; credit_product_token: string; days_in_billing_cycle: number; ending_balance: number; financial_account_token: string; payment_due_date: string; period_totals: statement_totals; starting_balance: number; statement_end_date: string; statement_start_date: string; statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'; updated: string; ytd_totals: statement_totals; interest_details?: object; next_payment_due_date?: string; next_statement_end_date?: string; payoff_details?: object; statement_totals?: statement_totals; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/statements/{statement_token}`\n\nGet a specific statement for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n Globally unique identifier for financial account.\n\n- `statement_token: string`\n Globally unique identifier for statements.\n\n### Returns\n\n- `{ token: string; account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }; amount_due: { amount: number; past_due: number; }; available_credit: number; created: string; credit_limit: number; credit_product_token: string; days_in_billing_cycle: number; ending_balance: number; financial_account_token: string; payment_due_date: string; period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; starting_balance: number; statement_end_date: string; statement_start_date: string; statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'; updated: string; ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; interest_details?: { actual_interest_charged: number; daily_balance_amounts: object; effective_apr: object; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: object; prime_rate: string; minimum_interest_charged?: number; }; next_payment_due_date?: string; next_statement_end_date?: string; payoff_details?: { minimum_payment_months: string; minimum_payment_total: string; payoff_period_length_months: number; payoff_period_monthly_payment_amount: number; payoff_period_payment_total: number; }; statement_totals?: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; }`\n\n - `token: string`\n - `account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }`\n - `amount_due: { amount: number; past_due: number; }`\n - `available_credit: number`\n - `created: string`\n - `credit_limit: number`\n - `credit_product_token: string`\n - `days_in_billing_cycle: number`\n - `ending_balance: number`\n - `financial_account_token: string`\n - `payment_due_date: string`\n - `period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `starting_balance: number`\n - `statement_end_date: string`\n - `statement_start_date: string`\n - `statement_type: 'INITIAL' | 'PERIOD_END' | 'FINAL'`\n - `updated: string`\n - `ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `interest_details?: { actual_interest_charged: number; daily_balance_amounts: { balance_transfers: string; cash_advances: string; purchases: string; }; effective_apr: { balance_transfers: string; cash_advances: string; purchases: string; }; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: { balance_transfers: string; cash_advances: string; purchases: string; }; prime_rate: string; minimum_interest_charged?: number; }`\n - `next_payment_due_date?: string`\n - `next_statement_end_date?: string`\n - `payoff_details?: { minimum_payment_months: string; minimum_payment_total: string; payoff_period_length_months: number; payoff_period_monthly_payment_amount: number; payoff_period_payment_total: number; }`\n - `statement_totals?: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst statement = await client.financialAccounts.statements.retrieve('statement_token', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(statement);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.statements.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst statement = await client.financialAccounts.statements.retrieve('statement_token', {\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(statement.token);", + }, + python: { + method: 'financial_accounts.statements.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nstatement = client.financial_accounts.statements.retrieve(\n statement_token="statement_token",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(statement.token)', + }, + java: { + method: 'financialAccounts().statements().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountStatementRetrieveParams;\nimport com.lithic.api.models.Statement;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountStatementRetrieveParams params = FinancialAccountStatementRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .statementToken("statement_token")\n .build();\n Statement statement = client.financialAccounts().statements().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().statements().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountStatementRetrieveParams\nimport com.lithic.api.models.Statement\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountStatementRetrieveParams = FinancialAccountStatementRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .statementToken("statement_token")\n .build()\n val statement: Statement = client.financialAccounts().statements().retrieve(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.Statements.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tstatement, err := client.FinancialAccounts.Statements.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"statement_token",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", statement.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.statements.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nstatement = lithic.financial_accounts.statements.retrieve(\n "statement_token",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(statement)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/statements/$STATEMENT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/statements/{statement_token}/line_items', + httpMethod: 'get', + summary: 'List line items for a statement', + description: 'List the line items for a given statement within a given financial account.', + stainlessPath: '(resource) financial_accounts.statements.line_items > (method) list', + qualified: 'client.financialAccounts.statements.lineItems.list', + params: [ + 'financial_account_token: string;', + 'statement_token: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + '{ token: string; amount: number; category: string; created: string; currency: string; effective_date: string; event_type: string; financial_account_token: string; financial_transaction_event_token: string; financial_transaction_token: string; card_token?: string; descriptor?: string; event_subtype?: string; loan_tape_date?: string; }', + markdown: + "## list\n\n`client.financialAccounts.statements.lineItems.list(financial_account_token: string, statement_token: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; amount: number; category: string; created: string; currency: string; effective_date: string; event_type: string; financial_account_token: string; financial_transaction_event_token: string; financial_transaction_token: string; card_token?: string; descriptor?: string; event_subtype?: string; loan_tape_date?: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/statements/{statement_token}/line_items`\n\nList the line items for a given statement within a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n Globally unique identifier for financial account.\n\n- `statement_token: string`\n Globally unique identifier for statements.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; amount: number; category: string; created: string; currency: string; effective_date: string; event_type: string; financial_account_token: string; financial_transaction_event_token: string; financial_transaction_token: string; card_token?: string; descriptor?: string; event_subtype?: string; loan_tape_date?: string; }`\n\n - `token: string`\n - `amount: number`\n - `category: string`\n - `created: string`\n - `currency: string`\n - `effective_date: string`\n - `event_type: string`\n - `financial_account_token: string`\n - `financial_transaction_event_token: string`\n - `financial_transaction_token: string`\n - `card_token?: string`\n - `descriptor?: string`\n - `event_subtype?: string`\n - `loan_tape_date?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const lineItem of client.financialAccounts.statements.lineItems.list('statement_token', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' })) {\n console.log(lineItem);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.statements.lineItems.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const lineItem of client.financialAccounts.statements.lineItems.list('statement_token', {\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n})) {\n console.log(lineItem.token);\n}", + }, + python: { + method: 'financial_accounts.statements.line_items.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.statements.line_items.list(\n statement_token="statement_token",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'financialAccounts().statements().lineItems().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountStatementLineItemListPage;\nimport com.lithic.api.models.FinancialAccountStatementLineItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountStatementLineItemListParams params = FinancialAccountStatementLineItemListParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .statementToken("statement_token")\n .build();\n FinancialAccountStatementLineItemListPage page = client.financialAccounts().statements().lineItems().list(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().statements().lineItems().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountStatementLineItemListPage\nimport com.lithic.api.models.FinancialAccountStatementLineItemListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountStatementLineItemListParams = FinancialAccountStatementLineItemListParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .statementToken("statement_token")\n .build()\n val page: FinancialAccountStatementLineItemListPage = client.financialAccounts().statements().lineItems().list(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.Statements.LineItems.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.Statements.LineItems.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"statement_token",\n\t\tlithic.FinancialAccountStatementLineItemListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.statements.line_items.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.statements.line_items.list(\n "statement_token",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/statements/$STATEMENT_TOKEN/line_items \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/loan_tapes', + httpMethod: 'get', + summary: 'List loan tapes', + description: 'List the loan tapes for a given financial account.', + stainlessPath: '(resource) financial_accounts.loan_tapes > (method) list', + qualified: 'client.financialAccounts.loanTapes.list', + params: [ + 'financial_account_token: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + '{ token: string; account_standing: object; available_credit: number; balances: object; created: string; credit_limit: number; credit_product_token: string; date: string; day_totals: statement_totals; ending_balance: number; excess_credits: number; financial_account_token: string; interest_details: object; minimum_payment_balance: object; payment_allocation: object; period_totals: statement_totals; previous_statement_balance: object; starting_balance: number; updated: string; version: number; ytd_totals: statement_totals; day_of_period?: number; tier?: string; }', + markdown: + "## list\n\n`client.financialAccounts.loanTapes.list(financial_account_token: string, begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; account_standing: object; available_credit: number; balances: object; created: string; credit_limit: number; credit_product_token: string; date: string; day_totals: statement_totals; ending_balance: number; excess_credits: number; financial_account_token: string; interest_details: object; minimum_payment_balance: object; payment_allocation: object; period_totals: statement_totals; previous_statement_balance: object; starting_balance: number; updated: string; version: number; ytd_totals: statement_totals; day_of_period?: number; tier?: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/loan_tapes`\n\nList the loan tapes for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n Globally unique identifier for financial account.\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified date will be included.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified date will be included.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }; available_credit: number; balances: { due: object; next_statement_due: object; past_due: object; past_statements_due: object; }; created: string; credit_limit: number; credit_product_token: string; date: string; day_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; ending_balance: number; excess_credits: number; financial_account_token: string; interest_details: { actual_interest_charged: number; daily_balance_amounts: object; effective_apr: object; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: object; prime_rate: string; minimum_interest_charged?: number; }; minimum_payment_balance: { amount: number; remaining: number; }; payment_allocation: { fee_details: object; fees: number; interest: number; interest_details: object; principal: number; principal_details: object; }; period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; previous_statement_balance: { amount: number; remaining: number; }; starting_balance: number; updated: string; version: number; ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; day_of_period?: number; tier?: string; }`\n\n - `token: string`\n - `account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }`\n - `available_credit: number`\n - `balances: { due: { fees: number; interest: number; principal: number; }; next_statement_due: { fees: number; interest: number; principal: number; }; past_due: { fees: number; interest: number; principal: number; }; past_statements_due: { fees: number; interest: number; principal: number; }; }`\n - `created: string`\n - `credit_limit: number`\n - `credit_product_token: string`\n - `date: string`\n - `day_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `ending_balance: number`\n - `excess_credits: number`\n - `financial_account_token: string`\n - `interest_details: { actual_interest_charged: number; daily_balance_amounts: { balance_transfers: string; cash_advances: string; purchases: string; }; effective_apr: { balance_transfers: string; cash_advances: string; purchases: string; }; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: { balance_transfers: string; cash_advances: string; purchases: string; }; prime_rate: string; minimum_interest_charged?: number; }`\n - `minimum_payment_balance: { amount: number; remaining: number; }`\n - `payment_allocation: { fee_details: { balance_transfers: string; cash_advances: string; purchases: string; }; fees: number; interest: number; interest_details: { balance_transfers: string; cash_advances: string; purchases: string; }; principal: number; principal_details: { balance_transfers: string; cash_advances: string; purchases: string; }; }`\n - `period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `previous_statement_balance: { amount: number; remaining: number; }`\n - `starting_balance: number`\n - `updated: string`\n - `version: number`\n - `ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `day_of_period?: number`\n - `tier?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const loanTape of client.financialAccounts.loanTapes.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(loanTape);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.loanTapes.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const loanTape of client.financialAccounts.loanTapes.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(loanTape.token);\n}", + }, + python: { + method: 'financial_accounts.loan_tapes.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.loan_tapes.list(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'financialAccounts().loanTapes().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountLoanTapeListPage;\nimport com.lithic.api.models.FinancialAccountLoanTapeListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountLoanTapeListPage page = client.financialAccounts().loanTapes().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().loanTapes().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountLoanTapeListPage\nimport com.lithic.api.models.FinancialAccountLoanTapeListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FinancialAccountLoanTapeListPage = client.financialAccounts().loanTapes().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.LoanTapes.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.LoanTapes.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountLoanTapeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.loan_tapes.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.loan_tapes.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/loan_tapes \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/financial_accounts/{financial_account_token}/loan_tapes/{loan_tape_token}', + httpMethod: 'get', + summary: 'Get loan tape by token', + description: 'Get a specific loan tape for a given financial account.', + stainlessPath: '(resource) financial_accounts.loan_tapes > (method) retrieve', + qualified: 'client.financialAccounts.loanTapes.retrieve', + params: ['financial_account_token: string;', 'loan_tape_token: string;'], + response: + '{ token: string; account_standing: object; available_credit: number; balances: object; created: string; credit_limit: number; credit_product_token: string; date: string; day_totals: statement_totals; ending_balance: number; excess_credits: number; financial_account_token: string; interest_details: object; minimum_payment_balance: object; payment_allocation: object; period_totals: statement_totals; previous_statement_balance: object; starting_balance: number; updated: string; version: number; ytd_totals: statement_totals; day_of_period?: number; tier?: string; }', + markdown: + "## retrieve\n\n`client.financialAccounts.loanTapes.retrieve(financial_account_token: string, loan_tape_token: string): { token: string; account_standing: object; available_credit: number; balances: object; created: string; credit_limit: number; credit_product_token: string; date: string; day_totals: statement_totals; ending_balance: number; excess_credits: number; financial_account_token: string; interest_details: object; minimum_payment_balance: object; payment_allocation: object; period_totals: statement_totals; previous_statement_balance: object; starting_balance: number; updated: string; version: number; ytd_totals: statement_totals; day_of_period?: number; tier?: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/loan_tapes/{loan_tape_token}`\n\nGet a specific loan tape for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n Globally unique identifier for financial account.\n\n- `loan_tape_token: string`\n Globally unique identifier for loan tape.\n\n### Returns\n\n- `{ token: string; account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }; available_credit: number; balances: { due: object; next_statement_due: object; past_due: object; past_statements_due: object; }; created: string; credit_limit: number; credit_product_token: string; date: string; day_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; ending_balance: number; excess_credits: number; financial_account_token: string; interest_details: { actual_interest_charged: number; daily_balance_amounts: object; effective_apr: object; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: object; prime_rate: string; minimum_interest_charged?: number; }; minimum_payment_balance: { amount: number; remaining: number; }; payment_allocation: { fee_details: object; fees: number; interest: number; interest_details: object; principal: number; principal_details: object; }; period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; previous_statement_balance: { amount: number; remaining: number; }; starting_balance: number; updated: string; version: number; ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }; day_of_period?: number; tier?: string; }`\n\n - `token: string`\n - `account_standing: { consecutive_full_payments_made: number; consecutive_minimum_payments_made: number; consecutive_minimum_payments_missed: number; days_past_due: number; financial_account_state: { status: 'OPEN' | 'CLOSED' | 'SUSPENDED' | 'PENDING'; substatus?: string; }; has_grace: boolean; period_number: number; period_state: 'STANDARD' | 'PROMO' | 'PENALTY'; }`\n - `available_credit: number`\n - `balances: { due: { fees: number; interest: number; principal: number; }; next_statement_due: { fees: number; interest: number; principal: number; }; past_due: { fees: number; interest: number; principal: number; }; past_statements_due: { fees: number; interest: number; principal: number; }; }`\n - `created: string`\n - `credit_limit: number`\n - `credit_product_token: string`\n - `date: string`\n - `day_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `ending_balance: number`\n - `excess_credits: number`\n - `financial_account_token: string`\n - `interest_details: { actual_interest_charged: number; daily_balance_amounts: { balance_transfers: string; cash_advances: string; purchases: string; }; effective_apr: { balance_transfers: string; cash_advances: string; purchases: string; }; interest_calculation_method: 'DAILY' | 'AVERAGE_DAILY'; interest_for_period: { balance_transfers: string; cash_advances: string; purchases: string; }; prime_rate: string; minimum_interest_charged?: number; }`\n - `minimum_payment_balance: { amount: number; remaining: number; }`\n - `payment_allocation: { fee_details: { balance_transfers: string; cash_advances: string; purchases: string; }; fees: number; interest: number; interest_details: { balance_transfers: string; cash_advances: string; purchases: string; }; principal: number; principal_details: { balance_transfers: string; cash_advances: string; purchases: string; }; }`\n - `period_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `previous_statement_balance: { amount: number; remaining: number; }`\n - `starting_balance: number`\n - `updated: string`\n - `version: number`\n - `ytd_totals: { balance_transfers: number; cash_advances: number; credits: number; debits: number; fees: number; interest: number; payments: number; purchases: number; credit_details?: object; debit_details?: object; payment_details?: object; }`\n - `day_of_period?: number`\n - `tier?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst loanTape = await client.financialAccounts.loanTapes.retrieve('loan_tape_token', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(loanTape);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.loanTapes.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst loanTape = await client.financialAccounts.loanTapes.retrieve('loan_tape_token', {\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(loanTape.token);", + }, + python: { + method: 'financial_accounts.loan_tapes.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nloan_tape = client.financial_accounts.loan_tapes.retrieve(\n loan_tape_token="loan_tape_token",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(loan_tape.token)', + }, + java: { + method: 'financialAccounts().loanTapes().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountLoanTapeRetrieveParams;\nimport com.lithic.api.models.LoanTape;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountLoanTapeRetrieveParams params = FinancialAccountLoanTapeRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .loanTapeToken("loan_tape_token")\n .build();\n LoanTape loanTape = client.financialAccounts().loanTapes().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().loanTapes().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountLoanTapeRetrieveParams\nimport com.lithic.api.models.LoanTape\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountLoanTapeRetrieveParams = FinancialAccountLoanTapeRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .loanTapeToken("loan_tape_token")\n .build()\n val loanTape: LoanTape = client.financialAccounts().loanTapes().retrieve(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.LoanTapes.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tloanTape, err := client.FinancialAccounts.LoanTapes.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\t"loan_tape_token",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", loanTape.Token)\n}\n', + }, + ruby: { + method: 'financial_accounts.loan_tapes.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nloan_tape = lithic.financial_accounts.loan_tapes.retrieve(\n "loan_tape_token",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(loan_tape)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/loan_tapes/$LOAN_TAPE_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/financial_accounts/{financial_account_token}/loan_tape_configuration', + httpMethod: 'get', + summary: 'Get loan tape configuration', + description: 'Get the loan tape configuration for a given financial account.', + stainlessPath: '(resource) financial_accounts.loan_tape_configuration > (method) retrieve', + qualified: 'client.financialAccounts.loanTapeConfiguration.retrieve', + params: ['financial_account_token: string;'], + response: + '{ created_at: string; financial_account_token: string; instance_token: string; updated_at: string; credit_product_token?: string; loan_tape_rebuild_configuration?: { rebuild_needed: boolean; last_rebuild?: string; rebuild_from?: string; }; tier_schedule_changed_at?: string; }', + markdown: + "## retrieve\n\n`client.financialAccounts.loanTapeConfiguration.retrieve(financial_account_token: string): { created_at: string; financial_account_token: string; instance_token: string; updated_at: string; credit_product_token?: string; loan_tape_rebuild_configuration?: loan_tape_rebuild_configuration; tier_schedule_changed_at?: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/loan_tape_configuration`\n\nGet the loan tape configuration for a given financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n Globally unique identifier for financial account.\n\n### Returns\n\n- `{ created_at: string; financial_account_token: string; instance_token: string; updated_at: string; credit_product_token?: string; loan_tape_rebuild_configuration?: { rebuild_needed: boolean; last_rebuild?: string; rebuild_from?: string; }; tier_schedule_changed_at?: string; }`\n Configuration for loan tapes\n\n - `created_at: string`\n - `financial_account_token: string`\n - `instance_token: string`\n - `updated_at: string`\n - `credit_product_token?: string`\n - `loan_tape_rebuild_configuration?: { rebuild_needed: boolean; last_rebuild?: string; rebuild_from?: string; }`\n - `tier_schedule_changed_at?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst loanTapeConfiguration = await client.financialAccounts.loanTapeConfiguration.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(loanTapeConfiguration);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.loanTapeConfiguration.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst loanTapeConfiguration = await client.financialAccounts.loanTapeConfiguration.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(loanTapeConfiguration.created_at);", + }, + python: { + method: 'financial_accounts.loan_tape_configuration.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nloan_tape_configuration = client.financial_accounts.loan_tape_configuration.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(loan_tape_configuration.created_at)', + }, + java: { + method: 'financialAccounts().loanTapeConfiguration().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountLoanTapeConfigurationRetrieveParams;\nimport com.lithic.api.models.LoanTapeConfiguration;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n LoanTapeConfiguration loanTapeConfiguration = client.financialAccounts().loanTapeConfiguration().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().loanTapeConfiguration().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountLoanTapeConfigurationRetrieveParams\nimport com.lithic.api.models.LoanTapeConfiguration\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val loanTapeConfiguration: LoanTapeConfiguration = client.financialAccounts().loanTapeConfiguration().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.LoanTapeConfiguration.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tloanTapeConfiguration, err := client.FinancialAccounts.LoanTapeConfiguration.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", loanTapeConfiguration.CreatedAt)\n}\n', + }, + ruby: { + method: 'financial_accounts.loan_tape_configuration.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nloan_tape_configuration = lithic.financial_accounts.loan_tape_configuration.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(loan_tape_configuration)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/loan_tape_configuration \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/interest_tier_schedule', + httpMethod: 'get', + summary: 'List interest tier schedules', + description: + 'List interest tier schedules for a financial account with optional date filtering.\n\nIf no date parameters are provided, returns all tier schedules.\nIf date parameters are provided, uses filtering to return matching schedules (max 100).\n- for_date: Returns exact match (takes precedence over other dates)\n- before_date: Returns schedules with effective_date <= before_date\n- after_date: Returns schedules with effective_date >= after_date\n- Both before_date and after_date: Returns schedules in range', + stainlessPath: '(resource) financial_accounts.interest_tier_schedule > (method) list', + qualified: 'client.financialAccounts.interestTierSchedule.list', + params: [ + 'financial_account_token: string;', + 'after_date?: string;', + 'before_date?: string;', + 'for_date?: string;', + ], + response: + '{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }', + markdown: + "## list\n\n`client.financialAccounts.interestTierSchedule.list(financial_account_token: string, after_date?: string, before_date?: string, for_date?: string): { credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/interest_tier_schedule`\n\nList interest tier schedules for a financial account with optional date filtering.\n\nIf no date parameters are provided, returns all tier schedules.\nIf date parameters are provided, uses filtering to return matching schedules (max 100).\n- for_date: Returns exact match (takes precedence over other dates)\n- before_date: Returns schedules with effective_date <= before_date\n- after_date: Returns schedules with effective_date >= after_date\n- Both before_date and after_date: Returns schedules in range\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `after_date?: string`\n Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD)\n\n- `before_date?: string`\n Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD)\n\n- `for_date?: string`\n Return schedule with effective_date == for_date (ISO format YYYY-MM-DD)\n\n### Returns\n\n- `{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n Entry in the Tier Schedule of an account\n\n - `credit_product_token: string`\n - `effective_date: string`\n - `penalty_rates?: object`\n - `tier_name?: string`\n - `tier_rates?: object`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const interestTierSchedule of client.financialAccounts.interestTierSchedule.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(interestTierSchedule);\n}\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.interestTierSchedule.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const interestTierSchedule of client.financialAccounts.interestTierSchedule.list(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n)) {\n console.log(interestTierSchedule.credit_product_token);\n}", + }, + python: { + method: 'financial_accounts.interest_tier_schedule.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.financial_accounts.interest_tier_schedule.list(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.credit_product_token)', + }, + java: { + method: 'financialAccounts().interestTierSchedule().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleListPage;\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountInterestTierScheduleListPage page = client.financialAccounts().interestTierSchedule().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'financialAccounts().interestTierSchedule().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleListPage\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FinancialAccountInterestTierScheduleListPage = client.financialAccounts().interestTierSchedule().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FinancialAccounts.InterestTierSchedule.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FinancialAccounts.InterestTierSchedule.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountInterestTierScheduleListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'financial_accounts.interest_tier_schedule.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.financial_accounts.interest_tier_schedule.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/interest_tier_schedule \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/financial_accounts/{financial_account_token}/interest_tier_schedule', + httpMethod: 'post', + summary: 'Create interest tier schedule', + description: 'Create a new interest tier schedule entry for a supported financial account', + stainlessPath: '(resource) financial_accounts.interest_tier_schedule > (method) create', + qualified: 'client.financialAccounts.interestTierSchedule.create', + params: [ + 'financial_account_token: string;', + 'credit_product_token: string;', + 'effective_date: string;', + 'penalty_rates?: object;', + 'tier_name?: string;', + 'tier_rates?: object;', + ], + response: + '{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }', + markdown: + "## create\n\n`client.financialAccounts.interestTierSchedule.create(financial_account_token: string, credit_product_token: string, effective_date: string, penalty_rates?: object, tier_name?: string, tier_rates?: object): { credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n\n**post** `/v1/financial_accounts/{financial_account_token}/interest_tier_schedule`\n\nCreate a new interest tier schedule entry for a supported financial account\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `credit_product_token: string`\n Globally unique identifier for a credit product\n\n- `effective_date: string`\n Date the tier should be effective in YYYY-MM-DD format\n\n- `penalty_rates?: object`\n Custom rates per category for penalties\n\n- `tier_name?: string`\n Name of a tier contained in the credit product. Mutually exclusive with tier_rates\n\n- `tier_rates?: object`\n Custom rates per category. Mutually exclusive with tier_name\n\n### Returns\n\n- `{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n Entry in the Tier Schedule of an account\n\n - `credit_product_token: string`\n - `effective_date: string`\n - `penalty_rates?: object`\n - `tier_name?: string`\n - `tier_rates?: object`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst interestTierSchedule = await client.financialAccounts.interestTierSchedule.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { credit_product_token: 'credit_product_token', effective_date: '2019-12-27' });\n\nconsole.log(interestTierSchedule);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.interestTierSchedule.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst interestTierSchedule = await client.financialAccounts.interestTierSchedule.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { credit_product_token: 'credit_product_token', effective_date: '2019-12-27' },\n);\n\nconsole.log(interestTierSchedule.credit_product_token);", + }, + python: { + method: 'financial_accounts.interest_tier_schedule.create', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ninterest_tier_schedule = client.financial_accounts.interest_tier_schedule.create(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n credit_product_token="credit_product_token",\n effective_date=date.fromisoformat("2019-12-27"),\n)\nprint(interest_tier_schedule.credit_product_token)', + }, + java: { + method: 'financialAccounts().interestTierSchedule().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleCreateParams;\nimport com.lithic.api.models.InterestTierSchedule;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountInterestTierScheduleCreateParams params = FinancialAccountInterestTierScheduleCreateParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .interestTierSchedule(InterestTierSchedule.builder()\n .creditProductToken("credit_product_token")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build())\n .build();\n InterestTierSchedule interestTierSchedule = client.financialAccounts().interestTierSchedule().create(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().interestTierSchedule().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleCreateParams\nimport com.lithic.api.models.InterestTierSchedule\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountInterestTierScheduleCreateParams = FinancialAccountInterestTierScheduleCreateParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .interestTierSchedule(InterestTierSchedule.builder()\n .creditProductToken("credit_product_token")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build())\n .build()\n val interestTierSchedule: InterestTierSchedule = client.financialAccounts().interestTierSchedule().create(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.InterestTierSchedule.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tinterestTierSchedule, err := client.FinancialAccounts.InterestTierSchedule.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.FinancialAccountInterestTierScheduleNewParams{\n\t\t\tInterestTierSchedule: lithic.InterestTierScheduleParam{\n\t\t\t\tCreditProductToken: lithic.F("credit_product_token"),\n\t\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", interestTierSchedule.CreditProductToken)\n}\n', + }, + ruby: { + method: 'financial_accounts.interest_tier_schedule.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ninterest_tier_schedule = lithic.financial_accounts.interest_tier_schedule.create(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n credit_product_token: "credit_product_token",\n effective_date: "2019-12-27"\n)\n\nputs(interest_tier_schedule)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/interest_tier_schedule \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "credit_product_token": "credit_product_token",\n "effective_date": "2019-12-27"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/financial_accounts/{financial_account_token}/interest_tier_schedule/{effective_date}', + httpMethod: 'get', + summary: 'Get interest tier schedule', + description: 'Get a specific interest tier schedule by effective date', + stainlessPath: '(resource) financial_accounts.interest_tier_schedule > (method) retrieve', + qualified: 'client.financialAccounts.interestTierSchedule.retrieve', + params: ['financial_account_token: string;', 'effective_date: string;'], + response: + '{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }', + markdown: + "## retrieve\n\n`client.financialAccounts.interestTierSchedule.retrieve(financial_account_token: string, effective_date: string): { credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/interest_tier_schedule/{effective_date}`\n\nGet a specific interest tier schedule by effective date\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `effective_date: string`\n\n### Returns\n\n- `{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n Entry in the Tier Schedule of an account\n\n - `credit_product_token: string`\n - `effective_date: string`\n - `penalty_rates?: object`\n - `tier_name?: string`\n - `tier_rates?: object`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst interestTierSchedule = await client.financialAccounts.interestTierSchedule.retrieve('2019-12-27', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(interestTierSchedule);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.interestTierSchedule.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst interestTierSchedule = await client.financialAccounts.interestTierSchedule.retrieve(\n '2019-12-27',\n { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(interestTierSchedule.credit_product_token);", + }, + python: { + method: 'financial_accounts.interest_tier_schedule.retrieve', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ninterest_tier_schedule = client.financial_accounts.interest_tier_schedule.retrieve(\n effective_date=date.fromisoformat("2019-12-27"),\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(interest_tier_schedule.credit_product_token)', + }, + java: { + method: 'financialAccounts().interestTierSchedule().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleRetrieveParams;\nimport com.lithic.api.models.InterestTierSchedule;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountInterestTierScheduleRetrieveParams params = FinancialAccountInterestTierScheduleRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n InterestTierSchedule interestTierSchedule = client.financialAccounts().interestTierSchedule().retrieve(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().interestTierSchedule().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleRetrieveParams\nimport com.lithic.api.models.InterestTierSchedule\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountInterestTierScheduleRetrieveParams = FinancialAccountInterestTierScheduleRetrieveParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val interestTierSchedule: InterestTierSchedule = client.financialAccounts().interestTierSchedule().retrieve(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.InterestTierSchedule.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tinterestTierSchedule, err := client.FinancialAccounts.InterestTierSchedule.Get(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\ttime.Now(),\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", interestTierSchedule.CreditProductToken)\n}\n', + }, + ruby: { + method: 'financial_accounts.interest_tier_schedule.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ninterest_tier_schedule = lithic.financial_accounts.interest_tier_schedule.retrieve(\n "2019-12-27",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(interest_tier_schedule)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/interest_tier_schedule/$EFFECTIVE_DATE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/financial_accounts/{financial_account_token}/interest_tier_schedule/{effective_date}', + httpMethod: 'put', + summary: 'Update interest tier schedule', + description: 'Update an existing interest tier schedule', + stainlessPath: '(resource) financial_accounts.interest_tier_schedule > (method) update', + qualified: 'client.financialAccounts.interestTierSchedule.update', + params: [ + 'financial_account_token: string;', + 'effective_date: string;', + 'penalty_rates?: object;', + 'tier_name?: string;', + 'tier_rates?: object;', + ], + response: + '{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }', + markdown: + "## update\n\n`client.financialAccounts.interestTierSchedule.update(financial_account_token: string, effective_date: string, penalty_rates?: object, tier_name?: string, tier_rates?: object): { credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n\n**put** `/v1/financial_accounts/{financial_account_token}/interest_tier_schedule/{effective_date}`\n\nUpdate an existing interest tier schedule\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `effective_date: string`\n\n- `penalty_rates?: object`\n Custom rates per category for penalties\n\n- `tier_name?: string`\n Name of a tier contained in the credit product. Mutually exclusive with tier_rates\n\n- `tier_rates?: object`\n Custom rates per category. Mutually exclusive with tier_name\n\n### Returns\n\n- `{ credit_product_token: string; effective_date: string; penalty_rates?: object; tier_name?: string; tier_rates?: object; }`\n Entry in the Tier Schedule of an account\n\n - `credit_product_token: string`\n - `effective_date: string`\n - `penalty_rates?: object`\n - `tier_name?: string`\n - `tier_rates?: object`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst interestTierSchedule = await client.financialAccounts.interestTierSchedule.update('2019-12-27', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(interestTierSchedule);\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.interestTierSchedule.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst interestTierSchedule = await client.financialAccounts.interestTierSchedule.update(\n '2019-12-27',\n { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(interestTierSchedule.credit_product_token);", + }, + python: { + method: 'financial_accounts.interest_tier_schedule.update', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ninterest_tier_schedule = client.financial_accounts.interest_tier_schedule.update(\n effective_date=date.fromisoformat("2019-12-27"),\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(interest_tier_schedule.credit_product_token)', + }, + java: { + method: 'financialAccounts().interestTierSchedule().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleUpdateParams;\nimport com.lithic.api.models.InterestTierSchedule;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountInterestTierScheduleUpdateParams params = FinancialAccountInterestTierScheduleUpdateParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n InterestTierSchedule interestTierSchedule = client.financialAccounts().interestTierSchedule().update(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().interestTierSchedule().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleUpdateParams\nimport com.lithic.api.models.InterestTierSchedule\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountInterestTierScheduleUpdateParams = FinancialAccountInterestTierScheduleUpdateParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val interestTierSchedule: InterestTierSchedule = client.financialAccounts().interestTierSchedule().update(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.InterestTierSchedule.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tinterestTierSchedule, err := client.FinancialAccounts.InterestTierSchedule.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\ttime.Now(),\n\t\tlithic.FinancialAccountInterestTierScheduleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", interestTierSchedule.CreditProductToken)\n}\n', + }, + ruby: { + method: 'financial_accounts.interest_tier_schedule.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ninterest_tier_schedule = lithic.financial_accounts.interest_tier_schedule.update(\n "2019-12-27",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(interest_tier_schedule)', + }, + http: { + example: + "curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/interest_tier_schedule/$EFFECTIVE_DATE \\\n -X PUT \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/financial_accounts/{financial_account_token}/interest_tier_schedule/{effective_date}', + httpMethod: 'delete', + summary: 'Delete interest tier schedule', + description: + "Delete an interest tier schedule entry.\n\nReturns:\n- 400 Bad Request: Invalid effective_date format OR attempting to delete the earliest\n tier schedule entry for a non-PENDING account\n- 404 Not Found: Tier schedule entry not found for the given effective_date OR ledger account not found\n\nNote: PENDING accounts can delete the earliest tier schedule entry (account hasn't opened yet).\nActive/non-PENDING accounts cannot delete the earliest entry to prevent orphaning the account.\n\nIf the deleted tier schedule has a past effective_date and the account is ACTIVE,\nthe loan tape rebuild configuration will be updated to trigger rebuilds from that date.", + stainlessPath: '(resource) financial_accounts.interest_tier_schedule > (method) delete', + qualified: 'client.financialAccounts.interestTierSchedule.delete', + params: ['financial_account_token: string;', 'effective_date: string;'], + markdown: + "## delete\n\n`client.financialAccounts.interestTierSchedule.delete(financial_account_token: string, effective_date: string): void`\n\n**delete** `/v1/financial_accounts/{financial_account_token}/interest_tier_schedule/{effective_date}`\n\nDelete an interest tier schedule entry.\n\nReturns:\n- 400 Bad Request: Invalid effective_date format OR attempting to delete the earliest\n tier schedule entry for a non-PENDING account\n- 404 Not Found: Tier schedule entry not found for the given effective_date OR ledger account not found\n\nNote: PENDING accounts can delete the earliest tier schedule entry (account hasn't opened yet).\nActive/non-PENDING accounts cannot delete the earliest entry to prevent orphaning the account.\n\nIf the deleted tier schedule has a past effective_date and the account is ACTIVE,\nthe loan tape rebuild configuration will be updated to trigger rebuilds from that date.\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `effective_date: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.financialAccounts.interestTierSchedule.delete('2019-12-27', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' })\n```", + perLanguage: { + typescript: { + method: 'client.financialAccounts.interestTierSchedule.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.financialAccounts.interestTierSchedule.delete('2019-12-27', {\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});", + }, + python: { + method: 'financial_accounts.interest_tier_schedule.delete', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.financial_accounts.interest_tier_schedule.delete(\n effective_date=date.fromisoformat("2019-12-27"),\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)', + }, + java: { + method: 'financialAccounts().interestTierSchedule().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleDeleteParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FinancialAccountInterestTierScheduleDeleteParams params = FinancialAccountInterestTierScheduleDeleteParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n client.financialAccounts().interestTierSchedule().delete(params);\n }\n}', + }, + kotlin: { + method: 'financialAccounts().interestTierSchedule().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FinancialAccountInterestTierScheduleDeleteParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FinancialAccountInterestTierScheduleDeleteParams = FinancialAccountInterestTierScheduleDeleteParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n client.financialAccounts().interestTierSchedule().delete(params)\n}', + }, + go: { + method: 'client.FinancialAccounts.InterestTierSchedule.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.FinancialAccounts.InterestTierSchedule.Delete(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\ttime.Now(),\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'financial_accounts.interest_tier_schedule.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.financial_accounts.interest_tier_schedule.delete(\n "2019-12-27",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/interest_tier_schedule/$EFFECTIVE_DATE \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/transactions', + httpMethod: 'get', + summary: 'List card transactions', + description: + 'List card transactions. All amounts are in the smallest unit of their respective currency (e.g., cents for USD) and inclusive of any acquirer fees.\n', + stainlessPath: '(resource) transactions > (method) list', + qualified: 'client.transactions.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'card_token?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'PENDING' | 'VOIDED' | 'SETTLED' | 'DECLINED' | 'EXPIRED';", + ], + response: + "{ token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: object; authorization_amount: number; authorization_code: string; avs: object; card_token: string; cardholder_authentication: cardholder_authentication; created: string; financial_account_token: string; merchant: merchant; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: object; result: string; service_location: object; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: token_info; updated: string; events?: object[]; }", + markdown: + "## list\n\n`client.transactions.list(account_token?: string, begin?: string, card_token?: string, end?: string, ending_before?: string, page_size?: number, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'PENDING' | 'VOIDED' | 'SETTLED' | 'DECLINED' | 'EXPIRED'): { token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: object; authorization_amount: number; authorization_code: string; avs: object; card_token: string; cardholder_authentication: cardholder_authentication; created: string; financial_account_token: string; merchant: merchant; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: object; result: string; service_location: object; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: token_info; updated: string; events?: object[]; }`\n\n**get** `/v1/transactions`\n\nList card transactions. All amounts are in the smallest unit of their respective currency (e.g., cents for USD) and inclusive of any acquirer fees.\n\n\n### Parameters\n\n- `account_token?: string`\n Filters for transactions associated with a specific account.\n\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `card_token?: string`\n Filters for transactions associated with a specific card.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `result?: 'APPROVED' | 'DECLINED'`\n Filters for transactions using transaction result field. Can filter by `APPROVED`, and `DECLINED`.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'PENDING' | 'VOIDED' | 'SETTLED' | 'DECLINED' | 'EXPIRED'`\n Filters for transactions using transaction status field.\n\n### Returns\n\n- `{ token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: { cardholder: { amount: number; conversion_rate: string; currency: currency; }; hold: { amount: number; currency: currency; }; merchant: { amount: number; currency: currency; }; settlement: { amount: number; currency: currency; }; }; authorization_amount: number; authorization_code: string; avs: { address: string; zipcode: string; }; card_token: string; cardholder_authentication: { authentication_method: 'FRICTIONLESS' | 'CHALLENGE' | 'NONE'; authentication_result: 'ATTEMPTS' | 'DECLINE' | 'NONE' | 'SUCCESS'; decision_made_by: 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'LITHIC_DEFAULT' | 'LITHIC_RULES' | 'NETWORK' | 'UNKNOWN'; liability_shift: '3DS_AUTHENTICATED' | 'TOKEN_AUTHENTICATED' | 'NONE'; three_ds_authentication_token: string; }; created: string; financial_account_token: string; merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: { entry_mode: { card: 'NOT_PRESENT' | 'PREAUTHORIZED' | 'PRESENT' | 'UNKNOWN'; cardholder: string; pan: string; pin_entered: boolean; }; terminal: { attended: boolean; card_retention_capable: boolean; on_premise: boolean; operator: 'ADMINISTRATIVE' | 'CARDHOLDER' | 'CARD_ACCEPTOR' | 'UNKNOWN'; partial_approval_capable: boolean; pin_capability: 'CAPABLE' | 'INOPERATIVE' | 'NOT_CAPABLE' | 'UNSPECIFIED'; type: string; acceptor_terminal_id?: string; }; }; result: string; service_location: { city: string; country: string; postal_code: string; state: string; street_address: string; }; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: { wallet_type: 'APPLE_PAY' | 'GOOGLE_PAY' | 'MASTERPASS' | 'MERCHANT' | 'OTHER' | 'SAMSUNG_PAY'; }; updated: string; events?: { token: string; amount: number; amounts: { cardholder: object; merchant: object; settlement: object; }; created: string; detailed_results: string[]; effective_polarity: 'CREDIT' | 'DEBIT'; network_info: { acquirer: object; amex: object; mastercard: object; visa: object; }; result: string; rule_results: { auth_rule_token: string; explanation: string; name: string; result: string; }[]; type: string; account_type?: 'CHECKING' | 'SAVINGS'; network_specific_data?: { mastercard: object; visa: object; }; }[]; }`\n\n - `token: string`\n - `account_token: string`\n - `acquirer_fee: number`\n - `acquirer_reference_number: string`\n - `amount: number`\n - `amounts: { cardholder: { amount: number; conversion_rate: string; currency: string; }; hold: { amount: number; currency: string; }; merchant: { amount: number; currency: string; }; settlement: { amount: number; currency: string; }; }`\n - `authorization_amount: number`\n - `authorization_code: string`\n - `avs: { address: string; zipcode: string; }`\n - `card_token: string`\n - `cardholder_authentication: { authentication_method: 'FRICTIONLESS' | 'CHALLENGE' | 'NONE'; authentication_result: 'ATTEMPTS' | 'DECLINE' | 'NONE' | 'SUCCESS'; decision_made_by: 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'LITHIC_DEFAULT' | 'LITHIC_RULES' | 'NETWORK' | 'UNKNOWN'; liability_shift: '3DS_AUTHENTICATED' | 'TOKEN_AUTHENTICATED' | 'NONE'; three_ds_authentication_token: string; }`\n - `created: string`\n - `financial_account_token: string`\n - `merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }`\n - `merchant_amount: number`\n - `merchant_authorization_amount: number`\n - `merchant_currency: string`\n - `network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'`\n - `network_risk_score: number`\n - `pos: { entry_mode: { card: 'NOT_PRESENT' | 'PREAUTHORIZED' | 'PRESENT' | 'UNKNOWN'; cardholder: string; pan: string; pin_entered: boolean; }; terminal: { attended: boolean; card_retention_capable: boolean; on_premise: boolean; operator: 'ADMINISTRATIVE' | 'CARDHOLDER' | 'CARD_ACCEPTOR' | 'UNKNOWN'; partial_approval_capable: boolean; pin_capability: 'CAPABLE' | 'INOPERATIVE' | 'NOT_CAPABLE' | 'UNSPECIFIED'; type: string; acceptor_terminal_id?: string; }; }`\n - `result: string`\n - `service_location: { city: string; country: string; postal_code: string; state: string; street_address: string; }`\n - `settled_amount: number`\n - `status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'`\n - `tags: object`\n - `token_info: { wallet_type: 'APPLE_PAY' | 'GOOGLE_PAY' | 'MASTERPASS' | 'MERCHANT' | 'OTHER' | 'SAMSUNG_PAY'; }`\n - `updated: string`\n - `events?: { token: string; amount: number; amounts: { cardholder: { amount: number; conversion_rate: string; currency: string; }; merchant: { amount: number; currency: string; }; settlement: { amount: number; conversion_rate: string; currency: string; }; }; created: string; detailed_results: string[]; effective_polarity: 'CREDIT' | 'DEBIT'; network_info: { acquirer: { acquirer_reference_number: string; retrieval_reference_number: string; }; amex: { original_transaction_id: string; transaction_id: string; }; mastercard: { banknet_reference_number: string; original_banknet_reference_number: string; original_switch_serial_number: string; switch_serial_number: string; }; visa: { original_transaction_id: string; transaction_id: string; }; }; result: string; rule_results: { auth_rule_token: string; explanation: string; name: string; result: string; }[]; type: string; account_type?: 'CHECKING' | 'SAVINGS'; network_specific_data?: { mastercard: { ecommerce_security_level_indicator: string; on_behalf_service_result: { result_1: string; result_2: string; service: string; }[]; transaction_type_identifier: string; }; visa: { business_application_identifier: string; }; }; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const transaction of client.transactions.list()) {\n console.log(transaction);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transactions.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const transaction of client.transactions.list()) {\n console.log(transaction.token);\n}", + }, + python: { + method: 'transactions.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transactions.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'transactions().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionListPage;\nimport com.lithic.api.models.TransactionListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionListPage page = client.transactions().list();\n }\n}', + }, + kotlin: { + method: 'transactions().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionListPage\nimport com.lithic.api.models.TransactionListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransactionListPage = client.transactions().list()\n}', + }, + go: { + method: 'client.Transactions.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Transactions.List(context.TODO(), lithic.TransactionListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transactions.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transactions.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/transactions \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/transactions/{transaction_token}', + httpMethod: 'get', + summary: 'Get card transaction', + description: + 'Get a specific card transaction. All amounts are in the smallest unit of their respective currency (e.g., cents for USD).\n', + stainlessPath: '(resource) transactions > (method) retrieve', + qualified: 'client.transactions.retrieve', + params: ['transaction_token: string;'], + response: + "{ token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: object; authorization_amount: number; authorization_code: string; avs: object; card_token: string; cardholder_authentication: cardholder_authentication; created: string; financial_account_token: string; merchant: merchant; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: object; result: string; service_location: object; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: token_info; updated: string; events?: object[]; }", + markdown: + "## retrieve\n\n`client.transactions.retrieve(transaction_token: string): { token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: object; authorization_amount: number; authorization_code: string; avs: object; card_token: string; cardholder_authentication: cardholder_authentication; created: string; financial_account_token: string; merchant: merchant; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: object; result: string; service_location: object; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: token_info; updated: string; events?: object[]; }`\n\n**get** `/v1/transactions/{transaction_token}`\n\nGet a specific card transaction. All amounts are in the smallest unit of their respective currency (e.g., cents for USD).\n\n\n### Parameters\n\n- `transaction_token: string`\n\n### Returns\n\n- `{ token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: { cardholder: { amount: number; conversion_rate: string; currency: currency; }; hold: { amount: number; currency: currency; }; merchant: { amount: number; currency: currency; }; settlement: { amount: number; currency: currency; }; }; authorization_amount: number; authorization_code: string; avs: { address: string; zipcode: string; }; card_token: string; cardholder_authentication: { authentication_method: 'FRICTIONLESS' | 'CHALLENGE' | 'NONE'; authentication_result: 'ATTEMPTS' | 'DECLINE' | 'NONE' | 'SUCCESS'; decision_made_by: 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'LITHIC_DEFAULT' | 'LITHIC_RULES' | 'NETWORK' | 'UNKNOWN'; liability_shift: '3DS_AUTHENTICATED' | 'TOKEN_AUTHENTICATED' | 'NONE'; three_ds_authentication_token: string; }; created: string; financial_account_token: string; merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: { entry_mode: { card: 'NOT_PRESENT' | 'PREAUTHORIZED' | 'PRESENT' | 'UNKNOWN'; cardholder: string; pan: string; pin_entered: boolean; }; terminal: { attended: boolean; card_retention_capable: boolean; on_premise: boolean; operator: 'ADMINISTRATIVE' | 'CARDHOLDER' | 'CARD_ACCEPTOR' | 'UNKNOWN'; partial_approval_capable: boolean; pin_capability: 'CAPABLE' | 'INOPERATIVE' | 'NOT_CAPABLE' | 'UNSPECIFIED'; type: string; acceptor_terminal_id?: string; }; }; result: string; service_location: { city: string; country: string; postal_code: string; state: string; street_address: string; }; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: { wallet_type: 'APPLE_PAY' | 'GOOGLE_PAY' | 'MASTERPASS' | 'MERCHANT' | 'OTHER' | 'SAMSUNG_PAY'; }; updated: string; events?: { token: string; amount: number; amounts: { cardholder: object; merchant: object; settlement: object; }; created: string; detailed_results: string[]; effective_polarity: 'CREDIT' | 'DEBIT'; network_info: { acquirer: object; amex: object; mastercard: object; visa: object; }; result: string; rule_results: { auth_rule_token: string; explanation: string; name: string; result: string; }[]; type: string; account_type?: 'CHECKING' | 'SAVINGS'; network_specific_data?: { mastercard: object; visa: object; }; }[]; }`\n\n - `token: string`\n - `account_token: string`\n - `acquirer_fee: number`\n - `acquirer_reference_number: string`\n - `amount: number`\n - `amounts: { cardholder: { amount: number; conversion_rate: string; currency: string; }; hold: { amount: number; currency: string; }; merchant: { amount: number; currency: string; }; settlement: { amount: number; currency: string; }; }`\n - `authorization_amount: number`\n - `authorization_code: string`\n - `avs: { address: string; zipcode: string; }`\n - `card_token: string`\n - `cardholder_authentication: { authentication_method: 'FRICTIONLESS' | 'CHALLENGE' | 'NONE'; authentication_result: 'ATTEMPTS' | 'DECLINE' | 'NONE' | 'SUCCESS'; decision_made_by: 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'LITHIC_DEFAULT' | 'LITHIC_RULES' | 'NETWORK' | 'UNKNOWN'; liability_shift: '3DS_AUTHENTICATED' | 'TOKEN_AUTHENTICATED' | 'NONE'; three_ds_authentication_token: string; }`\n - `created: string`\n - `financial_account_token: string`\n - `merchant: { acceptor_id: string; acquiring_institution_id: string; city: string; country: string; descriptor: string; mcc: string; state: string; }`\n - `merchant_amount: number`\n - `merchant_authorization_amount: number`\n - `merchant_currency: string`\n - `network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'`\n - `network_risk_score: number`\n - `pos: { entry_mode: { card: 'NOT_PRESENT' | 'PREAUTHORIZED' | 'PRESENT' | 'UNKNOWN'; cardholder: string; pan: string; pin_entered: boolean; }; terminal: { attended: boolean; card_retention_capable: boolean; on_premise: boolean; operator: 'ADMINISTRATIVE' | 'CARDHOLDER' | 'CARD_ACCEPTOR' | 'UNKNOWN'; partial_approval_capable: boolean; pin_capability: 'CAPABLE' | 'INOPERATIVE' | 'NOT_CAPABLE' | 'UNSPECIFIED'; type: string; acceptor_terminal_id?: string; }; }`\n - `result: string`\n - `service_location: { city: string; country: string; postal_code: string; state: string; street_address: string; }`\n - `settled_amount: number`\n - `status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'`\n - `tags: object`\n - `token_info: { wallet_type: 'APPLE_PAY' | 'GOOGLE_PAY' | 'MASTERPASS' | 'MERCHANT' | 'OTHER' | 'SAMSUNG_PAY'; }`\n - `updated: string`\n - `events?: { token: string; amount: number; amounts: { cardholder: { amount: number; conversion_rate: string; currency: string; }; merchant: { amount: number; currency: string; }; settlement: { amount: number; conversion_rate: string; currency: string; }; }; created: string; detailed_results: string[]; effective_polarity: 'CREDIT' | 'DEBIT'; network_info: { acquirer: { acquirer_reference_number: string; retrieval_reference_number: string; }; amex: { original_transaction_id: string; transaction_id: string; }; mastercard: { banknet_reference_number: string; original_banknet_reference_number: string; original_switch_serial_number: string; switch_serial_number: string; }; visa: { original_transaction_id: string; transaction_id: string; }; }; result: string; rule_results: { auth_rule_token: string; explanation: string; name: string; result: string; }[]; type: string; account_type?: 'CHECKING' | 'SAVINGS'; network_specific_data?: { mastercard: { ecommerce_security_level_indicator: string; on_behalf_service_result: { result_1: string; result_2: string; service: string; }[]; transaction_type_identifier: string; }; visa: { business_application_identifier: string; }; }; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst transaction = await client.transactions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(transaction);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst transaction = await client.transactions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(transaction.token);", + }, + python: { + method: 'transactions.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ntransaction = client.transactions.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(transaction.token)', + }, + java: { + method: 'transactions().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Transaction;\nimport com.lithic.api.models.TransactionRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Transaction transaction = client.transactions().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'transactions().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Transaction\nimport com.lithic.api.models.TransactionRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val transaction: Transaction = client.transactions().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Transactions.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttransaction, err := client.Transactions.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", transaction.Token)\n}\n', + }, + ruby: { + method: 'transactions.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntransaction = lithic.transactions.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transactions/$TRANSACTION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'simulate_authorization', + endpoint: '/v1/simulate/authorize', + httpMethod: 'post', + summary: 'Simulate authorization', + description: + 'Simulates an authorization request from the card network as if it came from a merchant acquirer.\nIf you are configured for ASA, simulating authorizations requires your ASA client to be set up properly, i.e. be able to respond to the ASA request with a valid JSON. For users that are not configured for ASA, a daily transaction limit of $5000 USD is applied by default. You can update this limit via the [update account](https://docs.lithic.com/reference/patchaccountbytoken) endpoint.\n', + stainlessPath: '(resource) transactions > (method) simulate_authorization', + qualified: 'client.transactions.simulateAuthorization', + params: [ + 'amount: number;', + 'descriptor: string;', + 'pan: string;', + 'mcc?: string;', + 'merchant_acceptor_city?: string;', + 'merchant_acceptor_country?: string;', + 'merchant_acceptor_id?: string;', + 'merchant_acceptor_state?: string;', + 'merchant_amount?: number;', + 'merchant_currency?: string;', + 'partial_approval_capable?: boolean;', + 'pin?: string;', + 'status?: string;', + ], + response: '{ token?: string; debugging_request_id?: string; }', + markdown: + "## simulate_authorization\n\n`client.transactions.simulateAuthorization(amount: number, descriptor: string, pan: string, mcc?: string, merchant_acceptor_city?: string, merchant_acceptor_country?: string, merchant_acceptor_id?: string, merchant_acceptor_state?: string, merchant_amount?: number, merchant_currency?: string, partial_approval_capable?: boolean, pin?: string, status?: string): { token?: string; debugging_request_id?: string; }`\n\n**post** `/v1/simulate/authorize`\n\nSimulates an authorization request from the card network as if it came from a merchant acquirer.\nIf you are configured for ASA, simulating authorizations requires your ASA client to be set up properly, i.e. be able to respond to the ASA request with a valid JSON. For users that are not configured for ASA, a daily transaction limit of $5000 USD is applied by default. You can update this limit via the [update account](https://docs.lithic.com/reference/patchaccountbytoken) endpoint.\n\n\n### Parameters\n\n- `amount: number`\n Amount (in cents) to authorize. For credit authorizations and financial credit authorizations, any value entered will be converted into a negative amount in the simulated transaction. For example, entering 100 in this field will result in a -100 amount in the transaction. For balance inquiries, this field must be set to 0.\n\n- `descriptor: string`\n Merchant descriptor.\n\n- `pan: string`\n Sixteen digit card number.\n\n- `mcc?: string`\n Merchant category code for the transaction to be simulated. A four-digit number listed in ISO 18245.\nSupported merchant category codes can be found [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).\n\n\n- `merchant_acceptor_city?: string`\n Merchant acceptor city\n\n- `merchant_acceptor_country?: string`\n Merchant acceptor country code (ISO 3166-1 alpha-3)\n\n- `merchant_acceptor_id?: string`\n Unique identifier to identify the payment card acceptor.\n\n- `merchant_acceptor_state?: string`\n Merchant acceptor state/province (ISO 3166-2 subdivision code)\n\n- `merchant_amount?: number`\n Amount of the transaction to be simulated in currency specified in merchant_currency, including any acquirer fees.\n\n- `merchant_currency?: string`\n 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, GBP, EUR and defaults to GBP if another ISO 4217 code is provided\n\n- `partial_approval_capable?: boolean`\n Set to true if the terminal is capable of partial approval otherwise false.\nPartial approval is when part of a transaction is approved and another\npayment must be used for the remainder.\n\n\n- `pin?: string`\n Simulate entering a PIN. If omitted, PIN check will not be performed.\n\n- `status?: string`\n Type of event to simulate.\n* `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent clearing step is required to settle the transaction.\n* `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the card, and is most often observed when a cardholder requests to view a card's balance at an ATM.\n* `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize a refund, meaning a subsequent clearing step is required to settle the transaction.\n* `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit funds immediately (such as an ATM withdrawal), and no subsequent clearing is required to settle the transaction.\n* `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant to credit funds immediately, and no subsequent clearing is required to settle the transaction.\n\n### Returns\n\n- `{ token?: string; debugging_request_id?: string; }`\n\n - `token?: string`\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateAuthorization({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n});\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateAuthorization', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateAuthorization({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n merchant_acceptor_city: 'LOS ANGELES',\n merchant_acceptor_country: 'USA',\n merchant_acceptor_state: 'CA',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_authorization', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_authorization(\n amount=3831,\n descriptor="COFFEE SHOP",\n pan="4111111289144142",\n merchant_acceptor_city="LOS ANGELES",\n merchant_acceptor_country="USA",\n merchant_acceptor_state="CA",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateAuthorization', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateAuthorizationParams;\nimport com.lithic.api.models.TransactionSimulateAuthorizationResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateAuthorizationParams params = TransactionSimulateAuthorizationParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build();\n TransactionSimulateAuthorizationResponse response = client.transactions().simulateAuthorization(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateAuthorization', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateAuthorizationParams\nimport com.lithic.api.models.TransactionSimulateAuthorizationResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateAuthorizationParams = TransactionSimulateAuthorizationParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build()\n val response: TransactionSimulateAuthorizationResponse = client.transactions().simulateAuthorization(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateAuthorization', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateAuthorization(context.TODO(), lithic.TransactionSimulateAuthorizationParams{\n\t\tAmount: lithic.F(int64(3831)),\n\t\tDescriptor: lithic.F("COFFEE SHOP"),\n\t\tPan: lithic.F("4111111289144142"),\n\t\tMerchantAcceptorCity: lithic.F("LOS ANGELES"),\n\t\tMerchantAcceptorCountry: lithic.F("USA"),\n\t\tMerchantAcceptorState: lithic.F("CA"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_authorization', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_authorization(\n amount: 3831,\n descriptor: "COFFEE SHOP",\n pan: "4111111289144142"\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/authorize \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 3831,\n "descriptor": "COFFEE SHOP",\n "pan": "4111111289144142",\n "mcc": "5812",\n "merchant_acceptor_city": "LOS ANGELES",\n "merchant_acceptor_country": "USA",\n "merchant_acceptor_id": "OODKZAPJVN4YS7O",\n "merchant_acceptor_state": "CA",\n "merchant_currency": "GBP",\n "pin": "1234",\n "status": "AUTHORIZATION"\n }\'', + }, + }, + }, + { + name: 'simulate_clearing', + endpoint: '/v1/simulate/clearing', + httpMethod: 'post', + summary: 'Simulate clearing', + description: + 'Clears an existing authorization, either debit or credit. After this event, the transaction transitions from `PENDING` to `SETTLED` status.\n\nIf `amount` is not set, the full amount of the transaction will be cleared. This endpoint may be called multiple times against the same authorization to simulate a multiple-completion scenario, with each call creating a separate clearing event.\n', + stainlessPath: '(resource) transactions > (method) simulate_clearing', + qualified: 'client.transactions.simulateClearing', + params: ['token: string;', 'amount?: number;'], + response: '{ debugging_request_id?: string; }', + markdown: + "## simulate_clearing\n\n`client.transactions.simulateClearing(token: string, amount?: number): { debugging_request_id?: string; }`\n\n**post** `/v1/simulate/clearing`\n\nClears an existing authorization, either debit or credit. After this event, the transaction transitions from `PENDING` to `SETTLED` status.\n\nIf `amount` is not set, the full amount of the transaction will be cleared. This endpoint may be called multiple times against the same authorization to simulate a multiple-completion scenario, with each call creating a separate clearing event.\n\n\n### Parameters\n\n- `token: string`\n The transaction token returned from the /v1/simulate/authorize response.\n\n- `amount?: number`\n Amount (in cents) to clear. Typically this will match the amount in the original authorization, but can be higher or lower. The sign of this amount will automatically match the sign of the original authorization's amount. For example, entering 100 in this field will result in a -100 amount in the transaction, if the original authorization is a credit authorization.\n\nIf `amount` is not set, the full amount of the transaction will be cleared. This endpoint may be called multiple times against the same authorization to simulate a multiple-completion scenario, with each call creating a separate clearing event.\n\n\n### Returns\n\n- `{ debugging_request_id?: string; }`\n\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateClearing({ token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateClearing', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateClearing({\n token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_clearing', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_clearing(\n token="fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n amount=0,\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateClearing', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateClearingParams;\nimport com.lithic.api.models.TransactionSimulateClearingResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateClearingParams params = TransactionSimulateClearingParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .build();\n TransactionSimulateClearingResponse response = client.transactions().simulateClearing(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateClearing', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateClearingParams\nimport com.lithic.api.models.TransactionSimulateClearingResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateClearingParams = TransactionSimulateClearingParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .build()\n val response: TransactionSimulateClearingResponse = client.transactions().simulateClearing(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateClearing', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateClearing(context.TODO(), lithic.TransactionSimulateClearingParams{\n\t\tToken: lithic.F("fabd829d-7f7b-4432-a8f2-07ea4889aaac"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_clearing', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_clearing(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/clearing \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n "amount": 0\n }\'', + }, + }, + }, + { + name: 'simulate_return', + endpoint: '/v1/simulate/return', + httpMethod: 'post', + summary: 'Simulate return', + description: + 'Returns, or refunds, an amount back to a card. Returns simulated via this endpoint clear immediately, without prior authorization, and result in a `SETTLED` transaction status.\n', + stainlessPath: '(resource) transactions > (method) simulate_return', + qualified: 'client.transactions.simulateReturn', + params: ['amount: number;', 'descriptor: string;', 'pan: string;'], + response: '{ token?: string; debugging_request_id?: string; }', + markdown: + "## simulate_return\n\n`client.transactions.simulateReturn(amount: number, descriptor: string, pan: string): { token?: string; debugging_request_id?: string; }`\n\n**post** `/v1/simulate/return`\n\nReturns, or refunds, an amount back to a card. Returns simulated via this endpoint clear immediately, without prior authorization, and result in a `SETTLED` transaction status.\n\n\n### Parameters\n\n- `amount: number`\n Amount (in cents) to authorize.\n\n- `descriptor: string`\n Merchant descriptor.\n\n- `pan: string`\n Sixteen digit card number.\n\n### Returns\n\n- `{ token?: string; debugging_request_id?: string; }`\n\n - `token?: string`\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateReturn({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n});\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateReturn', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateReturn({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_return', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_return(\n amount=3831,\n descriptor="COFFEE SHOP",\n pan="4111111289144142",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateReturn', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateReturnParams;\nimport com.lithic.api.models.TransactionSimulateReturnResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateReturnParams params = TransactionSimulateReturnParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build();\n TransactionSimulateReturnResponse response = client.transactions().simulateReturn(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateReturn', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateReturnParams\nimport com.lithic.api.models.TransactionSimulateReturnResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateReturnParams = TransactionSimulateReturnParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build()\n val response: TransactionSimulateReturnResponse = client.transactions().simulateReturn(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateReturn', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateReturn(context.TODO(), lithic.TransactionSimulateReturnParams{\n\t\tAmount: lithic.F(int64(3831)),\n\t\tDescriptor: lithic.F("COFFEE SHOP"),\n\t\tPan: lithic.F("4111111289144142"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_return', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_return(amount: 3831, descriptor: "COFFEE SHOP", pan: "4111111289144142")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/return \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 3831,\n "descriptor": "COFFEE SHOP",\n "pan": "4111111289144142"\n }\'', + }, + }, + }, + { + name: 'simulate_return_reversal', + endpoint: '/v1/simulate/return_reversal', + httpMethod: 'post', + summary: 'Simulate return reversal', + description: + 'Reverses a return, i.e. a credit transaction with a `SETTLED` status. Returns can be financial credit authorizations, or credit authorizations that have cleared.\n', + stainlessPath: '(resource) transactions > (method) simulate_return_reversal', + qualified: 'client.transactions.simulateReturnReversal', + params: ['token: string;'], + response: '{ debugging_request_id?: string; }', + markdown: + "## simulate_return_reversal\n\n`client.transactions.simulateReturnReversal(token: string): { debugging_request_id?: string; }`\n\n**post** `/v1/simulate/return_reversal`\n\nReverses a return, i.e. a credit transaction with a `SETTLED` status. Returns can be financial credit authorizations, or credit authorizations that have cleared.\n\n\n### Parameters\n\n- `token: string`\n The transaction token returned from the /v1/simulate/authorize response.\n\n### Returns\n\n- `{ debugging_request_id?: string; }`\n\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateReturnReversal({ token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateReturnReversal', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateReturnReversal({\n token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_return_reversal', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_return_reversal(\n token="fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateReturnReversal', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateReturnReversalParams;\nimport com.lithic.api.models.TransactionSimulateReturnReversalResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateReturnReversalParams params = TransactionSimulateReturnReversalParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .build();\n TransactionSimulateReturnReversalResponse response = client.transactions().simulateReturnReversal(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateReturnReversal', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateReturnReversalParams\nimport com.lithic.api.models.TransactionSimulateReturnReversalResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateReturnReversalParams = TransactionSimulateReturnReversalParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .build()\n val response: TransactionSimulateReturnReversalResponse = client.transactions().simulateReturnReversal(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateReturnReversal', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateReturnReversal(context.TODO(), lithic.TransactionSimulateReturnReversalParams{\n\t\tToken: lithic.F("fabd829d-7f7b-4432-a8f2-07ea4889aaac"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_return_reversal', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_return_reversal(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/return_reversal \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "fabd829d-7f7b-4432-a8f2-07ea4889aaac"\n }\'', + }, + }, + }, + { + name: 'simulate_void', + endpoint: '/v1/simulate/void', + httpMethod: 'post', + summary: 'Simulate void', + description: + 'Voids a pending authorization. If `amount` is not set, the full amount will be voided. Can be used on partially voided transactions but not partially cleared transactions. _Simulating an authorization expiry on credit authorizations or credit authorization advice is not currently supported but will be added soon._\n', + stainlessPath: '(resource) transactions > (method) simulate_void', + qualified: 'client.transactions.simulateVoid', + params: [ + 'token: string;', + 'amount?: number;', + "type?: 'AUTHORIZATION_EXPIRY' | 'AUTHORIZATION_REVERSAL';", + ], + response: '{ debugging_request_id?: string; }', + markdown: + "## simulate_void\n\n`client.transactions.simulateVoid(token: string, amount?: number, type?: 'AUTHORIZATION_EXPIRY' | 'AUTHORIZATION_REVERSAL'): { debugging_request_id?: string; }`\n\n**post** `/v1/simulate/void`\n\nVoids a pending authorization. If `amount` is not set, the full amount will be voided. Can be used on partially voided transactions but not partially cleared transactions. _Simulating an authorization expiry on credit authorizations or credit authorization advice is not currently supported but will be added soon._\n\n\n### Parameters\n\n- `token: string`\n The transaction token returned from the /v1/simulate/authorize response.\n\n- `amount?: number`\n Amount (in cents) to void. Typically this will match the amount in the original authorization, but can be less. Applies to authorization reversals only. An authorization expiry will always apply to the full pending amount.\n\n- `type?: 'AUTHORIZATION_EXPIRY' | 'AUTHORIZATION_REVERSAL'`\n Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`.\n\n* `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed by Lithic.\n* `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant.\n\n### Returns\n\n- `{ debugging_request_id?: string; }`\n\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateVoid({ token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateVoid', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateVoid({\n token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac',\n amount: 100,\n type: 'AUTHORIZATION_EXPIRY',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_void', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_void(\n token="fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n amount=100,\n type="AUTHORIZATION_EXPIRY",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateVoid', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateVoidParams;\nimport com.lithic.api.models.TransactionSimulateVoidResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateVoidParams params = TransactionSimulateVoidParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .build();\n TransactionSimulateVoidResponse response = client.transactions().simulateVoid(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateVoid', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateVoidParams\nimport com.lithic.api.models.TransactionSimulateVoidResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateVoidParams = TransactionSimulateVoidParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .build()\n val response: TransactionSimulateVoidResponse = client.transactions().simulateVoid(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateVoid', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateVoid(context.TODO(), lithic.TransactionSimulateVoidParams{\n\t\tToken: lithic.F("fabd829d-7f7b-4432-a8f2-07ea4889aaac"),\n\t\tAmount: lithic.F(int64(100)),\n\t\tType: lithic.F(lithic.TransactionSimulateVoidParamsTypeAuthorizationExpiry),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_void', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_void(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/void \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n "amount": 100,\n "type": "AUTHORIZATION_EXPIRY"\n }\'', + }, + }, + }, + { + name: 'simulate_credit_authorization', + endpoint: '/v1/simulate/credit_authorization_advice', + httpMethod: 'post', + summary: 'Simulate credit authorization advice', + description: + 'Simulates a credit authorization advice from the card network.\nThis message indicates that the network approved a credit authorization on your behalf.\n', + stainlessPath: '(resource) transactions > (method) simulate_credit_authorization', + qualified: 'client.transactions.simulateCreditAuthorization', + params: [ + 'amount: number;', + 'descriptor: string;', + 'pan: string;', + 'mcc?: string;', + 'merchant_acceptor_city?: string;', + 'merchant_acceptor_country?: string;', + 'merchant_acceptor_id?: string;', + 'merchant_acceptor_state?: string;', + ], + response: '{ token?: string; debugging_request_id?: string; }', + markdown: + "## simulate_credit_authorization\n\n`client.transactions.simulateCreditAuthorization(amount: number, descriptor: string, pan: string, mcc?: string, merchant_acceptor_city?: string, merchant_acceptor_country?: string, merchant_acceptor_id?: string, merchant_acceptor_state?: string): { token?: string; debugging_request_id?: string; }`\n\n**post** `/v1/simulate/credit_authorization_advice`\n\nSimulates a credit authorization advice from the card network.\nThis message indicates that the network approved a credit authorization on your behalf.\n\n\n### Parameters\n\n- `amount: number`\n Amount (in cents). Any value entered will be converted into a negative amount in the simulated transaction. For example, entering 100 in this field will appear as a -100 amount in the transaction.\n\n- `descriptor: string`\n Merchant descriptor.\n\n- `pan: string`\n Sixteen digit card number.\n\n- `mcc?: string`\n Merchant category code for the transaction to be simulated. A four-digit number listed in ISO 18245.\nSupported merchant category codes can be found [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).\n\n\n- `merchant_acceptor_city?: string`\n Merchant acceptor city\n\n- `merchant_acceptor_country?: string`\n Merchant acceptor country code (ISO 3166-1 alpha-3)\n\n- `merchant_acceptor_id?: string`\n Unique identifier to identify the payment card acceptor.\n\n- `merchant_acceptor_state?: string`\n Merchant acceptor state/province (ISO 3166-2 subdivision code)\n\n### Returns\n\n- `{ token?: string; debugging_request_id?: string; }`\n\n - `token?: string`\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateCreditAuthorization({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n});\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateCreditAuthorization', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateCreditAuthorization({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n merchant_acceptor_city: 'SEATTLE',\n merchant_acceptor_country: 'USA',\n merchant_acceptor_id: 'XRKGDPOWEWQRRWU',\n merchant_acceptor_state: 'WA',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_credit_authorization', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_credit_authorization(\n amount=3831,\n descriptor="COFFEE SHOP",\n pan="4111111289144142",\n merchant_acceptor_city="SEATTLE",\n merchant_acceptor_country="USA",\n merchant_acceptor_id="XRKGDPOWEWQRRWU",\n merchant_acceptor_state="WA",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateCreditAuthorization', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationParams;\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateCreditAuthorizationParams params = TransactionSimulateCreditAuthorizationParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build();\n TransactionSimulateCreditAuthorizationResponse response = client.transactions().simulateCreditAuthorization(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateCreditAuthorization', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationParams\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateCreditAuthorizationParams = TransactionSimulateCreditAuthorizationParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build()\n val response: TransactionSimulateCreditAuthorizationResponse = client.transactions().simulateCreditAuthorization(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateCreditAuthorization', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateCreditAuthorization(context.TODO(), lithic.TransactionSimulateCreditAuthorizationParams{\n\t\tAmount: lithic.F(int64(3831)),\n\t\tDescriptor: lithic.F("COFFEE SHOP"),\n\t\tPan: lithic.F("4111111289144142"),\n\t\tMerchantAcceptorCity: lithic.F("SEATTLE"),\n\t\tMerchantAcceptorCountry: lithic.F("USA"),\n\t\tMerchantAcceptorID: lithic.F("XRKGDPOWEWQRRWU"),\n\t\tMerchantAcceptorState: lithic.F("WA"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + }, + }, + { + name: 'simulate_credit_authorization_advice', + endpoint: '/v1/simulate/credit_authorization_advice', + httpMethod: 'post', + summary: 'Simulate credit authorization advice', + description: + 'Simulates a credit authorization advice from the card network.\nThis message indicates that the network approved a credit authorization on your behalf.\n', + stainlessPath: '(resource) transactions > (method) simulate_credit_authorization_advice', + qualified: 'client.transactions.simulateCreditAuthorizationAdvice', + params: [ + 'amount: number;', + 'descriptor: string;', + 'pan: string;', + 'mcc?: string;', + 'merchant_acceptor_city?: string;', + 'merchant_acceptor_country?: string;', + 'merchant_acceptor_id?: string;', + 'merchant_acceptor_state?: string;', + ], + response: '{ token?: string; debugging_request_id?: string; }', + markdown: + "## simulate_credit_authorization_advice\n\n`client.transactions.simulateCreditAuthorizationAdvice(amount: number, descriptor: string, pan: string, mcc?: string, merchant_acceptor_city?: string, merchant_acceptor_country?: string, merchant_acceptor_id?: string, merchant_acceptor_state?: string): { token?: string; debugging_request_id?: string; }`\n\n**post** `/v1/simulate/credit_authorization_advice`\n\nSimulates a credit authorization advice from the card network.\nThis message indicates that the network approved a credit authorization on your behalf.\n\n\n### Parameters\n\n- `amount: number`\n Amount (in cents). Any value entered will be converted into a negative amount in the simulated transaction. For example, entering 100 in this field will appear as a -100 amount in the transaction.\n\n- `descriptor: string`\n Merchant descriptor.\n\n- `pan: string`\n Sixteen digit card number.\n\n- `mcc?: string`\n Merchant category code for the transaction to be simulated. A four-digit number listed in ISO 18245.\nSupported merchant category codes can be found [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).\n\n\n- `merchant_acceptor_city?: string`\n Merchant acceptor city\n\n- `merchant_acceptor_country?: string`\n Merchant acceptor country code (ISO 3166-1 alpha-3)\n\n- `merchant_acceptor_id?: string`\n Unique identifier to identify the payment card acceptor.\n\n- `merchant_acceptor_state?: string`\n Merchant acceptor state/province (ISO 3166-2 subdivision code)\n\n### Returns\n\n- `{ token?: string; debugging_request_id?: string; }`\n\n - `token?: string`\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateCreditAuthorizationAdvice({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n});\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateCreditAuthorizationAdvice', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateCreditAuthorizationAdvice({\n amount: 3831,\n descriptor: 'COFFEE SHOP',\n pan: '4111111289144142',\n merchant_acceptor_city: 'SEATTLE',\n merchant_acceptor_country: 'USA',\n merchant_acceptor_id: 'XRKGDPOWEWQRRWU',\n merchant_acceptor_state: 'WA',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_credit_authorization_advice', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_credit_authorization_advice(\n amount=3831,\n descriptor="COFFEE SHOP",\n pan="4111111289144142",\n merchant_acceptor_city="SEATTLE",\n merchant_acceptor_country="USA",\n merchant_acceptor_id="XRKGDPOWEWQRRWU",\n merchant_acceptor_state="WA",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateCreditAuthorizationAdvice', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationAdviceParams;\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationAdviceResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateCreditAuthorizationAdviceParams params = TransactionSimulateCreditAuthorizationAdviceParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build();\n TransactionSimulateCreditAuthorizationAdviceResponse response = client.transactions().simulateCreditAuthorizationAdvice(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateCreditAuthorizationAdvice', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationAdviceParams\nimport com.lithic.api.models.TransactionSimulateCreditAuthorizationAdviceResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateCreditAuthorizationAdviceParams = TransactionSimulateCreditAuthorizationAdviceParams.builder()\n .amount(3831L)\n .descriptor("COFFEE SHOP")\n .pan("4111111289144142")\n .build()\n val response: TransactionSimulateCreditAuthorizationAdviceResponse = client.transactions().simulateCreditAuthorizationAdvice(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateCreditAuthorizationAdvice', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateCreditAuthorizationAdvice(context.TODO(), lithic.TransactionSimulateCreditAuthorizationAdviceParams{\n\t\tAmount: lithic.F(int64(3831)),\n\t\tDescriptor: lithic.F("COFFEE SHOP"),\n\t\tPan: lithic.F("4111111289144142"),\n\t\tMerchantAcceptorCity: lithic.F("SEATTLE"),\n\t\tMerchantAcceptorCountry: lithic.F("USA"),\n\t\tMerchantAcceptorID: lithic.F("XRKGDPOWEWQRRWU"),\n\t\tMerchantAcceptorState: lithic.F("WA"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_credit_authorization_advice', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_credit_authorization_advice(\n amount: 3831,\n descriptor: "COFFEE SHOP",\n pan: "4111111289144142"\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/credit_authorization_advice \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 3831,\n "descriptor": "COFFEE SHOP",\n "pan": "4111111289144142",\n "mcc": "5812",\n "merchant_acceptor_city": "SEATTLE",\n "merchant_acceptor_country": "USA",\n "merchant_acceptor_id": "XRKGDPOWEWQRRWU",\n "merchant_acceptor_state": "WA"\n }\'', + }, + }, + }, + { + name: 'simulate_authorization_advice', + endpoint: '/v1/simulate/authorization_advice', + httpMethod: 'post', + summary: 'Simulate authorization advice', + description: + 'Simulates an authorization advice from the card network as if it came from a merchant acquirer. An authorization advice changes the pending amount of the transaction.\n', + stainlessPath: '(resource) transactions > (method) simulate_authorization_advice', + qualified: 'client.transactions.simulateAuthorizationAdvice', + params: ['token: string;', 'amount: number;'], + response: '{ token?: string; debugging_request_id?: string; }', + markdown: + "## simulate_authorization_advice\n\n`client.transactions.simulateAuthorizationAdvice(token: string, amount: number): { token?: string; debugging_request_id?: string; }`\n\n**post** `/v1/simulate/authorization_advice`\n\nSimulates an authorization advice from the card network as if it came from a merchant acquirer. An authorization advice changes the pending amount of the transaction.\n\n\n### Parameters\n\n- `token: string`\n The transaction token returned from the /v1/simulate/authorize. response.\n\n- `amount: number`\n Amount (in cents) to authorize. This amount will override the transaction's amount that was originally set by /v1/simulate/authorize.\n\n### Returns\n\n- `{ token?: string; debugging_request_id?: string; }`\n\n - `token?: string`\n - `debugging_request_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.transactions.simulateAuthorizationAdvice({ token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac', amount: 3831 });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.simulateAuthorizationAdvice', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.transactions.simulateAuthorizationAdvice({\n token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac',\n amount: 3831,\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'transactions.simulate_authorization_advice', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.transactions.simulate_authorization_advice(\n token="fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n amount=3831,\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'transactions().simulateAuthorizationAdvice', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionSimulateAuthorizationAdviceParams;\nimport com.lithic.api.models.TransactionSimulateAuthorizationAdviceResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionSimulateAuthorizationAdviceParams params = TransactionSimulateAuthorizationAdviceParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .amount(3831L)\n .build();\n TransactionSimulateAuthorizationAdviceResponse response = client.transactions().simulateAuthorizationAdvice(params);\n }\n}', + }, + kotlin: { + method: 'transactions().simulateAuthorizationAdvice', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionSimulateAuthorizationAdviceParams\nimport com.lithic.api.models.TransactionSimulateAuthorizationAdviceResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionSimulateAuthorizationAdviceParams = TransactionSimulateAuthorizationAdviceParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .amount(3831L)\n .build()\n val response: TransactionSimulateAuthorizationAdviceResponse = client.transactions().simulateAuthorizationAdvice(params)\n}', + }, + go: { + method: 'client.Transactions.SimulateAuthorizationAdvice', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Transactions.SimulateAuthorizationAdvice(context.TODO(), lithic.TransactionSimulateAuthorizationAdviceParams{\n\t\tToken: lithic.F("fabd829d-7f7b-4432-a8f2-07ea4889aaac"),\n\t\tAmount: lithic.F(int64(3831)),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'transactions.simulate_authorization_advice', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.transactions.simulate_authorization_advice(\n token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n amount: 3831\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/authorization_advice \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n "amount": 3831\n }\'', + }, + }, + }, + { + name: 'expire_authorization', + endpoint: '/v1/transactions/{transaction_token}/expire_authorization', + httpMethod: 'post', + summary: 'Expire an authorization', + description: 'Expire authorization', + stainlessPath: '(resource) transactions > (method) expire_authorization', + qualified: 'client.transactions.expireAuthorization', + params: ['transaction_token: string;'], + markdown: + "## expire_authorization\n\n`client.transactions.expireAuthorization(transaction_token: string): void`\n\n**post** `/v1/transactions/{transaction_token}/expire_authorization`\n\nExpire authorization\n\n### Parameters\n\n- `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.transactions.expireAuthorization('00000000-0000-0000-0000-000000000000')\n```", + perLanguage: { + typescript: { + method: 'client.transactions.expireAuthorization', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.transactions.expireAuthorization('00000000-0000-0000-0000-000000000000');", + }, + python: { + method: 'transactions.expire_authorization', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.transactions.expire_authorization(\n "00000000-0000-0000-0000-000000000000",\n)', + }, + java: { + method: 'transactions().expireAuthorization', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionExpireAuthorizationParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.transactions().expireAuthorization("00000000-0000-0000-0000-000000000000");\n }\n}', + }, + kotlin: { + method: 'transactions().expireAuthorization', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionExpireAuthorizationParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.transactions().expireAuthorization("00000000-0000-0000-0000-000000000000")\n}', + }, + go: { + method: 'client.Transactions.ExpireAuthorization', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Transactions.ExpireAuthorization(context.TODO(), "00000000-0000-0000-0000-000000000000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'transactions.expire_authorization', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.transactions.expire_authorization("00000000-0000-0000-0000-000000000000")\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transactions/$TRANSACTION_TOKEN/expire_authorization \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'route', + endpoint: '/v1/transactions/{transaction_token}/route', + httpMethod: 'post', + summary: 'Route a transaction', + description: + 'Route a card transaction to a financial account. Only available for select use cases and programs.', + stainlessPath: '(resource) transactions > (method) route', + qualified: 'client.transactions.route', + params: ['transaction_token: string;', 'financial_account_token: string;'], + markdown: + "## route\n\n`client.transactions.route(transaction_token: string, financial_account_token: string): void`\n\n**post** `/v1/transactions/{transaction_token}/route`\n\nRoute a card transaction to a financial account. Only available for select use cases and programs.\n\n### Parameters\n\n- `transaction_token: string`\n\n- `financial_account_token: string`\n The token of the financial account to route the transaction to.\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.transactions.route('00000000-0000-0000-0000-000000000000', { financial_account_token: '00000000-0000-0000-0000-000000000000' })\n```", + perLanguage: { + typescript: { + method: 'client.transactions.route', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.transactions.route('00000000-0000-0000-0000-000000000000', {\n financial_account_token: '00000000-0000-0000-0000-000000000000',\n});", + }, + python: { + method: 'transactions.route', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.transactions.route(\n transaction_token="00000000-0000-0000-0000-000000000000",\n financial_account_token="00000000-0000-0000-0000-000000000000",\n)', + }, + java: { + method: 'transactions().route', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransactionRouteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionRouteParams params = TransactionRouteParams.builder()\n .transactionToken("00000000-0000-0000-0000-000000000000")\n .financialAccountToken("00000000-0000-0000-0000-000000000000")\n .build();\n client.transactions().route(params);\n }\n}', + }, + kotlin: { + method: 'transactions().route', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransactionRouteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: TransactionRouteParams = TransactionRouteParams.builder()\n .transactionToken("00000000-0000-0000-0000-000000000000")\n .financialAccountToken("00000000-0000-0000-0000-000000000000")\n .build()\n client.transactions().route(params)\n}', + }, + go: { + method: 'client.Transactions.Route', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Transactions.Route(\n\t\tcontext.TODO(),\n\t\t"00000000-0000-0000-0000-000000000000",\n\t\tlithic.TransactionRouteParams{\n\t\t\tFinancialAccountToken: lithic.F("00000000-0000-0000-0000-000000000000"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'transactions.route', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.transactions.route(\n "00000000-0000-0000-0000-000000000000",\n financial_account_token: "00000000-0000-0000-0000-000000000000"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transactions/$TRANSACTION_TOKEN/route \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "financial_account_token": "00000000-0000-0000-0000-000000000000"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/transactions/{transaction_token}/enhanced_commercial_data', + httpMethod: 'get', + summary: 'List enhanced commercial data', + description: + 'Get all L2/L3 enhanced commercial data associated with a transaction. Not available in sandbox.', + stainlessPath: '(resource) transactions.enhanced_commercial_data > (method) retrieve', + qualified: 'client.transactions.enhancedCommercialData.retrieve', + params: ['transaction_token: string;'], + response: + '{ data: { token: string; common: object; event_token: string; fleet: object[]; transaction_token: string; }[]; }', + markdown: + "## retrieve\n\n`client.transactions.enhancedCommercialData.retrieve(transaction_token: string): { data: enhanced_data[]; }`\n\n**get** `/v1/transactions/{transaction_token}/enhanced_commercial_data`\n\nGet all L2/L3 enhanced commercial data associated with a transaction. Not available in sandbox.\n\n### Parameters\n\n- `transaction_token: string`\n\n### Returns\n\n- `{ data: { token: string; common: object; event_token: string; fleet: object[]; transaction_token: string; }[]; }`\n\n - `data: { token: string; common: { line_items: { amount?: string; description?: string; product_code?: string; quantity?: string; }[]; tax: { amount?: number; exempt?: 'TAX_INCLUDED' | 'TAX_NOT_INCLUDED' | 'NOT_SUPPORTED'; merchant_tax_id?: string; }; customer_reference_number?: string; merchant_reference_number?: string; order_date?: string; }; event_token: string; fleet: { amount_totals: { discount?: number; gross_sale?: number; net_sale?: number; }; fuel: { quantity?: string; type?: string; unit_of_measure?: 'GALLONS' | 'LITERS' | 'POUNDS' | 'KILOGRAMS' | 'IMPERIAL_GALLONS' | 'NOT_APPLICABLE' | 'UNKNOWN'; unit_price?: number; }; driver_number?: string; odometer?: number; service_type?: 'UNKNOWN' | 'UNDEFINED' | 'SELF_SERVICE' | 'FULL_SERVICE' | 'NON_FUEL_ONLY'; vehicle_number?: string; }[]; transaction_token: string; }[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst enhancedCommercialData = await client.transactions.enhancedCommercialData.retrieve('00000000-0000-0000-0000-000000000000');\n\nconsole.log(enhancedCommercialData);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.enhancedCommercialData.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst enhancedCommercialData = await client.transactions.enhancedCommercialData.retrieve(\n '00000000-0000-0000-0000-000000000000',\n);\n\nconsole.log(enhancedCommercialData.data);", + }, + python: { + method: 'transactions.enhanced_commercial_data.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nenhanced_commercial_data = client.transactions.enhanced_commercial_data.retrieve(\n "00000000-0000-0000-0000-000000000000",\n)\nprint(enhanced_commercial_data.data)', + }, + java: { + method: 'transactions().enhancedCommercialData().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EnhancedCommercialDataRetrieveResponse;\nimport com.lithic.api.models.TransactionEnhancedCommercialDataRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EnhancedCommercialDataRetrieveResponse enhancedCommercialData = client.transactions().enhancedCommercialData().retrieve("00000000-0000-0000-0000-000000000000");\n }\n}', + }, + kotlin: { + method: 'transactions().enhancedCommercialData().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EnhancedCommercialDataRetrieveResponse\nimport com.lithic.api.models.TransactionEnhancedCommercialDataRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val enhancedCommercialData: EnhancedCommercialDataRetrieveResponse = client.transactions().enhancedCommercialData().retrieve("00000000-0000-0000-0000-000000000000")\n}', + }, + go: { + method: 'client.Transactions.EnhancedCommercialData.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tenhancedCommercialData, err := client.Transactions.EnhancedCommercialData.Get(context.TODO(), "00000000-0000-0000-0000-000000000000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", enhancedCommercialData.Data)\n}\n', + }, + ruby: { + method: 'transactions.enhanced_commercial_data.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nenhanced_commercial_data = lithic.transactions.enhanced_commercial_data.retrieve("00000000-0000-0000-0000-000000000000")\n\nputs(enhanced_commercial_data)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transactions/$TRANSACTION_TOKEN/enhanced_commercial_data \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/transactions/events/{event_token}/enhanced_commercial_data', + httpMethod: 'get', + summary: 'Get enhanced commercial data', + description: + 'Get L2/L3 enhanced commercial data associated with a transaction event. Not available in sandbox.', + stainlessPath: '(resource) transactions.events.enhanced_commercial_data > (method) retrieve', + qualified: 'client.transactions.events.enhancedCommercialData.retrieve', + params: ['event_token: string;'], + response: + "{ token: string; common: { line_items: { amount?: string; description?: string; product_code?: string; quantity?: string; }[]; tax: { amount?: number; exempt?: 'TAX_INCLUDED' | 'TAX_NOT_INCLUDED' | 'NOT_SUPPORTED'; merchant_tax_id?: string; }; customer_reference_number?: string; merchant_reference_number?: string; order_date?: string; }; event_token: string; fleet: { amount_totals: { discount?: number; gross_sale?: number; net_sale?: number; }; fuel: { quantity?: string; type?: string; unit_of_measure?: 'GALLONS' | 'LITERS' | 'POUNDS' | 'KILOGRAMS' | 'IMPERIAL_GALLONS' | 'NOT_APPLICABLE' | 'UNKNOWN'; unit_price?: number; }; driver_number?: string; odometer?: number; service_type?: 'UNKNOWN' | 'UNDEFINED' | 'SELF_SERVICE' | 'FULL_SERVICE' | 'NON_FUEL_ONLY'; vehicle_number?: string; }[]; transaction_token: string; }", + markdown: + "## retrieve\n\n`client.transactions.events.enhancedCommercialData.retrieve(event_token: string): { token: string; common: object; event_token: string; fleet: object[]; transaction_token: string; }`\n\n**get** `/v1/transactions/events/{event_token}/enhanced_commercial_data`\n\nGet L2/L3 enhanced commercial data associated with a transaction event. Not available in sandbox.\n\n### Parameters\n\n- `event_token: string`\n\n### Returns\n\n- `{ token: string; common: { line_items: { amount?: string; description?: string; product_code?: string; quantity?: string; }[]; tax: { amount?: number; exempt?: 'TAX_INCLUDED' | 'TAX_NOT_INCLUDED' | 'NOT_SUPPORTED'; merchant_tax_id?: string; }; customer_reference_number?: string; merchant_reference_number?: string; order_date?: string; }; event_token: string; fleet: { amount_totals: { discount?: number; gross_sale?: number; net_sale?: number; }; fuel: { quantity?: string; type?: string; unit_of_measure?: 'GALLONS' | 'LITERS' | 'POUNDS' | 'KILOGRAMS' | 'IMPERIAL_GALLONS' | 'NOT_APPLICABLE' | 'UNKNOWN'; unit_price?: number; }; driver_number?: string; odometer?: number; service_type?: 'UNKNOWN' | 'UNDEFINED' | 'SELF_SERVICE' | 'FULL_SERVICE' | 'NON_FUEL_ONLY'; vehicle_number?: string; }[]; transaction_token: string; }`\n\n - `token: string`\n - `common: { line_items: { amount?: string; description?: string; product_code?: string; quantity?: string; }[]; tax: { amount?: number; exempt?: 'TAX_INCLUDED' | 'TAX_NOT_INCLUDED' | 'NOT_SUPPORTED'; merchant_tax_id?: string; }; customer_reference_number?: string; merchant_reference_number?: string; order_date?: string; }`\n - `event_token: string`\n - `fleet: { amount_totals: { discount?: number; gross_sale?: number; net_sale?: number; }; fuel: { quantity?: string; type?: string; unit_of_measure?: 'GALLONS' | 'LITERS' | 'POUNDS' | 'KILOGRAMS' | 'IMPERIAL_GALLONS' | 'NOT_APPLICABLE' | 'UNKNOWN'; unit_price?: number; }; driver_number?: string; odometer?: number; service_type?: 'UNKNOWN' | 'UNDEFINED' | 'SELF_SERVICE' | 'FULL_SERVICE' | 'NON_FUEL_ONLY'; vehicle_number?: string; }[]`\n - `transaction_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst enhancedData = await client.transactions.events.enhancedCommercialData.retrieve('00000000-0000-0000-0000-000000000000');\n\nconsole.log(enhancedData);\n```", + perLanguage: { + typescript: { + method: 'client.transactions.events.enhancedCommercialData.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst enhancedData = await client.transactions.events.enhancedCommercialData.retrieve(\n '00000000-0000-0000-0000-000000000000',\n);\n\nconsole.log(enhancedData.token);", + }, + python: { + method: 'transactions.events.enhanced_commercial_data.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nenhanced_data = client.transactions.events.enhanced_commercial_data.retrieve(\n "00000000-0000-0000-0000-000000000000",\n)\nprint(enhanced_data.token)', + }, + java: { + method: 'transactions().events().enhancedCommercialData().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.EnhancedData;\nimport com.lithic.api.models.TransactionEventEnhancedCommercialDataRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n EnhancedData enhancedData = client.transactions().events().enhancedCommercialData().retrieve("00000000-0000-0000-0000-000000000000");\n }\n}', + }, + kotlin: { + method: 'transactions().events().enhancedCommercialData().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.EnhancedData\nimport com.lithic.api.models.TransactionEventEnhancedCommercialDataRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val enhancedData: EnhancedData = client.transactions().events().enhancedCommercialData().retrieve("00000000-0000-0000-0000-000000000000")\n}', + }, + go: { + method: 'client.Transactions.Events.EnhancedCommercialData.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tenhancedData, err := client.Transactions.Events.EnhancedCommercialData.Get(context.TODO(), "00000000-0000-0000-0000-000000000000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", enhancedData.Token)\n}\n', + }, + ruby: { + method: 'transactions.events.enhanced_commercial_data.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nenhanced_data = lithic.transactions.events.enhanced_commercial_data.retrieve("00000000-0000-0000-0000-000000000000")\n\nputs(enhanced_data)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/transactions/events/$EVENT_TOKEN/enhanced_commercial_data \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/responder_endpoints', + httpMethod: 'post', + summary: 'Enroll a responder endpoint', + description: 'Enroll a responder endpoint', + stainlessPath: '(resource) responder_endpoints > (method) create', + qualified: 'client.responderEndpoints.create', + params: [ + "type?: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING';", + 'url?: string;', + ], + response: '{ enrolled?: boolean; }', + markdown: + "## create\n\n`client.responderEndpoints.create(type?: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING', url?: string): { enrolled?: boolean; }`\n\n**post** `/v1/responder_endpoints`\n\nEnroll a responder endpoint\n\n### Parameters\n\n- `type?: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING'`\n The type of the endpoint.\n\n- `url?: string`\n The URL for the responder endpoint (must be http(s)).\n\n### Returns\n\n- `{ enrolled?: boolean; }`\n\n - `enrolled?: boolean`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst responderEndpoint = await client.responderEndpoints.create();\n\nconsole.log(responderEndpoint);\n```", + perLanguage: { + typescript: { + method: 'client.responderEndpoints.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst responderEndpoint = await client.responderEndpoints.create();\n\nconsole.log(responderEndpoint.enrolled);", + }, + python: { + method: 'responder_endpoints.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponder_endpoint = client.responder_endpoints.create()\nprint(responder_endpoint.enrolled)', + }, + java: { + method: 'responderEndpoints().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ResponderEndpointCreateParams;\nimport com.lithic.api.models.ResponderEndpointCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ResponderEndpointCreateResponse responderEndpoint = client.responderEndpoints().create();\n }\n}', + }, + kotlin: { + method: 'responderEndpoints().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ResponderEndpointCreateParams\nimport com.lithic.api.models.ResponderEndpointCreateResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val responderEndpoint: ResponderEndpointCreateResponse = client.responderEndpoints().create()\n}', + }, + go: { + method: 'client.ResponderEndpoints.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponderEndpoint, err := client.ResponderEndpoints.New(context.TODO(), lithic.ResponderEndpointNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", responderEndpoint.Enrolled)\n}\n', + }, + ruby: { + method: 'responder_endpoints.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponder_endpoint = lithic.responder_endpoints.create\n\nputs(responder_endpoint)', + }, + http: { + example: + "curl https://api.lithic.com/v1/responder_endpoints \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'delete', + endpoint: '/v1/responder_endpoints', + httpMethod: 'delete', + summary: 'Disenroll a responder endpoint', + description: 'Disenroll a responder endpoint', + stainlessPath: '(resource) responder_endpoints > (method) delete', + qualified: 'client.responderEndpoints.delete', + params: ["type: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING';"], + markdown: + "## delete\n\n`client.responderEndpoints.delete(type: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING'): void`\n\n**delete** `/v1/responder_endpoints`\n\nDisenroll a responder endpoint\n\n### Parameters\n\n- `type: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING'`\n The type of the endpoint.\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.responderEndpoints.delete({ type: 'AUTH_STREAM_ACCESS' })\n```", + perLanguage: { + typescript: { + method: 'client.responderEndpoints.delete', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.responderEndpoints.delete({ type: 'AUTH_STREAM_ACCESS' });", + }, + python: { + method: 'responder_endpoints.delete', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.responder_endpoints.delete(\n type="AUTH_STREAM_ACCESS",\n)', + }, + java: { + method: 'responderEndpoints().delete', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ResponderEndpointDeleteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ResponderEndpointDeleteParams params = ResponderEndpointDeleteParams.builder()\n .type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS)\n .build();\n client.responderEndpoints().delete(params);\n }\n}', + }, + kotlin: { + method: 'responderEndpoints().delete', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ResponderEndpointDeleteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ResponderEndpointDeleteParams = ResponderEndpointDeleteParams.builder()\n .type(ResponderEndpointDeleteParams.Type.AUTH_STREAM_ACCESS)\n .build()\n client.responderEndpoints().delete(params)\n}', + }, + go: { + method: 'client.ResponderEndpoints.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.ResponderEndpoints.Delete(context.TODO(), lithic.ResponderEndpointDeleteParams{\n\t\tType: lithic.F(lithic.ResponderEndpointDeleteParamsTypeAuthStreamAccess),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'responder_endpoints.delete', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.responder_endpoints.delete(type: :AUTH_STREAM_ACCESS)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/responder_endpoints \\\n -X DELETE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'check_status', + endpoint: '/v1/responder_endpoints', + httpMethod: 'get', + summary: 'Check the status of a responder endpoint', + description: 'Check the status of a responder endpoint', + stainlessPath: '(resource) responder_endpoints > (method) check_status', + qualified: 'client.responderEndpoints.checkStatus', + params: ["type: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING';"], + response: '{ enrolled?: boolean; url?: string; }', + markdown: + "## check_status\n\n`client.responderEndpoints.checkStatus(type: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING'): { enrolled?: boolean; url?: string; }`\n\n**get** `/v1/responder_endpoints`\n\nCheck the status of a responder endpoint\n\n### Parameters\n\n- `type: 'AUTH_STREAM_ACCESS' | 'THREE_DS_DECISIONING' | 'TOKENIZATION_DECISIONING'`\n The type of the endpoint.\n\n### Returns\n\n- `{ enrolled?: boolean; url?: string; }`\n\n - `enrolled?: boolean`\n - `url?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst responderEndpointStatus = await client.responderEndpoints.checkStatus({ type: 'AUTH_STREAM_ACCESS' });\n\nconsole.log(responderEndpointStatus);\n```", + perLanguage: { + typescript: { + method: 'client.responderEndpoints.checkStatus', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst responderEndpointStatus = await client.responderEndpoints.checkStatus({\n type: 'AUTH_STREAM_ACCESS',\n});\n\nconsole.log(responderEndpointStatus.enrolled);", + }, + python: { + method: 'responder_endpoints.check_status', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponder_endpoint_status = client.responder_endpoints.check_status(\n type="AUTH_STREAM_ACCESS",\n)\nprint(responder_endpoint_status.enrolled)', + }, + java: { + method: 'responderEndpoints().checkStatus', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ResponderEndpointCheckStatusParams;\nimport com.lithic.api.models.ResponderEndpointStatus;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ResponderEndpointCheckStatusParams params = ResponderEndpointCheckStatusParams.builder()\n .type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS)\n .build();\n ResponderEndpointStatus responderEndpointStatus = client.responderEndpoints().checkStatus(params);\n }\n}', + }, + kotlin: { + method: 'responderEndpoints().checkStatus', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ResponderEndpointCheckStatusParams\nimport com.lithic.api.models.ResponderEndpointStatus\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ResponderEndpointCheckStatusParams = ResponderEndpointCheckStatusParams.builder()\n .type(ResponderEndpointCheckStatusParams.Type.AUTH_STREAM_ACCESS)\n .build()\n val responderEndpointStatus: ResponderEndpointStatus = client.responderEndpoints().checkStatus(params)\n}', + }, + go: { + method: 'client.ResponderEndpoints.CheckStatus', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponderEndpointStatus, err := client.ResponderEndpoints.CheckStatus(context.TODO(), lithic.ResponderEndpointCheckStatusParams{\n\t\tType: lithic.F(lithic.ResponderEndpointCheckStatusParamsTypeAuthStreamAccess),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", responderEndpointStatus.Enrolled)\n}\n', + }, + ruby: { + method: 'responder_endpoints.check_status', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponder_endpoint_status = lithic.responder_endpoints.check_status(type: :AUTH_STREAM_ACCESS)\n\nputs(responder_endpoint_status)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/responder_endpoints \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/external_bank_accounts', + httpMethod: 'get', + summary: 'List external bank accounts', + description: 'List all the external bank accounts for the provided search criteria.', + stainlessPath: '(resource) external_bank_accounts > (method) list', + qualified: 'client.externalBankAccounts.list', + params: [ + 'account_token?: string;', + "account_types?: 'CHECKING' | 'SAVINGS'[];", + 'countries?: string[];', + 'ending_before?: string;', + "owner_types?: 'INDIVIDUAL' | 'BUSINESS'[];", + 'page_size?: number;', + 'starting_after?: string;', + "states?: 'ENABLED' | 'CLOSED' | 'PAUSED'[];", + "verification_states?: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'[];", + ], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## list\n\n`client.externalBankAccounts.list(account_token?: string, account_types?: 'CHECKING' | 'SAVINGS'[], countries?: string[], ending_before?: string, owner_types?: 'INDIVIDUAL' | 'BUSINESS'[], page_size?: number, starting_after?: string, states?: 'ENABLED' | 'CLOSED' | 'PAUSED'[], verification_states?: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'[]): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**get** `/v1/external_bank_accounts`\n\nList all the external bank accounts for the provided search criteria.\n\n### Parameters\n\n- `account_token?: string`\n\n- `account_types?: 'CHECKING' | 'SAVINGS'[]`\n\n- `countries?: string[]`\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `owner_types?: 'INDIVIDUAL' | 'BUSINESS'[]`\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `states?: 'ENABLED' | 'CLOSED' | 'PAUSED'[]`\n\n- `verification_states?: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'[]`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'BUSINESS' | 'INDIVIDUAL'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const externalBankAccountListResponse of client.externalBankAccounts.list()) {\n console.log(externalBankAccountListResponse);\n}\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const externalBankAccountListResponse of client.externalBankAccounts.list()) {\n console.log(externalBankAccountListResponse.company_id);\n}", + }, + python: { + method: 'external_bank_accounts.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.external_bank_accounts.list()\npage = page.data[0]\nprint(page.company_id)', + }, + java: { + method: 'externalBankAccounts().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccountListPage;\nimport com.lithic.api.models.ExternalBankAccountListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountListPage page = client.externalBankAccounts().list();\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccountListPage\nimport com.lithic.api.models.ExternalBankAccountListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: ExternalBankAccountListPage = client.externalBankAccounts().list()\n}', + }, + go: { + method: 'client.ExternalBankAccounts.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.ExternalBankAccounts.List(context.TODO(), lithic.ExternalBankAccountListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.external_bank_accounts.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/external_bank_accounts', + httpMethod: 'post', + summary: 'Create external bank account', + description: 'Creates an external bank account within a program or Lithic account.', + stainlessPath: '(resource) external_bank_accounts > (method) create', + qualified: 'client.externalBankAccounts.create', + params: [ + "{ account_number: string; country: string; currency: string; financial_account_token: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; type: 'CHECKING' | 'SAVINGS'; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; name?: string; user_defined_id?: string; verification_enforcement?: boolean; } | { account_number: string; country: string; currency: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; type: 'CHECKING' | 'SAVINGS'; verification_method: 'EXTERNALLY_VERIFIED'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; name?: string; user_defined_id?: string; } | { account_number: string; country: string; currency: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; type: 'CHECKING' | 'SAVINGS'; verification_method: 'UNVERIFIED'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; name?: string; user_defined_id?: string; };", + ], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.create({\n account_number: '13719713158835300',\n country: 'USA',\n currency: 'USD',\n financial_account_token: 'dabadb3b-700c-41e3-8801-d5dfc84ebea0',\n owner: 'John Doe',\n owner_type: 'BUSINESS',\n routing_number: '011103093',\n type: 'CHECKING',\n verification_method: 'MICRO_DEPOSIT',\n address: {\n address1: '5 Broad Street',\n city: 'New York',\n country: 'USA',\n postal_code: '10001',\n state: 'NY',\n },\n name: 'John Does Checking',\n});\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.create(\n account_number="13719713158835300",\n country="USA",\n currency="USD",\n financial_account_token="dabadb3b-700c-41e3-8801-d5dfc84ebea0",\n owner="John Doe",\n owner_type="BUSINESS",\n routing_number="011103093",\n type="CHECKING",\n verification_method="MICRO_DEPOSIT",\n address={\n "address1": "5 Broad Street",\n "city": "New York",\n "country": "USA",\n "postal_code": "10001",\n "state": "NY",\n },\n name="John Does Checking",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccountCreateParams;\nimport com.lithic.api.models.ExternalBankAccountCreateResponse;\nimport com.lithic.api.models.OwnerType;\nimport com.lithic.api.models.VerificationMethod;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountCreateParams.Body.BankVerifiedCreateBankAccountApiRequest params = ExternalBankAccountCreateParams.Body.BankVerifiedCreateBankAccountApiRequest.builder()\n .accountNumber("13719713158835300")\n .country("USA")\n .currency("USD")\n .financialAccountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0")\n .owner("John Doe")\n .ownerType(OwnerType.BUSINESS)\n .routingNumber("011103093")\n .type(ExternalBankAccountCreateParams.Body.BankVerifiedCreateBankAccountApiRequest.AccountType.CHECKING)\n .verificationMethod(VerificationMethod.MICRO_DEPOSIT)\n .build();\n ExternalBankAccountCreateResponse externalBankAccount = client.externalBankAccounts().create(params);\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccountCreateParams\nimport com.lithic.api.models.ExternalBankAccountCreateResponse\nimport com.lithic.api.models.OwnerType\nimport com.lithic.api.models.VerificationMethod\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalBankAccountCreateParams.Body.BankVerifiedCreateBankAccountApiRequest = ExternalBankAccountCreateParams.Body.BankVerifiedCreateBankAccountApiRequest.builder()\n .accountNumber("13719713158835300")\n .country("USA")\n .currency("USD")\n .financialAccountToken("dabadb3b-700c-41e3-8801-d5dfc84ebea0")\n .owner("John Doe")\n .ownerType(OwnerType.BUSINESS)\n .routingNumber("011103093")\n .type(ExternalBankAccountCreateParams.Body.BankVerifiedCreateBankAccountApiRequest.AccountType.CHECKING)\n .verificationMethod(VerificationMethod.MICRO_DEPOSIT)\n .build()\n val externalBankAccount: ExternalBankAccountCreateResponse = client.externalBankAccounts().create(params)\n}', + }, + go: { + method: 'client.ExternalBankAccounts.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.New(context.TODO(), lithic.ExternalBankAccountNewParams{\n\t\tBody: lithic.ExternalBankAccountNewParamsBodyBankVerifiedCreateBankAccountAPIRequest{\n\t\t\tAccountNumber: lithic.F("13719713158835300"),\n\t\t\tCountry: lithic.F("USA"),\n\t\t\tCurrency: lithic.F("USD"),\n\t\t\tFinancialAccountToken: lithic.F("dabadb3b-700c-41e3-8801-d5dfc84ebea0"),\n\t\t\tOwner: lithic.F("John Doe"),\n\t\t\tOwnerType: lithic.F(lithic.OwnerTypeBusiness),\n\t\t\tRoutingNumber: lithic.F("011103093"),\n\t\t\tType: lithic.F(lithic.ExternalBankAccountNewParamsBodyBankVerifiedCreateBankAccountAPIRequestTypeChecking),\n\t\t\tVerificationMethod: lithic.F(lithic.VerificationMethodMicroDeposit),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.create(\n body: {\n account_number: "13719713158835300",\n country: "USA",\n currency: "USD",\n financial_account_token: "dabadb3b-700c-41e3-8801-d5dfc84ebea0",\n owner: "John Doe",\n owner_type: :BUSINESS,\n routing_number: "011103093",\n type: :CHECKING,\n verification_method: :MICRO_DEPOSIT\n }\n)\n\nputs(external_bank_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "account_number": "12345678901234567",\n "country": "USD",\n "currency": "USD",\n "financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "owner": "owner",\n "owner_type": "INDIVIDUAL",\n "routing_number": "123456789",\n "type": "CHECKING",\n "verification_method": "MANUAL"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}', + httpMethod: 'get', + summary: 'Get external bank account by token', + description: 'Get the external bank account by token.', + stainlessPath: '(resource) external_bank_accounts > (method) retrieve', + qualified: 'client.externalBankAccounts.retrieve', + params: ['external_bank_account_token: string;'], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## retrieve\n\n`client.externalBankAccounts.retrieve(external_bank_account_token: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**get** `/v1/external_bank_accounts/{external_bank_account_token}`\n\nGet the external bank account by token.\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'BUSINESS' | 'INDIVIDUAL'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalBankAccount = await client.externalBankAccounts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(externalBankAccount);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccountRetrieveParams;\nimport com.lithic.api.models.ExternalBankAccountRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountRetrieveResponse externalBankAccount = client.externalBankAccounts().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccountRetrieveParams\nimport com.lithic.api.models.ExternalBankAccountRetrieveResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val externalBankAccount: ExternalBankAccountRetrieveResponse = client.externalBankAccounts().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalBankAccounts.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(external_bank_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'update', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}', + httpMethod: 'patch', + summary: 'Update external bank account', + description: 'Update the external bank account by token.', + stainlessPath: '(resource) external_bank_accounts > (method) update', + qualified: 'client.externalBankAccounts.update', + params: [ + 'external_bank_account_token: string;', + 'address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; };', + 'company_id?: string;', + 'dob?: string;', + 'doing_business_as?: string;', + 'name?: string;', + 'owner?: string;', + "owner_type?: 'INDIVIDUAL' | 'BUSINESS';", + "type?: 'CHECKING' | 'SAVINGS';", + 'user_defined_id?: string;', + ], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## update\n\n`client.externalBankAccounts.update(external_bank_account_token: string, address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }, company_id?: string, dob?: string, doing_business_as?: string, name?: string, owner?: string, owner_type?: 'INDIVIDUAL' | 'BUSINESS', type?: 'CHECKING' | 'SAVINGS', user_defined_id?: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**patch** `/v1/external_bank_accounts/{external_bank_account_token}`\n\nUpdate the external bank account by token.\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n- `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n Address\n - `address1: string`\n - `city: string`\n - `country: string`\n - `postal_code: string`\n - `state: string`\n - `address2?: string`\n\n- `company_id?: string`\n Optional field that helps identify bank accounts in receipts\n\n- `dob?: string`\n Date of Birth of the Individual that owns the external bank account\n\n- `doing_business_as?: string`\n Doing Business As\n\n- `name?: string`\n The nickname for this External Bank Account\n\n- `owner?: string`\n Legal Name of the business or individual who owns the external account. This will appear in statements\n\n- `owner_type?: 'INDIVIDUAL' | 'BUSINESS'`\n Owner Type\n\n- `type?: 'CHECKING' | 'SAVINGS'`\n\n- `user_defined_id?: string`\n User Defined ID\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'BUSINESS' | 'INDIVIDUAL'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalBankAccount = await client.externalBankAccounts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(externalBankAccount);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.update', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.update(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.update', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.update(\n external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().update', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccountUpdateParams;\nimport com.lithic.api.models.ExternalBankAccountUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountUpdateResponse externalBankAccount = client.externalBankAccounts().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().update', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccountUpdateParams\nimport com.lithic.api.models.ExternalBankAccountUpdateResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val externalBankAccount: ExternalBankAccountUpdateResponse = client.externalBankAccounts().update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalBankAccounts.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.Update(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalBankAccountUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.update', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(external_bank_account)', + }, + http: { + example: + "curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'retry_micro_deposits', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}/retry_micro_deposits', + httpMethod: 'post', + summary: 'Retry external bank account via micro deposit', + description: 'Retry external bank account micro deposit verification.', + stainlessPath: '(resource) external_bank_accounts > (method) retry_micro_deposits', + qualified: 'client.externalBankAccounts.retryMicroDeposits', + params: ['external_bank_account_token: string;', 'financial_account_token?: string;'], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## retry_micro_deposits\n\n`client.externalBankAccounts.retryMicroDeposits(external_bank_account_token: string, financial_account_token?: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**post** `/v1/external_bank_accounts/{external_bank_account_token}/retry_micro_deposits`\n\nRetry external bank account micro deposit verification.\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n- `financial_account_token?: string`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'BUSINESS' | 'INDIVIDUAL'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.externalBankAccounts.retryMicroDeposits('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.retryMicroDeposits', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.externalBankAccounts.retryMicroDeposits(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(response.company_id);", + }, + python: { + method: 'external_bank_accounts.retry_micro_deposits', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.external_bank_accounts.retry_micro_deposits(\n external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.company_id)', + }, + java: { + method: 'externalBankAccounts().retryMicroDeposits', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccountRetryMicroDepositsParams;\nimport com.lithic.api.models.ExternalBankAccountRetryMicroDepositsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountRetryMicroDepositsResponse response = client.externalBankAccounts().retryMicroDeposits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().retryMicroDeposits', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccountRetryMicroDepositsParams\nimport com.lithic.api.models.ExternalBankAccountRetryMicroDepositsResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: ExternalBankAccountRetryMicroDepositsResponse = client.externalBankAccounts().retryMicroDeposits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalBankAccounts.RetryMicroDeposits', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.ExternalBankAccounts.RetryMicroDeposits(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalBankAccountRetryMicroDepositsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.retry_micro_deposits', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.external_bank_accounts.retry_micro_deposits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN/retry_micro_deposits \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retry_prenote', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}/retry_prenote', + httpMethod: 'post', + summary: 'Retry external bank account via prenote', + description: 'Retry external bank account prenote verification.', + stainlessPath: '(resource) external_bank_accounts > (method) retry_prenote', + qualified: 'client.externalBankAccounts.retryPrenote', + params: ['external_bank_account_token: string;', 'financial_account_token?: string;'], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## retry_prenote\n\n`client.externalBankAccounts.retryPrenote(external_bank_account_token: string, financial_account_token?: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: owner_type; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: verification_method; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**post** `/v1/external_bank_accounts/{external_bank_account_token}/retry_prenote`\n\nRetry external bank account prenote verification.\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n- `financial_account_token?: string`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'INDIVIDUAL' | 'BUSINESS'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalBankAccount = await client.externalBankAccounts.retryPrenote('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(externalBankAccount);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.retryPrenote', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.retryPrenote(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.retry_prenote', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.retry_prenote(\n external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().retryPrenote', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccount;\nimport com.lithic.api.models.ExternalBankAccountRetryPrenoteParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccount externalBankAccount = client.externalBankAccounts().retryPrenote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().retryPrenote', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccount\nimport com.lithic.api.models.ExternalBankAccountRetryPrenoteParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val externalBankAccount: ExternalBankAccount = client.externalBankAccounts().retryPrenote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalBankAccounts.RetryPrenote', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.RetryPrenote(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalBankAccountRetryPrenoteParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.retry_prenote', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.retry_prenote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(external_bank_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN/retry_prenote \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'pause', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}/pause', + httpMethod: 'post', + summary: 'Pause external bank account', + description: 'Pause an external bank account\n', + stainlessPath: '(resource) external_bank_accounts > (method) pause', + qualified: 'client.externalBankAccounts.pause', + params: ['external_bank_account_token: string;'], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## pause\n\n`client.externalBankAccounts.pause(external_bank_account_token: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: owner_type; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: verification_method; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**post** `/v1/external_bank_accounts/{external_bank_account_token}/pause`\n\nPause an external bank account\n\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'INDIVIDUAL' | 'BUSINESS'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalBankAccount = await client.externalBankAccounts.pause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(externalBankAccount);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.pause', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.pause(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.pause', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.pause(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().pause', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccount;\nimport com.lithic.api.models.ExternalBankAccountPauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccount externalBankAccount = client.externalBankAccounts().pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().pause', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccount\nimport com.lithic.api.models.ExternalBankAccountPauseParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val externalBankAccount: ExternalBankAccount = client.externalBankAccounts().pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalBankAccounts.Pause', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.Pause(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.pause', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(external_bank_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN/pause \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'unpause', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}/unpause', + httpMethod: 'post', + summary: 'Unpause external bank account', + description: 'Unpause an external bank account\n', + stainlessPath: '(resource) external_bank_accounts > (method) unpause', + qualified: 'client.externalBankAccounts.unpause', + params: ['external_bank_account_token: string;'], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## unpause\n\n`client.externalBankAccounts.unpause(external_bank_account_token: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: owner_type; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: verification_method; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**post** `/v1/external_bank_accounts/{external_bank_account_token}/unpause`\n\nUnpause an external bank account\n\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'INDIVIDUAL' | 'BUSINESS'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalBankAccount = await client.externalBankAccounts.unpause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(externalBankAccount);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.unpause', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.unpause(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.unpause', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.unpause(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().unpause', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccount;\nimport com.lithic.api.models.ExternalBankAccountUnpauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccount externalBankAccount = client.externalBankAccounts().unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().unpause', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccount\nimport com.lithic.api.models.ExternalBankAccountUnpauseParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val externalBankAccount: ExternalBankAccount = client.externalBankAccounts().unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalBankAccounts.Unpause', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.Unpause(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.unpause', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(external_bank_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN/unpause \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'set_verification_method', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}/set_verification_method', + httpMethod: 'post', + summary: 'Set verification method', + description: + 'Update the verification method for an external bank account. Verification method can only be updated\nif the `verification_state` is `PENDING`.\n', + stainlessPath: '(resource) external_bank_accounts > (method) set_verification_method', + qualified: 'client.externalBankAccounts.setVerificationMethod', + params: [ + 'external_bank_account_token: string;', + "verification_method: 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED';", + 'financial_account_token?: string;', + ], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## set_verification_method\n\n`client.externalBankAccounts.setVerificationMethod(external_bank_account_token: string, verification_method: 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED', financial_account_token?: string): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: owner_type; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: verification_method; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**post** `/v1/external_bank_accounts/{external_bank_account_token}/set_verification_method`\n\nUpdate the verification method for an external bank account. Verification method can only be updated\nif the `verification_state` is `PENDING`.\n\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n- `verification_method: 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED'`\n The verification method to set for the external bank account\n\n- `financial_account_token?: string`\n The financial account token of the operating account to fund the micro deposits. Required when verification_method is MICRO_DEPOSIT or PRENOTE.\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'INDIVIDUAL' | 'BUSINESS'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'INDIVIDUAL' | 'BUSINESS'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED' | 'UNVERIFIED'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalBankAccount = await client.externalBankAccounts.setVerificationMethod('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { verification_method: 'MICRO_DEPOSIT' });\n\nconsole.log(externalBankAccount);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.setVerificationMethod', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalBankAccount = await client.externalBankAccounts.setVerificationMethod(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { verification_method: 'MICRO_DEPOSIT' },\n);\n\nconsole.log(externalBankAccount.company_id);", + }, + python: { + method: 'external_bank_accounts.set_verification_method', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_bank_account = client.external_bank_accounts.set_verification_method(\n external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n verification_method="MICRO_DEPOSIT",\n)\nprint(external_bank_account.company_id)', + }, + java: { + method: 'externalBankAccounts().setVerificationMethod', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccount;\nimport com.lithic.api.models.ExternalBankAccountSetVerificationMethodParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountSetVerificationMethodParams params = ExternalBankAccountSetVerificationMethodParams.builder()\n .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .verificationMethod(ExternalBankAccountSetVerificationMethodParams.SetVerificationMethodAllowedVerificationMethods.MICRO_DEPOSIT)\n .build();\n ExternalBankAccount externalBankAccount = client.externalBankAccounts().setVerificationMethod(params);\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().setVerificationMethod', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccount\nimport com.lithic.api.models.ExternalBankAccountSetVerificationMethodParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalBankAccountSetVerificationMethodParams = ExternalBankAccountSetVerificationMethodParams.builder()\n .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .verificationMethod(ExternalBankAccountSetVerificationMethodParams.SetVerificationMethodAllowedVerificationMethods.MICRO_DEPOSIT)\n .build()\n val externalBankAccount: ExternalBankAccount = client.externalBankAccounts().setVerificationMethod(params)\n}', + }, + go: { + method: 'client.ExternalBankAccounts.SetVerificationMethod', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalBankAccount, err := client.ExternalBankAccounts.SetVerificationMethod(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalBankAccountSetVerificationMethodParams{\n\t\t\tVerificationMethod: lithic.F(lithic.ExternalBankAccountSetVerificationMethodParamsVerificationMethodMicroDeposit),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalBankAccount.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.set_verification_method', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_bank_account = lithic.external_bank_accounts.set_verification_method(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n verification_method: :MICRO_DEPOSIT\n)\n\nputs(external_bank_account)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN/set_verification_method \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "verification_method": "MICRO_DEPOSIT"\n }\'', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/external_bank_accounts/{external_bank_account_token}/micro_deposits', + httpMethod: 'post', + summary: 'Verify external bank account via micro deposit amounts', + description: 'Verify the external bank account by providing the micro deposit amounts.', + stainlessPath: '(resource) external_bank_accounts.micro_deposits > (method) create', + qualified: 'client.externalBankAccounts.microDeposits.create', + params: ['external_bank_account_token: string;', 'micro_deposits: number[];'], + response: + "{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }", + markdown: + "## create\n\n`client.externalBankAccounts.microDeposits.create(external_bank_account_token: string, micro_deposits: number[]): { token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: external_bank_account_address; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n**post** `/v1/external_bank_accounts/{external_bank_account_token}/micro_deposits`\n\nVerify the external bank account by providing the micro deposit amounts.\n\n### Parameters\n\n- `external_bank_account_token: string`\n\n- `micro_deposits: number[]`\n\n### Returns\n\n- `{ token: string; country: string; created: string; currency: string; last_four: string; owner: string; owner_type: 'BUSINESS' | 'INDIVIDUAL'; routing_number: string; state: 'ENABLED' | 'CLOSED' | 'PAUSED'; type: 'CHECKING' | 'SAVINGS'; verification_attempts: number; verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'; verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'; account_token?: string; address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }; company_id?: string; dob?: string; doing_business_as?: string; financial_account_token?: string; name?: string; user_defined_id?: string; verification_failed_reason?: string; }`\n\n - `token: string`\n - `country: string`\n - `created: string`\n - `currency: string`\n - `last_four: string`\n - `owner: string`\n - `owner_type: 'BUSINESS' | 'INDIVIDUAL'`\n - `routing_number: string`\n - `state: 'ENABLED' | 'CLOSED' | 'PAUSED'`\n - `type: 'CHECKING' | 'SAVINGS'`\n - `verification_attempts: number`\n - `verification_method: 'MANUAL' | 'MICRO_DEPOSIT' | 'PLAID' | 'PRENOTE'`\n - `verification_state: 'PENDING' | 'ENABLED' | 'FAILED_VERIFICATION' | 'INSUFFICIENT_FUNDS'`\n - `account_token?: string`\n - `address?: { address1: string; city: string; country: string; postal_code: string; state: string; address2?: string; }`\n - `company_id?: string`\n - `dob?: string`\n - `doing_business_as?: string`\n - `financial_account_token?: string`\n - `name?: string`\n - `user_defined_id?: string`\n - `verification_failed_reason?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst microDeposit = await client.externalBankAccounts.microDeposits.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { micro_deposits: [0, 0] });\n\nconsole.log(microDeposit);\n```", + perLanguage: { + typescript: { + method: 'client.externalBankAccounts.microDeposits.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst microDeposit = await client.externalBankAccounts.microDeposits.create(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { micro_deposits: [0, 0] },\n);\n\nconsole.log(microDeposit.company_id);", + }, + python: { + method: 'external_bank_accounts.micro_deposits.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nmicro_deposit = client.external_bank_accounts.micro_deposits.create(\n external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n micro_deposits=[0, 0],\n)\nprint(micro_deposit.company_id)', + }, + java: { + method: 'externalBankAccounts().microDeposits().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalBankAccountMicroDepositCreateParams;\nimport com.lithic.api.models.MicroDepositCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalBankAccountMicroDepositCreateParams params = ExternalBankAccountMicroDepositCreateParams.builder()\n .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .addMicroDeposit(0L)\n .addMicroDeposit(0L)\n .build();\n MicroDepositCreateResponse microDeposit = client.externalBankAccounts().microDeposits().create(params);\n }\n}', + }, + kotlin: { + method: 'externalBankAccounts().microDeposits().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalBankAccountMicroDepositCreateParams\nimport com.lithic.api.models.MicroDepositCreateResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalBankAccountMicroDepositCreateParams = ExternalBankAccountMicroDepositCreateParams.builder()\n .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .addMicroDeposit(0L)\n .addMicroDeposit(0L)\n .build()\n val microDeposit: MicroDepositCreateResponse = client.externalBankAccounts().microDeposits().create(params)\n}', + }, + go: { + method: 'client.ExternalBankAccounts.MicroDeposits.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tmicroDeposit, err := client.ExternalBankAccounts.MicroDeposits.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalBankAccountMicroDepositNewParams{\n\t\t\tMicroDeposits: lithic.F([]int64{int64(0), int64(0)}),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", microDeposit.CompanyID)\n}\n', + }, + ruby: { + method: 'external_bank_accounts.micro_deposits.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nmicro_deposit = lithic.external_bank_accounts.micro_deposits.create(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n micro_deposits: [0, 0]\n)\n\nputs(micro_deposit)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_bank_accounts/$EXTERNAL_BANK_ACCOUNT_TOKEN/micro_deposits \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "micro_deposits": [\n 0,\n 0\n ]\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/payments', + httpMethod: 'get', + summary: 'List payments', + description: 'List all the payments for the provided search criteria.', + stainlessPath: '(resource) payments > (method) list', + qualified: 'client.payments.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'business_account_token?: string;', + "category?: 'ACH';", + 'end?: string;', + 'ending_before?: string;', + 'financial_account_token?: string;', + 'page_size?: number;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'DECLINED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED';", + ], + response: + "{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }", + markdown: + "## list\n\n`client.payments.list(account_token?: string, begin?: string, business_account_token?: string, category?: 'ACH', end?: string, ending_before?: string, financial_account_token?: string, page_size?: number, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'DECLINED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED'): { token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n\n**get** `/v1/payments`\n\nList all the payments for the provided search criteria.\n\n### Parameters\n\n- `account_token?: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `business_account_token?: string`\n\n- `category?: 'ACH'`\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `financial_account_token?: string`\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `result?: 'APPROVED' | 'DECLINED'`\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'DECLINED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED'`\n\n### Returns\n\n- `{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: object; debtor?: object; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n Payment transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `descriptor: string`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]`\n - `family: 'PAYMENT'`\n - `financial_account_token: string`\n - `method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'`\n - `method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: { account_number?: string; agent_id?: string; agent_name?: string; name?: string; }; debtor?: { account_number?: string; agent_id?: string; agent_name?: string; name?: string; }; message_id?: string; remittance_information?: string; }`\n - `pending_amount: number`\n - `related_account_tokens: { account_token: string; business_account_token: string; }`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `expected_release_date?: string`\n - `external_bank_account_token?: string`\n - `tags?: object`\n - `type?: string`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.payments.list()) {\n console.log(payment);\n}\n```", + perLanguage: { + typescript: { + method: 'client.payments.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.payments.list()) {\n console.log(payment.user_defined_id);\n}", + }, + python: { + method: 'payments.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.payments.list()\npage = page.data[0]\nprint(page.user_defined_id)', + }, + java: { + method: 'payments().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentListPage;\nimport com.lithic.api.models.PaymentListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentListPage page = client.payments().list();\n }\n}', + }, + kotlin: { + method: 'payments().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentListPage\nimport com.lithic.api.models.PaymentListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: PaymentListPage = client.payments().list()\n}', + }, + go: { + method: 'client.Payments.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Payments.List(context.TODO(), lithic.PaymentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'payments.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.payments.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/payments \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/payments', + httpMethod: 'post', + summary: 'Create payment', + description: 'Initiates a payment between a financial account and an external bank account.', + stainlessPath: '(resource) payments > (method) create', + qualified: 'client.payments.create', + params: [ + 'amount: number;', + 'external_bank_account_token: string;', + 'financial_account_token: string;', + "method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY';", + "method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB'; ach_hold_period?: number; addenda?: string; override_company_name?: string; };", + "type: 'COLLECTION' | 'PAYMENT';", + 'token?: string;', + 'hold?: { token: string; };', + 'memo?: string;', + 'user_defined_id?: string;', + ], + response: + "{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }", + markdown: + "## create\n\n`client.payments.create(amount: number, external_bank_account_token: string, financial_account_token: string, method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY', method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB'; ach_hold_period?: number; addenda?: string; override_company_name?: string; }, type: 'COLLECTION' | 'PAYMENT', token?: string, hold?: { token: string; }, memo?: string, user_defined_id?: string): object`\n\n**post** `/v1/payments`\n\nInitiates a payment between a financial account and an external bank account.\n\n### Parameters\n\n- `amount: number`\n\n- `external_bank_account_token: string`\n\n- `financial_account_token: string`\n\n- `method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY'`\n\n- `method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB'; ach_hold_period?: number; addenda?: string; override_company_name?: string; }`\n - `sec_code: 'CCD' | 'PPD' | 'WEB'`\n - `ach_hold_period?: number`\n Number of days to hold the ACH payment\n - `addenda?: string`\n - `override_company_name?: string`\n Value to override the configured company name with. Can only be used if allowed to override\n\n- `type: 'COLLECTION' | 'PAYMENT'`\n\n- `token?: string`\n Customer-provided token that will serve as an idempotency token. This token will become the transaction token.\n\n- `hold?: { token: string; }`\n Optional hold to settle when this payment is initiated.\n - `token: string`\n Token of the hold to settle when this payment is initiated.\n\n- `memo?: string`\n\n- `user_defined_id?: string`\n\n### Returns\n\n- `{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: wire_party_details; debtor?: wire_party_details; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n Payment transaction\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst payment = await client.payments.create({\n amount: 1,\n external_bank_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n method: 'ACH_NEXT_DAY',\n method_attributes: { sec_code: 'CCD' },\n type: 'COLLECTION',\n});\n\nconsole.log(payment);\n```", + perLanguage: { + typescript: { + method: 'client.payments.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.create({\n amount: 1,\n external_bank_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n method: 'ACH_NEXT_DAY',\n method_attributes: { sec_code: 'CCD' },\n type: 'COLLECTION',\n});\n\nconsole.log(payment);", + }, + python: { + method: 'payments.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.create(\n amount=1,\n external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n method="ACH_NEXT_DAY",\n method_attributes={\n "sec_code": "CCD"\n },\n type="COLLECTION",\n)\nprint(payment)', + }, + java: { + method: 'payments().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentCreateParams;\nimport com.lithic.api.models.PaymentCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentCreateParams params = PaymentCreateParams.builder()\n .amount(1L)\n .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .method(PaymentCreateParams.Method.ACH_NEXT_DAY)\n .methodAttributes(PaymentCreateParams.PaymentMethodRequestAttributes.builder()\n .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)\n .build())\n .type(PaymentCreateParams.Type.COLLECTION)\n .build();\n PaymentCreateResponse payment = client.payments().create(params);\n }\n}', + }, + kotlin: { + method: 'payments().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentCreateParams\nimport com.lithic.api.models.PaymentCreateResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: PaymentCreateParams = PaymentCreateParams.builder()\n .amount(1L)\n .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .method(PaymentCreateParams.Method.ACH_NEXT_DAY)\n .methodAttributes(PaymentCreateParams.PaymentMethodRequestAttributes.builder()\n .secCode(PaymentCreateParams.PaymentMethodRequestAttributes.SecCode.CCD)\n .build())\n .type(PaymentCreateParams.Type.COLLECTION)\n .build()\n val payment: PaymentCreateResponse = client.payments().create(params)\n}', + }, + go: { + method: 'client.Payments.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpayment, err := client.Payments.New(context.TODO(), lithic.PaymentNewParams{\n\t\tAmount: lithic.F(int64(1)),\n\t\tExternalBankAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tMethod: lithic.F(lithic.PaymentNewParamsMethodACHNextDay),\n\t\tMethodAttributes: lithic.F(lithic.PaymentNewParamsMethodAttributes{\n\t\t\tSecCode: lithic.F(lithic.PaymentNewParamsMethodAttributesSecCodeCcd),\n\t\t}),\n\t\tType: lithic.F(lithic.PaymentNewParamsTypeCollection),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment)\n}\n', + }, + ruby: { + method: 'payments.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npayment = lithic.payments.create(\n amount: 1,\n external_bank_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n method_: :ACH_NEXT_DAY,\n method_attributes: {sec_code: :CCD},\n type: :COLLECTION\n)\n\nputs(payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/payments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 1,\n "external_bank_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "method": "ACH_NEXT_DAY",\n "method_attributes": {\n "sec_code": "CCD"\n },\n "type": "COLLECTION"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/payments/{payment_token}', + httpMethod: 'get', + summary: 'Get payment by token', + description: 'Get the payment by token.', + stainlessPath: '(resource) payments > (method) retrieve', + qualified: 'client.payments.retrieve', + params: ['payment_token: string;'], + response: + "{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }", + markdown: + "## retrieve\n\n`client.payments.retrieve(payment_token: string): { token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n\n**get** `/v1/payments/{payment_token}`\n\nGet the payment by token.\n\n### Parameters\n\n- `payment_token: string`\n\n### Returns\n\n- `{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: object; debtor?: object; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n Payment transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `descriptor: string`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]`\n - `family: 'PAYMENT'`\n - `financial_account_token: string`\n - `method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'`\n - `method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: { account_number?: string; agent_id?: string; agent_name?: string; name?: string; }; debtor?: { account_number?: string; agent_id?: string; agent_name?: string; name?: string; }; message_id?: string; remittance_information?: string; }`\n - `pending_amount: number`\n - `related_account_tokens: { account_token: string; business_account_token: string; }`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `expected_release_date?: string`\n - `external_bank_account_token?: string`\n - `tags?: object`\n - `type?: string`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst payment = await client.payments.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(payment);\n```", + perLanguage: { + typescript: { + method: 'client.payments.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(payment.user_defined_id);", + }, + python: { + method: 'payments.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(payment.user_defined_id)', + }, + java: { + method: 'payments().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Payment;\nimport com.lithic.api.models.PaymentRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Payment payment = client.payments().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'payments().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Payment\nimport com.lithic.api.models.PaymentRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val payment: Payment = client.payments().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Payments.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpayment, err := client.Payments.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'payments.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npayment = lithic.payments.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/payments/$PAYMENT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'simulate_release', + endpoint: '/v1/simulate/payments/release', + httpMethod: 'post', + summary: 'Simulate release payment', + description: 'Simulates a release of a Payment.', + stainlessPath: '(resource) payments > (method) simulate_release', + qualified: 'client.payments.simulateRelease', + params: ['payment_token: string;'], + response: + "{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }", + markdown: + "## simulate_release\n\n`client.payments.simulateRelease(payment_token: string): { debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n**post** `/v1/simulate/payments/release`\n\nSimulates a release of a Payment.\n\n### Parameters\n\n- `payment_token: string`\n Payment Token\n\n### Returns\n\n- `{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n - `debugging_request_id: string`\n - `result: 'APPROVED' | 'DECLINED'`\n - `transaction_event_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.payments.simulateRelease({ payment_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.payments.simulateRelease', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.simulateRelease({\n payment_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'payments.simulate_release', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.simulate_release(\n payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'payments().simulateRelease', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentSimulateReleaseParams;\nimport com.lithic.api.models.PaymentSimulateReleaseResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentSimulateReleaseParams params = PaymentSimulateReleaseParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n PaymentSimulateReleaseResponse response = client.payments().simulateRelease(params);\n }\n}', + }, + kotlin: { + method: 'payments().simulateRelease', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentSimulateReleaseParams\nimport com.lithic.api.models.PaymentSimulateReleaseResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: PaymentSimulateReleaseParams = PaymentSimulateReleaseParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val response: PaymentSimulateReleaseResponse = client.payments().simulateRelease(params)\n}', + }, + go: { + method: 'client.Payments.SimulateRelease', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Payments.SimulateRelease(context.TODO(), lithic.PaymentSimulateReleaseParams{\n\t\tPaymentToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'payments.simulate_release', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.payments.simulate_release(payment_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/payments/release \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "payment_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'', + }, + }, + }, + { + name: 'simulate_return', + endpoint: '/v1/simulate/payments/return', + httpMethod: 'post', + summary: 'Simulate return payment', + description: 'Simulates a return of a Payment.', + stainlessPath: '(resource) payments > (method) simulate_return', + qualified: 'client.payments.simulateReturn', + params: ['payment_token: string;', 'return_reason_code?: string;'], + response: + "{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }", + markdown: + "## simulate_return\n\n`client.payments.simulateReturn(payment_token: string, return_reason_code?: string): { debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n**post** `/v1/simulate/payments/return`\n\nSimulates a return of a Payment.\n\n### Parameters\n\n- `payment_token: string`\n Payment Token\n\n- `return_reason_code?: string`\n Return Reason Code\n\n### Returns\n\n- `{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n - `debugging_request_id: string`\n - `result: 'APPROVED' | 'DECLINED'`\n - `transaction_event_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.payments.simulateReturn({ payment_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.payments.simulateReturn', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.simulateReturn({\n payment_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'payments.simulate_return', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.simulate_return(\n payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'payments().simulateReturn', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentSimulateReturnParams;\nimport com.lithic.api.models.PaymentSimulateReturnResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentSimulateReturnParams params = PaymentSimulateReturnParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n PaymentSimulateReturnResponse response = client.payments().simulateReturn(params);\n }\n}', + }, + kotlin: { + method: 'payments().simulateReturn', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentSimulateReturnParams\nimport com.lithic.api.models.PaymentSimulateReturnResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: PaymentSimulateReturnParams = PaymentSimulateReturnParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val response: PaymentSimulateReturnResponse = client.payments().simulateReturn(params)\n}', + }, + go: { + method: 'client.Payments.SimulateReturn', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Payments.SimulateReturn(context.TODO(), lithic.PaymentSimulateReturnParams{\n\t\tPaymentToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'payments.simulate_return', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.payments.simulate_return(payment_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/payments/return \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "payment_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "return_reason_code": "R12"\n }\'', + }, + }, + }, + { + name: 'retry', + endpoint: '/v1/payments/{payment_token}/retry', + httpMethod: 'post', + summary: 'Retry payment', + description: 'Retry an origination which has been returned.', + stainlessPath: '(resource) payments > (method) retry', + qualified: 'client.payments.retry', + params: ['payment_token: string;'], + response: + "{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }", + markdown: + "## retry\n\n`client.payments.retry(payment_token: string): object`\n\n**post** `/v1/payments/{payment_token}/retry`\n\nRetry an origination which has been returned.\n\n### Parameters\n\n- `payment_token: string`\n\n### Returns\n\n- `{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: wire_party_details; debtor?: wire_party_details; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n Payment transaction\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.payments.retry('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.payments.retry', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.retry('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);", + }, + python: { + method: 'payments.retry', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.retry(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response)', + }, + java: { + method: 'payments().retry', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentRetryParams;\nimport com.lithic.api.models.PaymentRetryResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentRetryResponse response = client.payments().retry("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'payments().retry', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentRetryParams\nimport com.lithic.api.models.PaymentRetryResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: PaymentRetryResponse = client.payments().retry("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Payments.Retry', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Payments.Retry(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + }, + ruby: { + method: 'payments.retry_', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.payments.retry_("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/payments/$PAYMENT_TOKEN/retry \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'return', + endpoint: '/v1/payments/{payment_token}/return', + httpMethod: 'post', + summary: 'Return payment', + description: + 'Return an ACH payment with a specified return reason code. Returns must be initiated\nwithin the time window specified by NACHA rules for each return code (typically 2 banking\ndays for most codes, 60 calendar days for unauthorized debits). For a complete list of\nreturn codes and their meanings, see the [ACH Return Reasons documentation](https://docs.lithic.com/docs/ach-overview#ach-return-reasons).\n\nNote:\n * This endpoint does not modify the state of the financial account associated with the payment. If you would like to change the account state, use the [Update financial account status](https://docs.lithic.com/reference/updatefinancialaccountstatus) endpoint.\n * By default this endpoint is not enabled for your account. Please contact your implementations manager to enable this feature.\n', + stainlessPath: '(resource) payments > (method) return', + qualified: 'client.payments.return', + params: [ + 'payment_token: string;', + 'financial_account_token: string;', + 'return_reason_code: string;', + 'addenda?: string;', + 'date_of_death?: string;', + 'memo?: string;', + ], + response: + "{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }", + markdown: + "## return\n\n`client.payments.return(payment_token: string, financial_account_token: string, return_reason_code: string, addenda?: string, date_of_death?: string, memo?: string): { token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: object[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: object | object; pending_amount: number; related_account_tokens: object; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n\n**post** `/v1/payments/{payment_token}/return`\n\nReturn an ACH payment with a specified return reason code. Returns must be initiated\nwithin the time window specified by NACHA rules for each return code (typically 2 banking\ndays for most codes, 60 calendar days for unauthorized debits). For a complete list of\nreturn codes and their meanings, see the [ACH Return Reasons documentation](https://docs.lithic.com/docs/ach-overview#ach-return-reasons).\n\nNote:\n * This endpoint does not modify the state of the financial account associated with the payment. If you would like to change the account state, use the [Update financial account status](https://docs.lithic.com/reference/updatefinancialaccountstatus) endpoint.\n * By default this endpoint is not enabled for your account. Please contact your implementations manager to enable this feature.\n\n\n### Parameters\n\n- `payment_token: string`\n\n- `financial_account_token: string`\n Globally unique identifier for the financial account\n\n- `return_reason_code: string`\n ACH return reason code indicating the reason for returning the payment. Supported codes include R01-R53 and R80-R85. For a complete list of return codes and their meanings, see [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons)\n\n- `addenda?: string`\n Optional additional information about the return. Limited to 44 characters\n\n- `date_of_death?: string`\n Date of death in YYYY-MM-DD format. Required when using return codes **R14** (representative payee deceased) or **R15** (beneficiary or account holder deceased)\n\n- `memo?: string`\n Optional memo for the return. Limited to 10 characters\n\n### Returns\n\n- `{ token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: object; debtor?: object; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; }`\n Payment transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `descriptor: string`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]`\n - `family: 'PAYMENT'`\n - `financial_account_token: string`\n - `method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'`\n - `method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: { account_number?: string; agent_id?: string; agent_name?: string; name?: string; }; debtor?: { account_number?: string; agent_id?: string; agent_name?: string; name?: string; }; message_id?: string; remittance_information?: string; }`\n - `pending_amount: number`\n - `related_account_tokens: { account_token: string; business_account_token: string; }`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `expected_release_date?: string`\n - `external_bank_account_token?: string`\n - `tags?: object`\n - `type?: string`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst payment = await client.payments.return('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', return_reason_code: 'R01' });\n\nconsole.log(payment);\n```", + perLanguage: { + typescript: { + method: 'client.payments.return', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst payment = await client.payments.return('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n return_reason_code: 'R01',\n});\n\nconsole.log(payment.user_defined_id);", + }, + python: { + method: 'payments.return_', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npayment = client.payments.return_(\n payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n return_reason_code="R01",\n)\nprint(payment.user_defined_id)', + }, + java: { + method: 'payments().return_', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Payment;\nimport com.lithic.api.models.PaymentReturnParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentReturnParams params = PaymentReturnParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .returnReasonCode("R01")\n .build();\n Payment payment = client.payments().return_(params);\n }\n}', + }, + kotlin: { + method: 'payments().return_', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Payment\nimport com.lithic.api.models.PaymentReturnParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: PaymentReturnParams = PaymentReturnParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .returnReasonCode("R01")\n .build()\n val payment: Payment = client.payments().return_(params)\n}', + }, + go: { + method: 'client.Payments.Return', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpayment, err := client.Payments.Return(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.PaymentReturnParams{\n\t\t\tFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\t\tReturnReasonCode: lithic.F("R01"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'payments.return_', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npayment = lithic.payments.return_(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n return_reason_code: "R01"\n)\n\nputs(payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/payments/$PAYMENT_TOKEN/return \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "return_reason_code": "R01",\n "date_of_death": "2025-01-15"\n }\'', + }, + }, + }, + { + name: 'simulate_receipt', + endpoint: '/v1/simulate/payments/receipt', + httpMethod: 'post', + summary: 'Simulate receipt', + description: 'Simulates a receipt of a Payment.', + stainlessPath: '(resource) payments > (method) simulate_receipt', + qualified: 'client.payments.simulateReceipt', + params: [ + 'token: string;', + 'amount: number;', + 'financial_account_token: string;', + "receipt_type: 'RECEIPT_CREDIT' | 'RECEIPT_DEBIT';", + 'memo?: string;', + ], + response: + "{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }", + markdown: + "## simulate_receipt\n\n`client.payments.simulateReceipt(token: string, amount: number, financial_account_token: string, receipt_type: 'RECEIPT_CREDIT' | 'RECEIPT_DEBIT', memo?: string): { debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n**post** `/v1/simulate/payments/receipt`\n\nSimulates a receipt of a Payment.\n\n### Parameters\n\n- `token: string`\n Customer-generated payment token used to uniquely identify the simulated payment\n\n- `amount: number`\n Amount\n\n- `financial_account_token: string`\n Financial Account Token\n\n- `receipt_type: 'RECEIPT_CREDIT' | 'RECEIPT_DEBIT'`\n Receipt Type\n\n- `memo?: string`\n Memo\n\n### Returns\n\n- `{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n - `debugging_request_id: string`\n - `result: 'APPROVED' | 'DECLINED'`\n - `transaction_event_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.payments.simulateReceipt({\n token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n amount: 0,\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n receipt_type: 'RECEIPT_CREDIT',\n});\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.payments.simulateReceipt', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.simulateReceipt({\n token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n amount: 0,\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n receipt_type: 'RECEIPT_CREDIT',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'payments.simulate_receipt', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.simulate_receipt(\n token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n amount=0,\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n receipt_type="RECEIPT_CREDIT",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'payments().simulateReceipt', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentSimulateReceiptParams;\nimport com.lithic.api.models.PaymentSimulateReceiptResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentSimulateReceiptParams params = PaymentSimulateReceiptParams.builder()\n .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .amount(0L)\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .receiptType(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT)\n .build();\n PaymentSimulateReceiptResponse response = client.payments().simulateReceipt(params);\n }\n}', + }, + kotlin: { + method: 'payments().simulateReceipt', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentSimulateReceiptParams\nimport com.lithic.api.models.PaymentSimulateReceiptResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: PaymentSimulateReceiptParams = PaymentSimulateReceiptParams.builder()\n .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .amount(0L)\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .receiptType(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT)\n .build()\n val response: PaymentSimulateReceiptResponse = client.payments().simulateReceipt(params)\n}', + }, + go: { + method: 'client.Payments.SimulateReceipt', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Payments.SimulateReceipt(context.TODO(), lithic.PaymentSimulateReceiptParams{\n\t\tToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tAmount: lithic.F(int64(0)),\n\t\tFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tReceiptType: lithic.F(lithic.PaymentSimulateReceiptParamsReceiptTypeReceiptCredit),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'payments.simulate_receipt', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.payments.simulate_receipt(\n token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n amount: 0,\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n receipt_type: :RECEIPT_CREDIT\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/payments/receipt \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "amount": 0,\n "financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "receipt_type": "RECEIPT_CREDIT"\n }\'', + }, + }, + }, + { + name: 'simulate_action', + endpoint: '/v1/simulate/payments/{payment_token}/action', + httpMethod: 'post', + summary: 'Simulate payment lifecycle event', + description: 'Simulate payment lifecycle event', + stainlessPath: '(resource) payments > (method) simulate_action', + qualified: 'client.payments.simulateAction', + params: [ + 'payment_token: string;', + 'event_type: string;', + 'date_of_death?: string;', + 'decline_reason?: string;', + 'return_addenda?: string;', + 'return_reason_code?: string;', + ], + response: + "{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }", + markdown: + "## simulate_action\n\n`client.payments.simulateAction(payment_token: string, event_type: string, date_of_death?: string, decline_reason?: string, return_addenda?: string, return_reason_code?: string): { debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n**post** `/v1/simulate/payments/{payment_token}/action`\n\nSimulate payment lifecycle event\n\n### Parameters\n\n- `payment_token: string`\n\n- `event_type: string`\n Event Type\n\n- `date_of_death?: string`\n Date of Death for ACH Return\n\n- `decline_reason?: string`\n Decline reason\n\n- `return_addenda?: string`\n Return Addenda\n\n- `return_reason_code?: string`\n Return Reason Code\n\n### Returns\n\n- `{ debugging_request_id: string; result: 'APPROVED' | 'DECLINED'; transaction_event_token: string; }`\n\n - `debugging_request_id: string`\n - `result: 'APPROVED' | 'DECLINED'`\n - `transaction_event_token: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.payments.simulateAction('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { event_type: 'ACH_ORIGINATION_REVIEWED' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.payments.simulateAction', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.payments.simulateAction('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {\n event_type: 'ACH_ORIGINATION_REVIEWED',\n});\n\nconsole.log(response.debugging_request_id);", + }, + python: { + method: 'payments.simulate_action', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.payments.simulate_action(\n payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n event_type="ACH_ORIGINATION_REVIEWED",\n)\nprint(response.debugging_request_id)', + }, + java: { + method: 'payments().simulateAction', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.PaymentSimulateActionParams;\nimport com.lithic.api.models.PaymentSimulateActionResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PaymentSimulateActionParams params = PaymentSimulateActionParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .eventType(PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED)\n .build();\n PaymentSimulateActionResponse response = client.payments().simulateAction(params);\n }\n}', + }, + kotlin: { + method: 'payments().simulateAction', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.PaymentSimulateActionParams\nimport com.lithic.api.models.PaymentSimulateActionResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: PaymentSimulateActionParams = PaymentSimulateActionParams.builder()\n .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .eventType(PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED)\n .build()\n val response: PaymentSimulateActionResponse = client.payments().simulateAction(params)\n}', + }, + go: { + method: 'client.Payments.SimulateAction', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Payments.SimulateAction(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.PaymentSimulateActionParams{\n\t\t\tEventType: lithic.F(lithic.PaymentSimulateActionParamsEventTypeACHOriginationReviewed),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.DebuggingRequestID)\n}\n', + }, + ruby: { + method: 'payments.simulate_action', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.payments.simulate_action(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n event_type: :ACH_ORIGINATION_REVIEWED\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/simulate/payments/$PAYMENT_TOKEN/action \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "event_type": "ACH_ORIGINATION_REVIEWED"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/three_ds_authentication/{three_ds_authentication_token}', + httpMethod: 'get', + summary: 'Get 3DS authentication', + description: 'Get 3DS Authentication by token', + stainlessPath: '(resource) three_ds.authentication > (method) retrieve', + qualified: 'client.threeDS.authentication.retrieve', + params: ['three_ds_authentication_token: string;'], + response: + "{ token: string; account_type: 'CREDIT' | 'DEBIT' | 'NOT_APPLICABLE'; authentication_result: 'DECLINE' | 'SUCCESS' | 'PENDING_CHALLENGE' | 'PENDING_DECISION'; card_expiry_check: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT'; card_token: string; cardholder: object; channel: 'APP_BASED' | 'BROWSER' | 'THREE_DS_REQUESTOR_INITIATED'; created: string; merchant: object; message_category: 'NON_PAYMENT_AUTHENTICATION' | 'PAYMENT_AUTHENTICATION'; three_ds_requestor_challenge_indicator: string; additional_data?: object; app?: object; authentication_request_type?: string; browser?: object; challenge_metadata?: object; challenge_orchestrated_by?: 'LITHIC' | 'CUSTOMER' | 'NO_CHALLENGE'; decision_made_by?: 'LITHIC_RULES' | 'LITHIC_DEFAULT' | 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'NETWORK' | 'UNKNOWN'; three_ri_request_type?: string; transaction?: object; }", + markdown: + "## retrieve\n\n`client.threeDS.authentication.retrieve(three_ds_authentication_token: string): { token: string; account_type: 'CREDIT' | 'DEBIT' | 'NOT_APPLICABLE'; authentication_result: 'DECLINE' | 'SUCCESS' | 'PENDING_CHALLENGE' | 'PENDING_DECISION'; card_expiry_check: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT'; card_token: string; cardholder: object; channel: 'APP_BASED' | 'BROWSER' | 'THREE_DS_REQUESTOR_INITIATED'; created: string; merchant: object; message_category: 'NON_PAYMENT_AUTHENTICATION' | 'PAYMENT_AUTHENTICATION'; three_ds_requestor_challenge_indicator: string; additional_data?: object; app?: object; authentication_request_type?: string; browser?: object; challenge_metadata?: object; challenge_orchestrated_by?: 'LITHIC' | 'CUSTOMER' | 'NO_CHALLENGE'; decision_made_by?: 'LITHIC_RULES' | 'LITHIC_DEFAULT' | 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'NETWORK' | 'UNKNOWN'; three_ri_request_type?: string; transaction?: object; }`\n\n**get** `/v1/three_ds_authentication/{three_ds_authentication_token}`\n\nGet 3DS Authentication by token\n\n### Parameters\n\n- `three_ds_authentication_token: string`\n\n### Returns\n\n- `{ token: string; account_type: 'CREDIT' | 'DEBIT' | 'NOT_APPLICABLE'; authentication_result: 'DECLINE' | 'SUCCESS' | 'PENDING_CHALLENGE' | 'PENDING_DECISION'; card_expiry_check: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT'; card_token: string; cardholder: { address_match?: boolean; address_on_file_match?: 'MATCH' | 'MATCH_ADDRESS_ONLY' | 'MATCH_ZIP_ONLY' | 'MISMATCH' | 'NOT_PRESENT'; billing_address?: { address1?: string; address2?: string; address3?: string; city?: string; country?: string; postal_code?: string; }; email?: string; name?: string; phone_number_home?: string; phone_number_mobile?: string; phone_number_work?: string; shipping_address?: { address1?: string; address2?: string; address3?: string; city?: string; country?: string; postal_code?: string; }; }; channel: 'APP_BASED' | 'BROWSER' | 'THREE_DS_REQUESTOR_INITIATED'; created: string; merchant: { risk_indicator: { delivery_email_address?: string; delivery_time_frame?: 'ELECTRONIC_DELIVERY' | 'OVERNIGHT_SHIPPING' | 'SAME_DAY_SHIPPING' | 'TWO_DAY_OR_MORE_SHIPPING'; gift_card_amount?: number; gift_card_count?: number; gift_card_currency?: string; order_availability?: 'FUTURE_AVAILABILITY' | 'MERCHANDISE_AVAILABLE'; pre_order_available_date?: string; reorder_items?: 'FIRST_TIME_ORDERED' | 'REORDERED'; shipping_method?: string; }; id?: string; country?: string; mcc?: string; name?: string; }; message_category: 'NON_PAYMENT_AUTHENTICATION' | 'PAYMENT_AUTHENTICATION'; three_ds_requestor_challenge_indicator: string; additional_data?: { network_decision?: 'LOW_RISK' | 'NOT_LOW_RISK'; network_risk_score?: number; }; app?: { device?: string; device_info?: string; ip?: string; latitude?: number; locale?: string; longitude?: number; os?: string; platform?: string; screen_height?: number; screen_width?: number; time_zone?: string; }; authentication_request_type?: string; browser?: { accept_header?: string; ip?: string; java_enabled?: boolean; javascript_enabled?: boolean; language?: string; time_zone?: string; user_agent?: string; }; challenge_metadata?: { method_type: 'SMS_OTP' | 'OUT_OF_BAND'; status: string; phone_number?: string; }; challenge_orchestrated_by?: 'LITHIC' | 'CUSTOMER' | 'NO_CHALLENGE'; decision_made_by?: 'LITHIC_RULES' | 'LITHIC_DEFAULT' | 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'NETWORK' | 'UNKNOWN'; three_ri_request_type?: string; transaction?: { amount: number; cardholder_amount: number; currency: string; currency_exponent: number; date_time: string; type: string; }; }`\n Represents a 3DS authentication\n\n - `token: string`\n - `account_type: 'CREDIT' | 'DEBIT' | 'NOT_APPLICABLE'`\n - `authentication_result: 'DECLINE' | 'SUCCESS' | 'PENDING_CHALLENGE' | 'PENDING_DECISION'`\n - `card_expiry_check: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT'`\n - `card_token: string`\n - `cardholder: { address_match?: boolean; address_on_file_match?: 'MATCH' | 'MATCH_ADDRESS_ONLY' | 'MATCH_ZIP_ONLY' | 'MISMATCH' | 'NOT_PRESENT'; billing_address?: { address1?: string; address2?: string; address3?: string; city?: string; country?: string; postal_code?: string; }; email?: string; name?: string; phone_number_home?: string; phone_number_mobile?: string; phone_number_work?: string; shipping_address?: { address1?: string; address2?: string; address3?: string; city?: string; country?: string; postal_code?: string; }; }`\n - `channel: 'APP_BASED' | 'BROWSER' | 'THREE_DS_REQUESTOR_INITIATED'`\n - `created: string`\n - `merchant: { risk_indicator: { delivery_email_address?: string; delivery_time_frame?: 'ELECTRONIC_DELIVERY' | 'OVERNIGHT_SHIPPING' | 'SAME_DAY_SHIPPING' | 'TWO_DAY_OR_MORE_SHIPPING'; gift_card_amount?: number; gift_card_count?: number; gift_card_currency?: string; order_availability?: 'FUTURE_AVAILABILITY' | 'MERCHANDISE_AVAILABLE'; pre_order_available_date?: string; reorder_items?: 'FIRST_TIME_ORDERED' | 'REORDERED'; shipping_method?: string; }; id?: string; country?: string; mcc?: string; name?: string; }`\n - `message_category: 'NON_PAYMENT_AUTHENTICATION' | 'PAYMENT_AUTHENTICATION'`\n - `three_ds_requestor_challenge_indicator: string`\n - `additional_data?: { network_decision?: 'LOW_RISK' | 'NOT_LOW_RISK'; network_risk_score?: number; }`\n - `app?: { device?: string; device_info?: string; ip?: string; latitude?: number; locale?: string; longitude?: number; os?: string; platform?: string; screen_height?: number; screen_width?: number; time_zone?: string; }`\n - `authentication_request_type?: string`\n - `browser?: { accept_header?: string; ip?: string; java_enabled?: boolean; javascript_enabled?: boolean; language?: string; time_zone?: string; user_agent?: string; }`\n - `challenge_metadata?: { method_type: 'SMS_OTP' | 'OUT_OF_BAND'; status: string; phone_number?: string; }`\n - `challenge_orchestrated_by?: 'LITHIC' | 'CUSTOMER' | 'NO_CHALLENGE'`\n - `decision_made_by?: 'LITHIC_RULES' | 'LITHIC_DEFAULT' | 'CUSTOMER_RULES' | 'CUSTOMER_ENDPOINT' | 'NETWORK' | 'UNKNOWN'`\n - `three_ri_request_type?: string`\n - `transaction?: { amount: number; cardholder_amount: number; currency: string; currency_exponent: number; date_time: string; type: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst threeDSAuthentication = await client.threeDS.authentication.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(threeDSAuthentication);\n```", + perLanguage: { + typescript: { + method: 'client.threeDS.authentication.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst threeDSAuthentication = await client.threeDS.authentication.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(threeDSAuthentication.token);", + }, + python: { + method: 'three_ds.authentication.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nthree_ds_authentication = client.three_ds.authentication.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(three_ds_authentication.token)', + }, + java: { + method: 'threeDS().authentication().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ThreeDSAuthentication;\nimport com.lithic.api.models.ThreeDSAuthenticationRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ThreeDSAuthentication threeDSAuthentication = client.threeDS().authentication().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'threeDS().authentication().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ThreeDSAuthentication\nimport com.lithic.api.models.ThreeDSAuthenticationRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val threeDSAuthentication: ThreeDSAuthentication = client.threeDS().authentication().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ThreeDS.Authentication.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tthreeDSAuthentication, err := client.ThreeDS.Authentication.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", threeDSAuthentication.Token)\n}\n', + }, + ruby: { + method: 'three_ds.authentication.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nthree_ds_authentication = lithic.three_ds.authentication.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(three_ds_authentication)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/three_ds_authentication/$THREE_DS_AUTHENTICATION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'simulate', + endpoint: '/v1/three_ds_authentication/simulate', + httpMethod: 'post', + summary: 'Simulate 3DS authentication', + description: + "Simulates a 3DS authentication request from the payment network as if it came from an ACS. If you're configured for 3DS Customer Decisioning, simulating authentications requires your customer decisioning endpoint to be set up properly (respond with a valid JSON). If the authentication decision is to challenge, ensure that the account holder associated with the card transaction has a valid phone number configured to receive the OTP code via SMS. ", + stainlessPath: '(resource) three_ds.authentication > (method) simulate', + qualified: 'client.threeDS.authentication.simulate', + params: [ + 'merchant: { id: string; country: string; mcc: string; name: string; };', + 'pan: string;', + 'transaction: { amount: number; currency: string; };', + "card_expiry_check?: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT';", + ], + response: '{ token?: string; }', + markdown: + "## simulate\n\n`client.threeDS.authentication.simulate(merchant: { id: string; country: string; mcc: string; name: string; }, pan: string, transaction: { amount: number; currency: string; }, card_expiry_check?: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT'): { token?: string; }`\n\n**post** `/v1/three_ds_authentication/simulate`\n\nSimulates a 3DS authentication request from the payment network as if it came from an ACS. If you're configured for 3DS Customer Decisioning, simulating authentications requires your customer decisioning endpoint to be set up properly (respond with a valid JSON). If the authentication decision is to challenge, ensure that the account holder associated with the card transaction has a valid phone number configured to receive the OTP code via SMS. \n\n### Parameters\n\n- `merchant: { id: string; country: string; mcc: string; name: string; }`\n Merchant information for the simulated transaction\n - `id: string`\n Unique identifier to identify the payment card acceptor. Corresponds to `merchant_acceptor_id` in authorization.\n - `country: string`\n Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format (e.g. USA)\n - `mcc: string`\n Merchant category code for the transaction to be simulated. A four-digit number listed in ISO 18245. Supported merchant category codes can be found [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).\n - `name: string`\n Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE keyword is included, Lithic will trigger a challenge.\n\n- `pan: string`\n Sixteen digit card number.\n\n- `transaction: { amount: number; currency: string; }`\n Transaction details for the simulation\n - `amount: number`\n Amount (in cents) to authenticate.\n - `currency: string`\n 3-character alphabetic ISO 4217 currency code.\n\n- `card_expiry_check?: 'MATCH' | 'MISMATCH' | 'NOT_PRESENT'`\n When set will use the following values as part of the Simulated Authentication. When not set defaults to MATCH\n\n### Returns\n\n- `{ token?: string; }`\n\n - `token?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.threeDS.authentication.simulate({\n merchant: {\n id: 'OODKZAPJVN4YS7O',\n country: 'USA',\n mcc: '5812',\n name: 'COFFEE SHOP',\n},\n pan: '4111111289144142',\n transaction: { amount: 0, currency: 'GBP' },\n});\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.threeDS.authentication.simulate', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.threeDS.authentication.simulate({\n merchant: {\n id: 'OODKZAPJVN4YS7O',\n country: 'USA',\n mcc: '5812',\n name: 'COFFEE SHOP',\n },\n pan: '4111111289144142',\n transaction: { amount: 0, currency: 'GBP' },\n});\n\nconsole.log(response.token);", + }, + python: { + method: 'three_ds.authentication.simulate', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.three_ds.authentication.simulate(\n merchant={\n "id": "OODKZAPJVN4YS7O",\n "country": "USA",\n "mcc": "5812",\n "name": "COFFEE SHOP",\n },\n pan="4111111289144142",\n transaction={\n "amount": 0,\n "currency": "GBP",\n },\n)\nprint(response.token)', + }, + java: { + method: 'threeDS().authentication().simulate', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AuthenticationSimulateResponse;\nimport com.lithic.api.models.ThreeDSAuthenticationSimulateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ThreeDSAuthenticationSimulateParams params = ThreeDSAuthenticationSimulateParams.builder()\n .merchant(ThreeDSAuthenticationSimulateParams.Merchant.builder()\n .id("OODKZAPJVN4YS7O")\n .country("USA")\n .mcc("5812")\n .name("COFFEE SHOP")\n .build())\n .pan("4111111289144142")\n .transaction(ThreeDSAuthenticationSimulateParams.Transaction.builder()\n .amount(0L)\n .currency("GBP")\n .build())\n .build();\n AuthenticationSimulateResponse response = client.threeDS().authentication().simulate(params);\n }\n}', + }, + kotlin: { + method: 'threeDS().authentication().simulate', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AuthenticationSimulateResponse\nimport com.lithic.api.models.ThreeDSAuthenticationSimulateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ThreeDSAuthenticationSimulateParams = ThreeDSAuthenticationSimulateParams.builder()\n .merchant(ThreeDSAuthenticationSimulateParams.Merchant.builder()\n .id("OODKZAPJVN4YS7O")\n .country("USA")\n .mcc("5812")\n .name("COFFEE SHOP")\n .build())\n .pan("4111111289144142")\n .transaction(ThreeDSAuthenticationSimulateParams.Transaction.builder()\n .amount(0L)\n .currency("GBP")\n .build())\n .build()\n val response: AuthenticationSimulateResponse = client.threeDS().authentication().simulate(params)\n}', + }, + go: { + method: 'client.ThreeDS.Authentication.Simulate', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.ThreeDS.Authentication.Simulate(context.TODO(), lithic.ThreeDSAuthenticationSimulateParams{\n\t\tMerchant: lithic.F(lithic.ThreeDSAuthenticationSimulateParamsMerchant{\n\t\t\tID: lithic.F("OODKZAPJVN4YS7O"),\n\t\t\tCountry: lithic.F("USA"),\n\t\t\tMcc: lithic.F("5812"),\n\t\t\tName: lithic.F("COFFEE SHOP"),\n\t\t}),\n\t\tPan: lithic.F("4111111289144142"),\n\t\tTransaction: lithic.F(lithic.ThreeDSAuthenticationSimulateParamsTransaction{\n\t\t\tAmount: lithic.F(int64(0)),\n\t\t\tCurrency: lithic.F("GBP"),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Token)\n}\n', + }, + ruby: { + method: 'three_ds.authentication.simulate', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.three_ds.authentication.simulate(\n merchant: {id: "OODKZAPJVN4YS7O", country: "USA", mcc: "5812", name: "COFFEE SHOP"},\n pan: "4111111289144142",\n transaction: {amount: 0, currency: "GBP"}\n)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/three_ds_authentication/simulate \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "merchant": {\n "id": "OODKZAPJVN4YS7O",\n "country": "USA",\n "mcc": "5812",\n "name": "COFFEE SHOP"\n },\n "pan": "4111111289144142",\n "transaction": {\n "amount": 0,\n "currency": "GBP"\n }\n }\'', + }, + }, + }, + { + name: 'simulate_otp_entry', + endpoint: '/v1/three_ds_decisioning/simulate/enter_otp', + httpMethod: 'post', + summary: 'Simulate entering OTP into 3DS Challenge UI', + description: + 'Endpoint for simulating entering OTP into 3DS Challenge UI. A call to [/v1/three_ds_authentication/simulate](https://docs.lithic.com/reference/postsimulateauthentication) that resulted in triggered SMS-OTP challenge must precede. Only a single attempt is supported; upon entering OTP, the challenge is either approved or declined.', + stainlessPath: '(resource) three_ds.authentication > (method) simulate_otp_entry', + qualified: 'client.threeDS.authentication.simulateOtpEntry', + params: ['token: string;', 'otp: string;'], + markdown: + "## simulate_otp_entry\n\n`client.threeDS.authentication.simulateOtpEntry(token: string, otp: string): void`\n\n**post** `/v1/three_ds_decisioning/simulate/enter_otp`\n\nEndpoint for simulating entering OTP into 3DS Challenge UI. A call to [/v1/three_ds_authentication/simulate](https://docs.lithic.com/reference/postsimulateauthentication) that resulted in triggered SMS-OTP challenge must precede. Only a single attempt is supported; upon entering OTP, the challenge is either approved or declined.\n\n### Parameters\n\n- `token: string`\n A unique token returned as part of a /v1/three_ds_authentication/simulate call that resulted in PENDING_CHALLENGE authentication result.\n\n- `otp: string`\n The OTP entered by the cardholder\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.threeDS.authentication.simulateOtpEntry({ token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac', otp: '123456' })\n```", + perLanguage: { + typescript: { + method: 'client.threeDS.authentication.simulateOtpEntry', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.threeDS.authentication.simulateOtpEntry({\n token: 'fabd829d-7f7b-4432-a8f2-07ea4889aaac',\n otp: '123456',\n});", + }, + python: { + method: 'three_ds.authentication.simulate_otp_entry', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.three_ds.authentication.simulate_otp_entry(\n token="fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n otp="123456",\n)', + }, + java: { + method: 'threeDS().authentication().simulateOtpEntry', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ThreeDSAuthenticationSimulateOtpEntryParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ThreeDSAuthenticationSimulateOtpEntryParams params = ThreeDSAuthenticationSimulateOtpEntryParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .otp("123456")\n .build();\n client.threeDS().authentication().simulateOtpEntry(params);\n }\n}', + }, + kotlin: { + method: 'threeDS().authentication().simulateOtpEntry', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ThreeDSAuthenticationSimulateOtpEntryParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ThreeDSAuthenticationSimulateOtpEntryParams = ThreeDSAuthenticationSimulateOtpEntryParams.builder()\n .token("fabd829d-7f7b-4432-a8f2-07ea4889aaac")\n .otp("123456")\n .build()\n client.threeDS().authentication().simulateOtpEntry(params)\n}', + }, + go: { + method: 'client.ThreeDS.Authentication.SimulateOtpEntry', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.ThreeDS.Authentication.SimulateOtpEntry(context.TODO(), lithic.ThreeDSAuthenticationSimulateOtpEntryParams{\n\t\tToken: lithic.F("fabd829d-7f7b-4432-a8f2-07ea4889aaac"),\n\t\tOtp: lithic.F("123456"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'three_ds.authentication.simulate_otp_entry', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.three_ds.authentication.simulate_otp_entry(\n token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n otp: "123456"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/three_ds_decisioning/simulate/enter_otp \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "fabd829d-7f7b-4432-a8f2-07ea4889aaac",\n "otp": "123456"\n }\'', + }, + }, + }, + { + name: 'retrieve_secret', + endpoint: '/v1/three_ds_decisioning/secret', + httpMethod: 'get', + summary: 'Retrieve the 3DS Decisioning HMAC secret key', + description: + 'Retrieve the 3DS Decisioning HMAC secret key. If one does not exist for your program yet, calling this endpoint will create one for you. The headers (which you can use to verify 3DS Decisioning requests) will begin appearing shortly after calling this endpoint for the first time. See [this page](https://docs.lithic.com/docs/3ds-decisioning#3ds-decisioning-hmac-secrets) for more detail about verifying 3DS Decisioning requests.\n', + stainlessPath: '(resource) three_ds.decisioning > (method) retrieve_secret', + qualified: 'client.threeDS.decisioning.retrieveSecret', + response: '{ secret?: string; }', + markdown: + "## retrieve_secret\n\n`client.threeDS.decisioning.retrieveSecret(): { secret?: string; }`\n\n**get** `/v1/three_ds_decisioning/secret`\n\nRetrieve the 3DS Decisioning HMAC secret key. If one does not exist for your program yet, calling this endpoint will create one for you. The headers (which you can use to verify 3DS Decisioning requests) will begin appearing shortly after calling this endpoint for the first time. See [this page](https://docs.lithic.com/docs/3ds-decisioning#3ds-decisioning-hmac-secrets) for more detail about verifying 3DS Decisioning requests.\n\n\n### Returns\n\n- `{ secret?: string; }`\n\n - `secret?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.threeDS.decisioning.retrieveSecret();\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.threeDS.decisioning.retrieveSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.threeDS.decisioning.retrieveSecret();\n\nconsole.log(response.secret);", + }, + python: { + method: 'three_ds.decisioning.retrieve_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.three_ds.decisioning.retrieve_secret()\nprint(response.secret)', + }, + java: { + method: 'threeDS().decisioning().retrieveSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DecisioningRetrieveSecretResponse;\nimport com.lithic.api.models.ThreeDSDecisioningRetrieveSecretParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DecisioningRetrieveSecretResponse response = client.threeDS().decisioning().retrieveSecret();\n }\n}', + }, + kotlin: { + method: 'threeDS().decisioning().retrieveSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DecisioningRetrieveSecretResponse\nimport com.lithic.api.models.ThreeDSDecisioningRetrieveSecretParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: DecisioningRetrieveSecretResponse = client.threeDS().decisioning().retrieveSecret()\n}', + }, + go: { + method: 'client.ThreeDS.Decisioning.GetSecret', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.ThreeDS.Decisioning.GetSecret(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Secret)\n}\n', + }, + ruby: { + method: 'three_ds.decisioning.retrieve_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.three_ds.decisioning.retrieve_secret\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/three_ds_decisioning/secret \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'rotate_secret', + endpoint: '/v1/three_ds_decisioning/secret/rotate', + httpMethod: 'post', + summary: 'Rotate the 3DS Decisioning HMAC secret key', + description: + 'Generate a new 3DS Decisioning HMAC secret key. The old secret key will be deactivated 24 hours after a successful request to this endpoint. Make a [`GET /three_ds_decisioning/secret`](https://docs.lithic.com/reference/getthreedsdecisioningsecret) request to retrieve the new secret key.\n', + stainlessPath: '(resource) three_ds.decisioning > (method) rotate_secret', + qualified: 'client.threeDS.decisioning.rotateSecret', + markdown: + "## rotate_secret\n\n`client.threeDS.decisioning.rotateSecret(): void`\n\n**post** `/v1/three_ds_decisioning/secret/rotate`\n\nGenerate a new 3DS Decisioning HMAC secret key. The old secret key will be deactivated 24 hours after a successful request to this endpoint. Make a [`GET /three_ds_decisioning/secret`](https://docs.lithic.com/reference/getthreedsdecisioningsecret) request to retrieve the new secret key.\n\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.threeDS.decisioning.rotateSecret()\n```", + perLanguage: { + typescript: { + method: 'client.threeDS.decisioning.rotateSecret', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.threeDS.decisioning.rotateSecret();", + }, + python: { + method: 'three_ds.decisioning.rotate_secret', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.three_ds.decisioning.rotate_secret()', + }, + java: { + method: 'threeDS().decisioning().rotateSecret', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ThreeDSDecisioningRotateSecretParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.threeDS().decisioning().rotateSecret();\n }\n}', + }, + kotlin: { + method: 'threeDS().decisioning().rotateSecret', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ThreeDSDecisioningRotateSecretParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.threeDS().decisioning().rotateSecret()\n}', + }, + go: { + method: 'client.ThreeDS.Decisioning.RotateSecret', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.ThreeDS.Decisioning.RotateSecret(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'three_ds.decisioning.rotate_secret', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.three_ds.decisioning.rotate_secret\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/three_ds_decisioning/secret/rotate \\\n -X POST \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'challenge_response', + endpoint: '/v1/three_ds_decisioning/challenge_response', + httpMethod: 'post', + summary: 'Respond to a Challenge Request', + description: + "Card program's response to a 3DS Challenge Request.\nChallenge Request is emitted as a webhook [three_ds_authentication.challenge](https://docs.lithic.com/reference/threedsauthenticationchallengewebhook) and your Card Program needs to be configured with Out of Band (OOB) Challenges in order to receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for more information).", + stainlessPath: '(resource) three_ds.decisioning > (method) challenge_response', + qualified: 'client.threeDS.decisioning.challengeResponse', + params: ['token: string;', "challenge_response: 'APPROVE' | 'DECLINE_BY_CUSTOMER';"], + markdown: + "## challenge_response\n\n`client.threeDS.decisioning.challengeResponse(token: string, challenge_response: 'APPROVE' | 'DECLINE_BY_CUSTOMER'): void`\n\n**post** `/v1/three_ds_decisioning/challenge_response`\n\nCard program's response to a 3DS Challenge Request.\nChallenge Request is emitted as a webhook [three_ds_authentication.challenge](https://docs.lithic.com/reference/threedsauthenticationchallengewebhook) and your Card Program needs to be configured with Out of Band (OOB) Challenges in order to receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for more information).\n\n### Parameters\n\n- `token: string`\n Globally unique identifier for 3DS Authentication that resulted in PENDING_CHALLENGE authentication result.\n\n- `challenge_response: 'APPROVE' | 'DECLINE_BY_CUSTOMER'`\n Whether the Cardholder has approved or declined the issued Challenge\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.threeDS.decisioning.challengeResponse({ token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', challenge_response: 'APPROVE' })\n```", + perLanguage: { + typescript: { + method: 'client.threeDS.decisioning.challengeResponse', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.threeDS.decisioning.challengeResponse({\n token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n challenge_response: 'APPROVE',\n});", + }, + python: { + method: 'three_ds.decisioning.challenge_response', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.three_ds.decisioning.challenge_response(\n token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n challenge_response="APPROVE",\n)', + }, + java: { + method: 'threeDS().decisioning().challengeResponse', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ChallengeResponse;\nimport com.lithic.api.models.ChallengeResult;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ChallengeResponse params = ChallengeResponse.builder()\n .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .challengeResponse(ChallengeResult.APPROVE)\n .build();\n client.threeDS().decisioning().challengeResponse(params);\n }\n}', + }, + kotlin: { + method: 'threeDS().decisioning().challengeResponse', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ChallengeResponse\nimport com.lithic.api.models.ChallengeResult\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ChallengeResponse = ChallengeResponse.builder()\n .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .challengeResponse(ChallengeResult.APPROVE)\n .build()\n client.threeDS().decisioning().challengeResponse(params)\n}', + }, + go: { + method: 'client.ThreeDS.Decisioning.ChallengeResponse', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.ThreeDS.Decisioning.ChallengeResponse(context.TODO(), lithic.ThreeDSDecisioningChallengeResponseParams{\n\t\tChallengeResponse: lithic.ChallengeResponseParam{\n\t\t\tToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\t\tChallengeResponse: lithic.F(lithic.ChallengeResultApprove),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'three_ds.decisioning.challenge_response', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.three_ds.decisioning.challenge_response(\n token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n challenge_response: :APPROVE\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/three_ds_decisioning/challenge_response \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "challenge_response": "APPROVE"\n }\'', + }, + }, + }, + { + name: 'list_details', + endpoint: '/v1/reports/settlement/details/{report_date}', + httpMethod: 'get', + summary: 'List settlement details', + description: 'List details.', + stainlessPath: '(resource) reports.settlement > (method) list_details', + qualified: 'client.reports.settlement.listDetails', + params: [ + 'report_date: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + ], + response: + "{ token: string; account_token: string; card_program_token: string; card_token: string; created: string; currency: string; disputes_gross_amount: number; event_tokens: string[]; institution: string; interchange_fee_extended_precision: number; interchange_gross_amount: number; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; other_fees_details: { ISA?: number; }; other_fees_gross_amount: number; report_date: string; settlement_date: string; transaction_token: string; transactions_gross_amount: number; type: string; updated: string; fee_description?: string; }", + markdown: + "## list_details\n\n`client.reports.settlement.listDetails(report_date: string, ending_before?: string, page_size?: number, starting_after?: string): { token: string; account_token: string; card_program_token: string; card_token: string; created: string; currency: string; disputes_gross_amount: number; event_tokens: string[]; institution: string; interchange_fee_extended_precision: number; interchange_gross_amount: number; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; other_fees_details: object; other_fees_gross_amount: number; report_date: string; settlement_date: string; transaction_token: string; transactions_gross_amount: number; type: string; updated: string; fee_description?: string; }`\n\n**get** `/v1/reports/settlement/details/{report_date}`\n\nList details.\n\n### Parameters\n\n- `report_date: string`\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Number of records per page.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_token: string; card_program_token: string; card_token: string; created: string; currency: string; disputes_gross_amount: number; event_tokens: string[]; institution: string; interchange_fee_extended_precision: number; interchange_gross_amount: number; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; other_fees_details: { ISA?: number; }; other_fees_gross_amount: number; report_date: string; settlement_date: string; transaction_token: string; transactions_gross_amount: number; type: string; updated: string; fee_description?: string; }`\n\n - `token: string`\n - `account_token: string`\n - `card_program_token: string`\n - `card_token: string`\n - `created: string`\n - `currency: string`\n - `disputes_gross_amount: number`\n - `event_tokens: string[]`\n - `institution: string`\n - `interchange_fee_extended_precision: number`\n - `interchange_gross_amount: number`\n - `network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'`\n - `other_fees_details: { ISA?: number; }`\n - `other_fees_gross_amount: number`\n - `report_date: string`\n - `settlement_date: string`\n - `transaction_token: string`\n - `transactions_gross_amount: number`\n - `type: string`\n - `updated: string`\n - `fee_description?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const settlementDetail of client.reports.settlement.listDetails('2023-09-01')) {\n console.log(settlementDetail);\n}\n```", + perLanguage: { + typescript: { + method: 'client.reports.settlement.listDetails', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const settlementDetail of client.reports.settlement.listDetails('2023-09-01')) {\n console.log(settlementDetail.token);\n}", + }, + python: { + method: 'reports.settlement.list_details', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.reports.settlement.list_details(\n report_date=date.fromisoformat("2023-09-01"),\n)\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'reports().settlement().listDetails', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ReportSettlementListDetailsPage;\nimport com.lithic.api.models.ReportSettlementListDetailsParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ReportSettlementListDetailsPage page = client.reports().settlement().listDetails(LocalDate.parse("2023-09-01"));\n }\n}', + }, + kotlin: { + method: 'reports().settlement().listDetails', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ReportSettlementListDetailsPage\nimport com.lithic.api.models.ReportSettlementListDetailsParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: ReportSettlementListDetailsPage = client.reports().settlement().listDetails(LocalDate.parse("2023-09-01"))\n}', + }, + go: { + method: 'client.Reports.Settlement.ListDetails', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Reports.Settlement.ListDetails(\n\t\tcontext.TODO(),\n\t\ttime.Now(),\n\t\tlithic.ReportSettlementListDetailsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'reports.settlement.list_details', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.reports.settlement.list_details("2023-09-01")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/reports/settlement/details/$REPORT_DATE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'summary', + endpoint: '/v1/reports/settlement/summary/{report_date}', + httpMethod: 'get', + summary: 'Get settlement summary', + description: 'Get the settlement report for a specified report date. Not available in sandbox.', + stainlessPath: '(resource) reports.settlement > (method) summary', + qualified: 'client.reports.settlement.summary', + params: ['report_date: string;'], + response: + "{ created: string; currency: string; details: { currency?: string; disputes_gross_amount?: number; institution?: string; interchange_gross_amount?: number; network?: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; other_fees_gross_amount?: number; settled_net_amount?: number; transactions_gross_amount?: number; }[]; disputes_gross_amount: number; interchange_gross_amount: number; is_complete: boolean; other_fees_gross_amount: number; report_date: string; settled_net_amount: number; transactions_gross_amount: number; updated: string; }", + markdown: + "## summary\n\n`client.reports.settlement.summary(report_date: string): { created: string; currency: string; details: settlement_summary_details[]; disputes_gross_amount: number; interchange_gross_amount: number; is_complete: boolean; other_fees_gross_amount: number; report_date: string; settled_net_amount: number; transactions_gross_amount: number; updated: string; }`\n\n**get** `/v1/reports/settlement/summary/{report_date}`\n\nGet the settlement report for a specified report date. Not available in sandbox.\n\n### Parameters\n\n- `report_date: string`\n\n### Returns\n\n- `{ created: string; currency: string; details: { currency?: string; disputes_gross_amount?: number; institution?: string; interchange_gross_amount?: number; network?: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; other_fees_gross_amount?: number; settled_net_amount?: number; transactions_gross_amount?: number; }[]; disputes_gross_amount: number; interchange_gross_amount: number; is_complete: boolean; other_fees_gross_amount: number; report_date: string; settled_net_amount: number; transactions_gross_amount: number; updated: string; }`\n\n - `created: string`\n - `currency: string`\n - `details: { currency?: string; disputes_gross_amount?: number; institution?: string; interchange_gross_amount?: number; network?: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; other_fees_gross_amount?: number; settled_net_amount?: number; transactions_gross_amount?: number; }[]`\n - `disputes_gross_amount: number`\n - `interchange_gross_amount: number`\n - `is_complete: boolean`\n - `other_fees_gross_amount: number`\n - `report_date: string`\n - `settled_net_amount: number`\n - `transactions_gross_amount: number`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst settlementReport = await client.reports.settlement.summary('2023-09-01');\n\nconsole.log(settlementReport);\n```", + perLanguage: { + typescript: { + method: 'client.reports.settlement.summary', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst settlementReport = await client.reports.settlement.summary('2023-09-01');\n\nconsole.log(settlementReport.created);", + }, + python: { + method: 'reports.settlement.summary', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nsettlement_report = client.reports.settlement.summary(\n date.fromisoformat("2023-09-01"),\n)\nprint(settlement_report.created)', + }, + java: { + method: 'reports().settlement().summary', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ReportSettlementSummaryParams;\nimport com.lithic.api.models.SettlementReport;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n SettlementReport settlementReport = client.reports().settlement().summary(LocalDate.parse("2023-09-01"));\n }\n}', + }, + kotlin: { + method: 'reports().settlement().summary', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ReportSettlementSummaryParams\nimport com.lithic.api.models.SettlementReport\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val settlementReport: SettlementReport = client.reports().settlement().summary(LocalDate.parse("2023-09-01"))\n}', + }, + go: { + method: 'client.Reports.Settlement.Summary', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tsettlementReport, err := client.Reports.Settlement.Summary(context.TODO(), time.Now())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", settlementReport.Created)\n}\n', + }, + ruby: { + method: 'reports.settlement.summary', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nsettlement_report = lithic.reports.settlement.summary("2023-09-01")\n\nputs(settlement_report)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/reports/settlement/summary/$REPORT_DATE \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/reports/settlement/network_totals', + httpMethod: 'get', + summary: 'List network totals', + description: 'List network total records with optional filters. Not available in sandbox.', + stainlessPath: '(resource) reports.settlement.network_totals > (method) list', + qualified: 'client.reports.settlement.networkTotals.list', + params: [ + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'institution_id?: string;', + "network?: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK';", + 'page_size?: number;', + 'report_date?: string;', + 'report_date_begin?: string;', + 'report_date_end?: string;', + 'settlement_institution_id?: string;', + 'starting_after?: string;', + ], + response: + "{ token: string; amounts: { gross_settlement: number; interchange_fees: number; net_settlement: number; visa_charges?: number; }; created: string; currency: string; institution_id: string; is_complete: boolean; network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; report_date: string; settlement_institution_id: string; settlement_service: string; updated: string; cycle?: number; }", + markdown: + "## list\n\n`client.reports.settlement.networkTotals.list(begin?: string, end?: string, ending_before?: string, institution_id?: string, network?: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK', page_size?: number, report_date?: string, report_date_begin?: string, report_date_end?: string, settlement_institution_id?: string, starting_after?: string): { token: string; amounts: object; created: string; currency: string; institution_id: string; is_complete: boolean; network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; report_date: string; settlement_institution_id: string; settlement_service: string; updated: string; cycle?: number; }`\n\n**get** `/v1/reports/settlement/network_totals`\n\nList network total records with optional filters. Not available in sandbox.\n\n### Parameters\n\n- `begin?: string`\n Datetime in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Datetime in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `institution_id?: string`\n Institution ID to filter on.\n\n- `network?: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'`\n Network to filter on.\n\n- `page_size?: number`\n Number of records per page.\n\n- `report_date?: string`\n Singular report date to filter on (YYYY-MM-DD). Cannot be populated in conjunction with report_date_begin or report_date_end.\n\n- `report_date_begin?: string`\n Earliest report date to filter on, inclusive (YYYY-MM-DD).\n\n- `report_date_end?: string`\n Latest report date to filter on, inclusive (YYYY-MM-DD).\n\n- `settlement_institution_id?: string`\n Settlement institution ID to filter on.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; amounts: { gross_settlement: number; interchange_fees: number; net_settlement: number; visa_charges?: number; }; created: string; currency: string; institution_id: string; is_complete: boolean; network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; report_date: string; settlement_institution_id: string; settlement_service: string; updated: string; cycle?: number; }`\n\n - `token: string`\n - `amounts: { gross_settlement: number; interchange_fees: number; net_settlement: number; visa_charges?: number; }`\n - `created: string`\n - `currency: string`\n - `institution_id: string`\n - `is_complete: boolean`\n - `network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'`\n - `report_date: string`\n - `settlement_institution_id: string`\n - `settlement_service: string`\n - `updated: string`\n - `cycle?: number`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const networkTotal of client.reports.settlement.networkTotals.list()) {\n console.log(networkTotal);\n}\n```", + perLanguage: { + typescript: { + method: 'client.reports.settlement.networkTotals.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const networkTotal of client.reports.settlement.networkTotals.list()) {\n console.log(networkTotal.institution_id);\n}", + }, + python: { + method: 'reports.settlement.network_totals.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.reports.settlement.network_totals.list()\npage = page.data[0]\nprint(page.institution_id)', + }, + java: { + method: 'reports().settlement().networkTotals().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ReportSettlementNetworkTotalListPage;\nimport com.lithic.api.models.ReportSettlementNetworkTotalListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ReportSettlementNetworkTotalListPage page = client.reports().settlement().networkTotals().list();\n }\n}', + }, + kotlin: { + method: 'reports().settlement().networkTotals().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ReportSettlementNetworkTotalListPage\nimport com.lithic.api.models.ReportSettlementNetworkTotalListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: ReportSettlementNetworkTotalListPage = client.reports().settlement().networkTotals().list()\n}', + }, + go: { + method: 'client.Reports.Settlement.NetworkTotals.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Reports.Settlement.NetworkTotals.List(context.TODO(), lithic.ReportSettlementNetworkTotalListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'reports.settlement.network_totals.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.reports.settlement.network_totals.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/reports/settlement/network_totals \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/reports/settlement/network_totals/{token}', + httpMethod: 'get', + summary: 'Get network total', + description: 'Retrieve a specific network total record by token. Not available in sandbox.', + stainlessPath: '(resource) reports.settlement.network_totals > (method) retrieve', + qualified: 'client.reports.settlement.networkTotals.retrieve', + params: ['token: string;'], + response: + "{ token: string; amounts: { gross_settlement: number; interchange_fees: number; net_settlement: number; visa_charges?: number; }; created: string; currency: string; institution_id: string; is_complete: boolean; network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; report_date: string; settlement_institution_id: string; settlement_service: string; updated: string; cycle?: number; }", + markdown: + "## retrieve\n\n`client.reports.settlement.networkTotals.retrieve(token: string): { token: string; amounts: object; created: string; currency: string; institution_id: string; is_complete: boolean; network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; report_date: string; settlement_institution_id: string; settlement_service: string; updated: string; cycle?: number; }`\n\n**get** `/v1/reports/settlement/network_totals/{token}`\n\nRetrieve a specific network total record by token. Not available in sandbox.\n\n### Parameters\n\n- `token: string`\n\n### Returns\n\n- `{ token: string; amounts: { gross_settlement: number; interchange_fees: number; net_settlement: number; visa_charges?: number; }; created: string; currency: string; institution_id: string; is_complete: boolean; network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; report_date: string; settlement_institution_id: string; settlement_service: string; updated: string; cycle?: number; }`\n\n - `token: string`\n - `amounts: { gross_settlement: number; interchange_fees: number; net_settlement: number; visa_charges?: number; }`\n - `created: string`\n - `currency: string`\n - `institution_id: string`\n - `is_complete: boolean`\n - `network: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'`\n - `report_date: string`\n - `settlement_institution_id: string`\n - `settlement_service: string`\n - `updated: string`\n - `cycle?: number`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst networkTotal = await client.reports.settlement.networkTotals.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(networkTotal);\n```", + perLanguage: { + typescript: { + method: 'client.reports.settlement.networkTotals.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst networkTotal = await client.reports.settlement.networkTotals.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(networkTotal.institution_id);", + }, + python: { + method: 'reports.settlement.network_totals.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nnetwork_total = client.reports.settlement.network_totals.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(network_total.institution_id)', + }, + java: { + method: 'reports().settlement().networkTotals().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.NetworkTotal;\nimport com.lithic.api.models.ReportSettlementNetworkTotalRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n NetworkTotal networkTotal = client.reports().settlement().networkTotals().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'reports().settlement().networkTotals().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.NetworkTotal\nimport com.lithic.api.models.ReportSettlementNetworkTotalRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val networkTotal: NetworkTotal = client.reports().settlement().networkTotals().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Reports.Settlement.NetworkTotals.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tnetworkTotal, err := client.Reports.Settlement.NetworkTotals.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", networkTotal.InstitutionID)\n}\n', + }, + ruby: { + method: 'reports.settlement.network_totals.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nnetwork_total = lithic.reports.settlement.network_totals.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(network_total)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/reports/settlement/network_totals/$TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/card_programs', + httpMethod: 'get', + summary: 'List card programs', + description: 'List card programs.', + stainlessPath: '(resource) card_programs > (method) list', + qualified: 'client.cardPrograms.list', + params: ['ending_before?: string;', 'page_size?: number;', 'starting_after?: string;'], + response: + '{ token: string; account_level_management_enabled: boolean; created: string; name: string; pan_range_end: string; pan_range_start: string; cardholder_currency?: string; settlement_currencies?: string[]; }', + markdown: + "## list\n\n`client.cardPrograms.list(ending_before?: string, page_size?: number, starting_after?: string): { token: string; account_level_management_enabled: boolean; created: string; name: string; pan_range_end: string; pan_range_start: string; cardholder_currency?: string; settlement_currencies?: string[]; }`\n\n**get** `/v1/card_programs`\n\nList card programs.\n\n### Parameters\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; account_level_management_enabled: boolean; created: string; name: string; pan_range_end: string; pan_range_start: string; cardholder_currency?: string; settlement_currencies?: string[]; }`\n\n - `token: string`\n - `account_level_management_enabled: boolean`\n - `created: string`\n - `name: string`\n - `pan_range_end: string`\n - `pan_range_start: string`\n - `cardholder_currency?: string`\n - `settlement_currencies?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const cardProgram of client.cardPrograms.list()) {\n console.log(cardProgram);\n}\n```", + perLanguage: { + typescript: { + method: 'client.cardPrograms.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const cardProgram of client.cardPrograms.list()) {\n console.log(cardProgram.token);\n}", + }, + python: { + method: 'card_programs.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.card_programs.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'cardPrograms().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardProgramListPage;\nimport com.lithic.api.models.CardProgramListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardProgramListPage page = client.cardPrograms().list();\n }\n}', + }, + kotlin: { + method: 'cardPrograms().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardProgramListPage\nimport com.lithic.api.models.CardProgramListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: CardProgramListPage = client.cardPrograms().list()\n}', + }, + go: { + method: 'client.CardPrograms.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.CardPrograms.List(context.TODO(), lithic.CardProgramListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'card_programs.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.card_programs.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/card_programs \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/card_programs/{card_program_token}', + httpMethod: 'get', + summary: 'Get card program', + description: 'Get card program.', + stainlessPath: '(resource) card_programs > (method) retrieve', + qualified: 'client.cardPrograms.retrieve', + params: ['card_program_token: string;'], + response: + '{ token: string; account_level_management_enabled: boolean; created: string; name: string; pan_range_end: string; pan_range_start: string; cardholder_currency?: string; settlement_currencies?: string[]; }', + markdown: + "## retrieve\n\n`client.cardPrograms.retrieve(card_program_token: string): { token: string; account_level_management_enabled: boolean; created: string; name: string; pan_range_end: string; pan_range_start: string; cardholder_currency?: string; settlement_currencies?: string[]; }`\n\n**get** `/v1/card_programs/{card_program_token}`\n\nGet card program.\n\n### Parameters\n\n- `card_program_token: string`\n\n### Returns\n\n- `{ token: string; account_level_management_enabled: boolean; created: string; name: string; pan_range_end: string; pan_range_start: string; cardholder_currency?: string; settlement_currencies?: string[]; }`\n\n - `token: string`\n - `account_level_management_enabled: boolean`\n - `created: string`\n - `name: string`\n - `pan_range_end: string`\n - `pan_range_start: string`\n - `cardholder_currency?: string`\n - `settlement_currencies?: string[]`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst cardProgram = await client.cardPrograms.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(cardProgram);\n```", + perLanguage: { + typescript: { + method: 'client.cardPrograms.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst cardProgram = await client.cardPrograms.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(cardProgram.token);", + }, + python: { + method: 'card_programs.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ncard_program = client.card_programs.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(card_program.token)', + }, + java: { + method: 'cardPrograms().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CardProgram;\nimport com.lithic.api.models.CardProgramRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CardProgram cardProgram = client.cardPrograms().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'cardPrograms().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CardProgram\nimport com.lithic.api.models.CardProgramRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val cardProgram: CardProgram = client.cardPrograms().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.CardPrograms.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tcardProgram, err := client.CardPrograms.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", cardProgram.Token)\n}\n', + }, + ruby: { + method: 'card_programs.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ncard_program = lithic.card_programs.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(card_program)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/card_programs/$CARD_PROGRAM_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/digital_card_art', + httpMethod: 'get', + summary: 'List digital card art', + description: 'List digital card art.', + stainlessPath: '(resource) digital_card_art > (method) list', + qualified: 'client.digitalCardArt.list', + params: ['ending_before?: string;', 'page_size?: number;', 'starting_after?: string;'], + response: + "{ token: string; card_program_token: string; created: string; description: string; is_enabled: boolean; network: 'MASTERCARD' | 'VISA'; is_card_program_default?: boolean; }", + markdown: + "## list\n\n`client.digitalCardArt.list(ending_before?: string, page_size?: number, starting_after?: string): { token: string; card_program_token: string; created: string; description: string; is_enabled: boolean; network: 'MASTERCARD' | 'VISA'; is_card_program_default?: boolean; }`\n\n**get** `/v1/digital_card_art`\n\nList digital card art.\n\n### Parameters\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; card_program_token: string; created: string; description: string; is_enabled: boolean; network: 'MASTERCARD' | 'VISA'; is_card_program_default?: boolean; }`\n\n - `token: string`\n - `card_program_token: string`\n - `created: string`\n - `description: string`\n - `is_enabled: boolean`\n - `network: 'MASTERCARD' | 'VISA'`\n - `is_card_program_default?: boolean`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const digitalCardArt of client.digitalCardArt.list()) {\n console.log(digitalCardArt);\n}\n```", + perLanguage: { + typescript: { + method: 'client.digitalCardArt.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const digitalCardArt of client.digitalCardArt.list()) {\n console.log(digitalCardArt.token);\n}", + }, + python: { + method: 'digital_card_art.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.digital_card_art.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'digitalCardArt().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DigitalCardArtListPage;\nimport com.lithic.api.models.DigitalCardArtListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DigitalCardArtListPage page = client.digitalCardArt().list();\n }\n}', + }, + kotlin: { + method: 'digitalCardArt().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DigitalCardArtListPage\nimport com.lithic.api.models.DigitalCardArtListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: DigitalCardArtListPage = client.digitalCardArt().list()\n}', + }, + go: { + method: 'client.DigitalCardArt.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.DigitalCardArt.List(context.TODO(), lithic.DigitalCardArtListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'digital_card_art.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.digital_card_art.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/digital_card_art \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/digital_card_art/{digital_card_art_token}', + httpMethod: 'get', + summary: 'Get digital card art by token', + description: 'Get digital card art by token.', + stainlessPath: '(resource) digital_card_art > (method) retrieve', + qualified: 'client.digitalCardArt.retrieve', + params: ['digital_card_art_token: string;'], + response: + "{ token: string; card_program_token: string; created: string; description: string; is_enabled: boolean; network: 'MASTERCARD' | 'VISA'; is_card_program_default?: boolean; }", + markdown: + "## retrieve\n\n`client.digitalCardArt.retrieve(digital_card_art_token: string): { token: string; card_program_token: string; created: string; description: string; is_enabled: boolean; network: 'MASTERCARD' | 'VISA'; is_card_program_default?: boolean; }`\n\n**get** `/v1/digital_card_art/{digital_card_art_token}`\n\nGet digital card art by token.\n\n### Parameters\n\n- `digital_card_art_token: string`\n\n### Returns\n\n- `{ token: string; card_program_token: string; created: string; description: string; is_enabled: boolean; network: 'MASTERCARD' | 'VISA'; is_card_program_default?: boolean; }`\n\n - `token: string`\n - `card_program_token: string`\n - `created: string`\n - `description: string`\n - `is_enabled: boolean`\n - `network: 'MASTERCARD' | 'VISA'`\n - `is_card_program_default?: boolean`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst digitalCardArt = await client.digitalCardArt.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(digitalCardArt);\n```", + perLanguage: { + typescript: { + method: 'client.digitalCardArt.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst digitalCardArt = await client.digitalCardArt.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(digitalCardArt.token);", + }, + python: { + method: 'digital_card_art.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ndigital_card_art = client.digital_card_art.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(digital_card_art.token)', + }, + java: { + method: 'digitalCardArt().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.DigitalCardArt;\nimport com.lithic.api.models.DigitalCardArtRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n DigitalCardArt digitalCardArt = client.digitalCardArt().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'digitalCardArt().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.DigitalCardArt\nimport com.lithic.api.models.DigitalCardArtRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val digitalCardArt: DigitalCardArt = client.digitalCardArt().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.DigitalCardArt.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tdigitalCardArt, err := client.DigitalCardArt.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", digitalCardArt.Token)\n}\n', + }, + ruby: { + method: 'digital_card_art.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ndigital_card_art = lithic.digital_card_art.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(digital_card_art)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/digital_card_art/$DIGITAL_CARD_ART_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/book_transfers', + httpMethod: 'get', + summary: 'List book transfers', + description: 'List book transfers', + stainlessPath: '(resource) book_transfers > (method) list', + qualified: 'client.bookTransfers.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'business_account_token?: string;', + 'category?: string;', + 'end?: string;', + 'ending_before?: string;', + 'financial_account_token?: string;', + 'page_size?: number;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'DECLINED' | 'SETTLED';", + ], + response: + "{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }", + markdown: + "## list\n\n`client.bookTransfers.list(account_token?: string, begin?: string, business_account_token?: string, category?: string, end?: string, ending_before?: string, financial_account_token?: string, page_size?: number, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'DECLINED' | 'SETTLED'): { token: string; category: string; created: string; currency: string; events: object[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: external_resource; transaction_series?: object; }`\n\n**get** `/v1/book_transfers`\n\nList book transfers\n\n### Parameters\n\n- `account_token?: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `business_account_token?: string`\n\n- `category?: string`\n Book Transfer category to be returned.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `financial_account_token?: string`\n Globally unique identifier for the financial account or card that will send the funds. Accepted type dependent on the program's use case.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `result?: 'APPROVED' | 'DECLINED'`\n Book transfer result to be returned.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'DECLINED' | 'SETTLED'`\n Book transfer status to be returned.\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }`\n Book transfer transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `currency: string`\n - `events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]`\n - `family: 'TRANSFER'`\n - `from_financial_account_token: string`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `to_financial_account_token: string`\n - `updated: string`\n - `external_id?: string`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const bookTransferResponse of client.bookTransfers.list()) {\n console.log(bookTransferResponse);\n}\n```", + perLanguage: { + typescript: { + method: 'client.bookTransfers.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const bookTransferResponse of client.bookTransfers.list()) {\n console.log(bookTransferResponse.external_id);\n}", + }, + python: { + method: 'book_transfers.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.book_transfers.list()\npage = page.data[0]\nprint(page.external_id)', + }, + java: { + method: 'bookTransfers().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.BookTransferListPage;\nimport com.lithic.api.models.BookTransferListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BookTransferListPage page = client.bookTransfers().list();\n }\n}', + }, + kotlin: { + method: 'bookTransfers().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.BookTransferListPage\nimport com.lithic.api.models.BookTransferListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: BookTransferListPage = client.bookTransfers().list()\n}', + }, + go: { + method: 'client.BookTransfers.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.BookTransfers.List(context.TODO(), lithic.BookTransferListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'book_transfers.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.book_transfers.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/book_transfers \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/book_transfers', + httpMethod: 'post', + summary: 'Create book transfer', + description: 'Book transfer funds between two financial accounts or between a financial account and card', + stainlessPath: '(resource) book_transfers > (method) create', + qualified: 'client.bookTransfers.create', + params: [ + 'amount: number;', + 'category: string;', + 'from_financial_account_token: string;', + 'subtype: string;', + 'to_financial_account_token: string;', + 'type: string;', + 'token?: string;', + 'external_id?: string;', + 'hold_token?: string;', + 'memo?: string;', + "on_closed_account?: 'FAIL' | 'USE_SUSPENSE';", + ], + response: + "{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }", + markdown: + "## create\n\n`client.bookTransfers.create(amount: number, category: string, from_financial_account_token: string, subtype: string, to_financial_account_token: string, type: string, token?: string, external_id?: string, hold_token?: string, memo?: string, on_closed_account?: 'FAIL' | 'USE_SUSPENSE'): { token: string; category: string; created: string; currency: string; events: object[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: external_resource; transaction_series?: object; }`\n\n**post** `/v1/book_transfers`\n\nBook transfer funds between two financial accounts or between a financial account and card\n\n### Parameters\n\n- `amount: number`\n Amount to be transferred in the currency's smallest unit (e.g., cents for USD). This should always be a positive value.\n\n- `category: string`\n\n- `from_financial_account_token: string`\n Globally unique identifier for the financial account or card that will send the funds. Accepted type dependent on the program's use case.\n\n- `subtype: string`\n The program specific subtype code for the specified category/type.\n\n- `to_financial_account_token: string`\n Globally unique identifier for the financial account or card that will receive the funds. Accepted type dependent on the program's use case.\n\n- `type: string`\n Type of the book transfer\n\n- `token?: string`\n Customer-provided token that will serve as an idempotency token. This token will become the transaction token.\n\n- `external_id?: string`\n External ID defined by the customer\n\n- `hold_token?: string`\n Token of an existing hold to settle when this transfer is initiated\n\n- `memo?: string`\n Optional descriptor for the transfer.\n\n- `on_closed_account?: 'FAIL' | 'USE_SUSPENSE'`\n What to do if the financial account is closed when posting an operation\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }`\n Book transfer transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `currency: string`\n - `events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]`\n - `family: 'TRANSFER'`\n - `from_financial_account_token: string`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `to_financial_account_token: string`\n - `updated: string`\n - `external_id?: string`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst bookTransferResponse = await client.bookTransfers.create({\n amount: 1,\n category: 'ADJUSTMENT',\n from_financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n subtype: 'subtype',\n to_financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n type: 'ATM_BALANCE_INQUIRY',\n});\n\nconsole.log(bookTransferResponse);\n```", + perLanguage: { + typescript: { + method: 'client.bookTransfers.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst bookTransferResponse = await client.bookTransfers.create({\n amount: 1,\n category: 'ADJUSTMENT',\n from_financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n subtype: 'subtype',\n to_financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n type: 'ATM_BALANCE_INQUIRY',\n});\n\nconsole.log(bookTransferResponse.external_id);", + }, + python: { + method: 'book_transfers.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nbook_transfer_response = client.book_transfers.create(\n amount=1,\n category="ADJUSTMENT",\n from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n subtype="subtype",\n to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n type="ATM_BALANCE_INQUIRY",\n)\nprint(book_transfer_response.external_id)', + }, + java: { + method: 'bookTransfers().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.BookTransferCreateParams;\nimport com.lithic.api.models.BookTransferResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BookTransferCreateParams params = BookTransferCreateParams.builder()\n .amount(1L)\n .category(BookTransferCreateParams.BookTransferCategory.ADJUSTMENT)\n .fromFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .subtype("subtype")\n .toFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .type(BookTransferCreateParams.BookTransferType.ATM_BALANCE_INQUIRY)\n .build();\n BookTransferResponse bookTransferResponse = client.bookTransfers().create(params);\n }\n}', + }, + kotlin: { + method: 'bookTransfers().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.BookTransferCreateParams\nimport com.lithic.api.models.BookTransferResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: BookTransferCreateParams = BookTransferCreateParams.builder()\n .amount(1L)\n .category(BookTransferCreateParams.BookTransferCategory.ADJUSTMENT)\n .fromFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .subtype("subtype")\n .toFinancialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .type(BookTransferCreateParams.BookTransferType.ATM_BALANCE_INQUIRY)\n .build()\n val bookTransferResponse: BookTransferResponse = client.bookTransfers().create(params)\n}', + }, + go: { + method: 'client.BookTransfers.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tbookTransferResponse, err := client.BookTransfers.New(context.TODO(), lithic.BookTransferNewParams{\n\t\tAmount: lithic.F(int64(1)),\n\t\tCategory: lithic.F(lithic.BookTransferNewParamsCategoryAdjustment),\n\t\tFromFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tSubtype: lithic.F("subtype"),\n\t\tToFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tType: lithic.F(lithic.BookTransferNewParamsTypeAtmBalanceInquiry),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", bookTransferResponse.ExternalID)\n}\n', + }, + ruby: { + method: 'book_transfers.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nbook_transfer_response = lithic.book_transfers.create(\n amount: 1,\n category: :ADJUSTMENT,\n from_financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n subtype: "subtype",\n to_financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n type: :ATM_BALANCE_INQUIRY\n)\n\nputs(book_transfer_response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/book_transfers \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 1,\n "category": "ADJUSTMENT",\n "from_financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "subtype": "subtype",\n "to_financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "type": "ATM_BALANCE_INQUIRY"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/book_transfers/{book_transfer_token}', + httpMethod: 'get', + summary: 'Get book transfer by token', + description: 'Get book transfer by token', + stainlessPath: '(resource) book_transfers > (method) retrieve', + qualified: 'client.bookTransfers.retrieve', + params: ['book_transfer_token: string;'], + response: + "{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }", + markdown: + "## retrieve\n\n`client.bookTransfers.retrieve(book_transfer_token: string): { token: string; category: string; created: string; currency: string; events: object[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: external_resource; transaction_series?: object; }`\n\n**get** `/v1/book_transfers/{book_transfer_token}`\n\nGet book transfer by token\n\n### Parameters\n\n- `book_transfer_token: string`\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }`\n Book transfer transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `currency: string`\n - `events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]`\n - `family: 'TRANSFER'`\n - `from_financial_account_token: string`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `to_financial_account_token: string`\n - `updated: string`\n - `external_id?: string`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst bookTransferResponse = await client.bookTransfers.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(bookTransferResponse);\n```", + perLanguage: { + typescript: { + method: 'client.bookTransfers.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst bookTransferResponse = await client.bookTransfers.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(bookTransferResponse.external_id);", + }, + python: { + method: 'book_transfers.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nbook_transfer_response = client.book_transfers.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(book_transfer_response.external_id)', + }, + java: { + method: 'bookTransfers().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.BookTransferResponse;\nimport com.lithic.api.models.BookTransferRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BookTransferResponse bookTransferResponse = client.bookTransfers().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'bookTransfers().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.BookTransferResponse\nimport com.lithic.api.models.BookTransferRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val bookTransferResponse: BookTransferResponse = client.bookTransfers().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.BookTransfers.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tbookTransferResponse, err := client.BookTransfers.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", bookTransferResponse.ExternalID)\n}\n', + }, + ruby: { + method: 'book_transfers.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nbook_transfer_response = lithic.book_transfers.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(book_transfer_response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/book_transfers/$BOOK_TRANSFER_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'reverse', + endpoint: '/v1/book_transfers/{book_transfer_token}/reverse', + httpMethod: 'post', + summary: 'Reverse book transfer', + description: 'Reverse a book transfer', + stainlessPath: '(resource) book_transfers > (method) reverse', + qualified: 'client.bookTransfers.reverse', + params: ['book_transfer_token: string;', 'memo?: string;'], + response: + "{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }", + markdown: + "## reverse\n\n`client.bookTransfers.reverse(book_transfer_token: string, memo?: string): { token: string; category: string; created: string; currency: string; events: object[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: external_resource; transaction_series?: object; }`\n\n**post** `/v1/book_transfers/{book_transfer_token}/reverse`\n\nReverse a book transfer\n\n### Parameters\n\n- `book_transfer_token: string`\n\n- `memo?: string`\n Optional descriptor for the reversal.\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }`\n Book transfer transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `currency: string`\n - `events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]`\n - `family: 'TRANSFER'`\n - `from_financial_account_token: string`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `to_financial_account_token: string`\n - `updated: string`\n - `external_id?: string`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst bookTransferResponse = await client.bookTransfers.reverse('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(bookTransferResponse);\n```", + perLanguage: { + typescript: { + method: 'client.bookTransfers.reverse', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst bookTransferResponse = await client.bookTransfers.reverse(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(bookTransferResponse.external_id);", + }, + python: { + method: 'book_transfers.reverse', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nbook_transfer_response = client.book_transfers.reverse(\n book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(book_transfer_response.external_id)', + }, + java: { + method: 'bookTransfers().reverse', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.BookTransferResponse;\nimport com.lithic.api.models.BookTransferReverseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BookTransferResponse bookTransferResponse = client.bookTransfers().reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'bookTransfers().reverse', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.BookTransferResponse\nimport com.lithic.api.models.BookTransferReverseParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val bookTransferResponse: BookTransferResponse = client.bookTransfers().reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.BookTransfers.Reverse', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tbookTransferResponse, err := client.BookTransfers.Reverse(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.BookTransferReverseParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", bookTransferResponse.ExternalID)\n}\n', + }, + ruby: { + method: 'book_transfers.reverse', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nbook_transfer_response = lithic.book_transfers.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(book_transfer_response)', + }, + http: { + example: + "curl https://api.lithic.com/v1/book_transfers/$BOOK_TRANSFER_TOKEN/reverse \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'retry', + endpoint: '/v1/book_transfers/{book_transfer_token}/retry', + httpMethod: 'post', + summary: 'Retry book transfer', + description: 'Retry a book transfer that has been declined', + stainlessPath: '(resource) book_transfers > (method) retry', + qualified: 'client.bookTransfers.retry', + params: ['book_transfer_token: string;', 'retry_token: string;'], + response: + "{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }", + markdown: + "## retry\n\n`client.bookTransfers.retry(book_transfer_token: string, retry_token: string): { token: string; category: string; created: string; currency: string; events: object[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: external_resource; transaction_series?: object; }`\n\n**post** `/v1/book_transfers/{book_transfer_token}/retry`\n\nRetry a book transfer that has been declined\n\n### Parameters\n\n- `book_transfer_token: string`\n\n- `retry_token: string`\n Customer-provided token that will serve as an idempotency token. This token will become the transaction token.\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; }`\n Book transfer transaction\n\n - `token: string`\n - `category: string`\n - `created: string`\n - `currency: string`\n - `events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]`\n - `family: 'TRANSFER'`\n - `from_financial_account_token: string`\n - `pending_amount: number`\n - `result: 'APPROVED' | 'DECLINED'`\n - `settled_amount: number`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `to_financial_account_token: string`\n - `updated: string`\n - `external_id?: string`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst bookTransferResponse = await client.bookTransfers.retry('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { retry_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });\n\nconsole.log(bookTransferResponse);\n```", + perLanguage: { + typescript: { + method: 'client.bookTransfers.retry', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst bookTransferResponse = await client.bookTransfers.retry(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { retry_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },\n);\n\nconsole.log(bookTransferResponse.external_id);", + }, + python: { + method: 'book_transfers.retry', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nbook_transfer_response = client.book_transfers.retry(\n book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(book_transfer_response.external_id)', + }, + java: { + method: 'bookTransfers().retry', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.BookTransferResponse;\nimport com.lithic.api.models.BookTransferRetryParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n BookTransferRetryParams params = BookTransferRetryParams.builder()\n .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n BookTransferResponse bookTransferResponse = client.bookTransfers().retry(params);\n }\n}', + }, + kotlin: { + method: 'bookTransfers().retry', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.BookTransferResponse\nimport com.lithic.api.models.BookTransferRetryParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: BookTransferRetryParams = BookTransferRetryParams.builder()\n .bookTransferToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .retryToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val bookTransferResponse: BookTransferResponse = client.bookTransfers().retry(params)\n}', + }, + go: { + method: 'client.BookTransfers.Retry', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tbookTransferResponse, err := client.BookTransfers.Retry(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.BookTransferRetryParams{\n\t\t\tRetryToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", bookTransferResponse.ExternalID)\n}\n', + }, + ruby: { + method: 'book_transfers.retry_', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nbook_transfer_response = lithic.book_transfers.retry_(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n retry_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(book_transfer_response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/book_transfers/$BOOK_TRANSFER_TOKEN/retry \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "retry_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/credit_products/{credit_product_token}/extended_credit', + httpMethod: 'get', + summary: 'Get extended credit', + description: 'Get the extended credit for a given credit product under a program', + stainlessPath: '(resource) credit_products.extended_credit > (method) retrieve', + qualified: 'client.creditProducts.extendedCredit.retrieve', + params: ['credit_product_token: string;'], + response: '{ credit_extended: number; }', + markdown: + "## retrieve\n\n`client.creditProducts.extendedCredit.retrieve(credit_product_token: string): { credit_extended: number; }`\n\n**get** `/v1/credit_products/{credit_product_token}/extended_credit`\n\nGet the extended credit for a given credit product under a program\n\n### Parameters\n\n- `credit_product_token: string`\n\n### Returns\n\n- `{ credit_extended: number; }`\n\n - `credit_extended: number`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst extendedCredit = await client.creditProducts.extendedCredit.retrieve('credit_product_token');\n\nconsole.log(extendedCredit);\n```", + perLanguage: { + typescript: { + method: 'client.creditProducts.extendedCredit.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst extendedCredit = await client.creditProducts.extendedCredit.retrieve('credit_product_token');\n\nconsole.log(extendedCredit.credit_extended);", + }, + python: { + method: 'credit_products.extended_credit.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nextended_credit = client.credit_products.extended_credit.retrieve(\n "credit_product_token",\n)\nprint(extended_credit.credit_extended)', + }, + java: { + method: 'creditProducts().extendedCredit().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CreditProductExtendedCreditRetrieveParams;\nimport com.lithic.api.models.ExtendedCredit;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExtendedCredit extendedCredit = client.creditProducts().extendedCredit().retrieve("credit_product_token");\n }\n}', + }, + kotlin: { + method: 'creditProducts().extendedCredit().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CreditProductExtendedCreditRetrieveParams\nimport com.lithic.api.models.ExtendedCredit\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val extendedCredit: ExtendedCredit = client.creditProducts().extendedCredit().retrieve("credit_product_token")\n}', + }, + go: { + method: 'client.CreditProducts.ExtendedCredit.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\textendedCredit, err := client.CreditProducts.ExtendedCredit.Get(context.TODO(), "credit_product_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", extendedCredit.CreditExtended)\n}\n', + }, + ruby: { + method: 'credit_products.extended_credit.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nextended_credit = lithic.credit_products.extended_credit.retrieve("credit_product_token")\n\nputs(extended_credit)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/credit_products/$CREDIT_PRODUCT_TOKEN/extended_credit \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/credit_products/{credit_product_token}/prime_rates', + httpMethod: 'get', + summary: 'Get Credit Product Prime Rates', + description: 'Get Credit Product Prime Rates', + stainlessPath: '(resource) credit_products.prime_rates > (method) retrieve', + qualified: 'client.creditProducts.primeRates.retrieve', + params: ['credit_product_token: string;', 'ending_before?: string;', 'starting_after?: string;'], + response: '{ data: { effective_date: string; rate: string; }[]; has_more: boolean; }', + markdown: + "## retrieve\n\n`client.creditProducts.primeRates.retrieve(credit_product_token: string, ending_before?: string, starting_after?: string): { data: object[]; has_more: boolean; }`\n\n**get** `/v1/credit_products/{credit_product_token}/prime_rates`\n\nGet Credit Product Prime Rates\n\n### Parameters\n\n- `credit_product_token: string`\n Globally unique identifier for credit products.\n\n- `ending_before?: string`\n The effective date that the prime rates ends before\n\n- `starting_after?: string`\n The effective date that the prime rate starts after\n\n### Returns\n\n- `{ data: { effective_date: string; rate: string; }[]; has_more: boolean; }`\n\n - `data: { effective_date: string; rate: string; }[]`\n - `has_more: boolean`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst primeRate = await client.creditProducts.primeRates.retrieve('credit_product_token');\n\nconsole.log(primeRate);\n```", + perLanguage: { + typescript: { + method: 'client.creditProducts.primeRates.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst primeRate = await client.creditProducts.primeRates.retrieve('credit_product_token');\n\nconsole.log(primeRate.data);", + }, + python: { + method: 'credit_products.prime_rates.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nprime_rate = client.credit_products.prime_rates.retrieve(\n credit_product_token="credit_product_token",\n)\nprint(prime_rate.data)', + }, + java: { + method: 'creditProducts().primeRates().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CreditProductPrimeRateRetrieveParams;\nimport com.lithic.api.models.PrimeRateRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n PrimeRateRetrieveResponse primeRate = client.creditProducts().primeRates().retrieve("credit_product_token");\n }\n}', + }, + kotlin: { + method: 'creditProducts().primeRates().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CreditProductPrimeRateRetrieveParams\nimport com.lithic.api.models.PrimeRateRetrieveResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val primeRate: PrimeRateRetrieveResponse = client.creditProducts().primeRates().retrieve("credit_product_token")\n}', + }, + go: { + method: 'client.CreditProducts.PrimeRates.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tprimeRate, err := client.CreditProducts.PrimeRates.Get(\n\t\tcontext.TODO(),\n\t\t"credit_product_token",\n\t\tlithic.CreditProductPrimeRateGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", primeRate.Data)\n}\n', + }, + ruby: { + method: 'credit_products.prime_rates.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nprime_rate = lithic.credit_products.prime_rates.retrieve("credit_product_token")\n\nputs(prime_rate)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/credit_products/$CREDIT_PRODUCT_TOKEN/prime_rates \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/credit_products/{credit_product_token}/prime_rates', + httpMethod: 'post', + summary: 'Post Credit Product Prime Rate', + description: 'Post Credit Product Prime Rate', + stainlessPath: '(resource) credit_products.prime_rates > (method) create', + qualified: 'client.creditProducts.primeRates.create', + params: ['credit_product_token: string;', 'effective_date: string;', 'rate: string;'], + markdown: + "## create\n\n`client.creditProducts.primeRates.create(credit_product_token: string, effective_date: string, rate: string): void`\n\n**post** `/v1/credit_products/{credit_product_token}/prime_rates`\n\nPost Credit Product Prime Rate\n\n### Parameters\n\n- `credit_product_token: string`\n Globally unique identifier for credit products.\n\n- `effective_date: string`\n Date the rate goes into effect\n\n- `rate: string`\n The rate in decimal format\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nawait client.creditProducts.primeRates.create('credit_product_token', { effective_date: '2019-12-27', rate: 'rate' })\n```", + perLanguage: { + typescript: { + method: 'client.creditProducts.primeRates.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.creditProducts.primeRates.create('credit_product_token', {\n effective_date: '2019-12-27',\n rate: 'rate',\n});", + }, + python: { + method: 'credit_products.prime_rates.create', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.credit_products.prime_rates.create(\n credit_product_token="credit_product_token",\n effective_date=date.fromisoformat("2019-12-27"),\n rate="rate",\n)', + }, + java: { + method: 'creditProducts().primeRates().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.CreditProductPrimeRateCreateParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n CreditProductPrimeRateCreateParams params = CreditProductPrimeRateCreateParams.builder()\n .creditProductToken("credit_product_token")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .rate("rate")\n .build();\n client.creditProducts().primeRates().create(params);\n }\n}', + }, + kotlin: { + method: 'creditProducts().primeRates().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.CreditProductPrimeRateCreateParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: CreditProductPrimeRateCreateParams = CreditProductPrimeRateCreateParams.builder()\n .creditProductToken("credit_product_token")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .rate("rate")\n .build()\n client.creditProducts().primeRates().create(params)\n}', + }, + go: { + method: 'client.CreditProducts.PrimeRates.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.CreditProducts.PrimeRates.New(\n\t\tcontext.TODO(),\n\t\t"credit_product_token",\n\t\tlithic.CreditProductPrimeRateNewParams{\n\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t\tRate: lithic.F("rate"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'credit_products.prime_rates.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.credit_products.prime_rates.create(\n "credit_product_token",\n effective_date: "2019-12-27",\n rate: "rate"\n)\n\nputs(result)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/credit_products/$CREDIT_PRODUCT_TOKEN/prime_rates \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "effective_date": "2019-12-27",\n "rate": "rate"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/external_payments', + httpMethod: 'get', + summary: 'List external payments', + description: 'List external payments', + stainlessPath: '(resource) external_payments > (method) list', + qualified: 'client.externalPayments.list', + params: [ + 'begin?: string;', + 'business_account_token?: string;', + 'category?: string;', + 'end?: string;', + 'ending_before?: string;', + 'financial_account_token?: string;', + 'page_size?: number;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED';", + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## list\n\n`client.externalPayments.list(begin?: string, business_account_token?: string, category?: string, end?: string, ending_before?: string, financial_account_token?: string, page_size?: number, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**get** `/v1/external_payments`\n\nList external payments\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `business_account_token?: string`\n\n- `category?: string`\n The external rail the funds moved on\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `financial_account_token?: string`\n Globally unique identifier for the financial account or card that will send the funds. Accepted type dependent on the program's use case.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `result?: 'APPROVED' | 'DECLINED'`\n External Payment result to be returned.\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n Book transfer status to be returned.\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const externalPayment of client.externalPayments.list()) {\n console.log(externalPayment);\n}\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const externalPayment of client.externalPayments.list()) {\n console.log(externalPayment.user_defined_id);\n}", + }, + python: { + method: 'external_payments.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.external_payments.list()\npage = page.data[0]\nprint(page.user_defined_id)', + }, + java: { + method: 'externalPayments().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPaymentListPage;\nimport com.lithic.api.models.ExternalPaymentListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPaymentListPage page = client.externalPayments().list();\n }\n}', + }, + kotlin: { + method: 'externalPayments().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPaymentListPage\nimport com.lithic.api.models.ExternalPaymentListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: ExternalPaymentListPage = client.externalPayments().list()\n}', + }, + go: { + method: 'client.ExternalPayments.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.ExternalPayments.List(context.TODO(), lithic.ExternalPaymentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'external_payments.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.external_payments.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/external_payments', + httpMethod: 'post', + summary: 'Create external payment', + description: 'Create external payment', + stainlessPath: '(resource) external_payments > (method) create', + qualified: 'client.externalPayments.create', + params: [ + 'amount: number;', + 'category: string;', + 'effective_date: string;', + 'financial_account_token: string;', + "payment_type: 'DEPOSIT' | 'WITHDRAWAL';", + 'token?: string;', + 'memo?: string;', + "progress_to?: 'SETTLED' | 'RELEASED';", + 'user_defined_id?: string;', + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## create\n\n`client.externalPayments.create(amount: number, category: string, effective_date: string, financial_account_token: string, payment_type: 'DEPOSIT' | 'WITHDRAWAL', token?: string, memo?: string, progress_to?: 'SETTLED' | 'RELEASED', user_defined_id?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**post** `/v1/external_payments`\n\nCreate external payment\n\n### Parameters\n\n- `amount: number`\n\n- `category: string`\n\n- `effective_date: string`\n\n- `financial_account_token: string`\n\n- `payment_type: 'DEPOSIT' | 'WITHDRAWAL'`\n\n- `token?: string`\n Customer-provided token that will serve as an idempotency token. This token will become the transaction token.\n\n- `memo?: string`\n\n- `progress_to?: 'SETTLED' | 'RELEASED'`\n\n- `user_defined_id?: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalPayment = await client.externalPayments.create({\n amount: 0,\n category: 'EXTERNAL_WIRE',\n effective_date: '2019-12-27',\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n payment_type: 'DEPOSIT',\n});\n\nconsole.log(externalPayment);\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalPayment = await client.externalPayments.create({\n amount: 0,\n category: 'EXTERNAL_WIRE',\n effective_date: '2019-12-27',\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n payment_type: 'DEPOSIT',\n});\n\nconsole.log(externalPayment.user_defined_id);", + }, + python: { + method: 'external_payments.create', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_payment = client.external_payments.create(\n amount=0,\n category="EXTERNAL_WIRE",\n effective_date=date.fromisoformat("2019-12-27"),\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n payment_type="DEPOSIT",\n)\nprint(external_payment.user_defined_id)', + }, + java: { + method: 'externalPayments().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPayment;\nimport com.lithic.api.models.ExternalPaymentCreateParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPaymentCreateParams params = ExternalPaymentCreateParams.builder()\n .amount(0L)\n .category(ExternalPaymentCreateParams.ExternalPaymentCategory.EXTERNAL_WIRE)\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .paymentType(ExternalPaymentCreateParams.ExternalPaymentDirection.DEPOSIT)\n .build();\n ExternalPayment externalPayment = client.externalPayments().create(params);\n }\n}', + }, + kotlin: { + method: 'externalPayments().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPayment\nimport com.lithic.api.models.ExternalPaymentCreateParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalPaymentCreateParams = ExternalPaymentCreateParams.builder()\n .amount(0L)\n .category(ExternalPaymentCreateParams.ExternalPaymentCategory.EXTERNAL_WIRE)\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .paymentType(ExternalPaymentCreateParams.ExternalPaymentDirection.DEPOSIT)\n .build()\n val externalPayment: ExternalPayment = client.externalPayments().create(params)\n}', + }, + go: { + method: 'client.ExternalPayments.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalPayment, err := client.ExternalPayments.New(context.TODO(), lithic.ExternalPaymentNewParams{\n\t\tAmount: lithic.F(int64(0)),\n\t\tCategory: lithic.F(lithic.ExternalPaymentNewParamsCategoryExternalWire),\n\t\tEffectiveDate: lithic.F(time.Now()),\n\t\tFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tPaymentType: lithic.F(lithic.ExternalPaymentNewParamsPaymentTypeDeposit),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalPayment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'external_payments.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_payment = lithic.external_payments.create(\n amount: 0,\n category: :EXTERNAL_WIRE,\n effective_date: "2019-12-27",\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n payment_type: :DEPOSIT\n)\n\nputs(external_payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 0,\n "category": "EXTERNAL_WIRE",\n "effective_date": "2019-12-27",\n "financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n "payment_type": "DEPOSIT"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/external_payments/{external_payment_token}', + httpMethod: 'get', + summary: 'Get external payment', + description: 'Get external payment', + stainlessPath: '(resource) external_payments > (method) retrieve', + qualified: 'client.externalPayments.retrieve', + params: ['external_payment_token: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## retrieve\n\n`client.externalPayments.retrieve(external_payment_token: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**get** `/v1/external_payments/{external_payment_token}`\n\nGet external payment\n\n### Parameters\n\n- `external_payment_token: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalPayment = await client.externalPayments.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(externalPayment);\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalPayment = await client.externalPayments.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(externalPayment.user_defined_id);", + }, + python: { + method: 'external_payments.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_payment = client.external_payments.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(external_payment.user_defined_id)', + }, + java: { + method: 'externalPayments().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPayment;\nimport com.lithic.api.models.ExternalPaymentRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPayment externalPayment = client.externalPayments().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'externalPayments().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPayment\nimport com.lithic.api.models.ExternalPaymentRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val externalPayment: ExternalPayment = client.externalPayments().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ExternalPayments.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalPayment, err := client.ExternalPayments.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalPayment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'external_payments.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_payment = lithic.external_payments.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(external_payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments/$EXTERNAL_PAYMENT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'settle', + endpoint: '/v1/external_payments/{external_payment_token}/settle', + httpMethod: 'post', + summary: 'Settle external payment', + description: 'Settle external payment', + stainlessPath: '(resource) external_payments > (method) settle', + qualified: 'client.externalPayments.settle', + params: [ + 'external_payment_token: string;', + 'effective_date: string;', + 'memo?: string;', + "progress_to?: 'SETTLED' | 'RELEASED';", + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## settle\n\n`client.externalPayments.settle(external_payment_token: string, effective_date: string, memo?: string, progress_to?: 'SETTLED' | 'RELEASED'): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**post** `/v1/external_payments/{external_payment_token}/settle`\n\nSettle external payment\n\n### Parameters\n\n- `external_payment_token: string`\n\n- `effective_date: string`\n\n- `memo?: string`\n\n- `progress_to?: 'SETTLED' | 'RELEASED'`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalPayment = await client.externalPayments.settle('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { effective_date: '2019-12-27' });\n\nconsole.log(externalPayment);\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.settle', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalPayment = await client.externalPayments.settle(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { effective_date: '2019-12-27' },\n);\n\nconsole.log(externalPayment.user_defined_id);", + }, + python: { + method: 'external_payments.settle', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_payment = client.external_payments.settle(\n external_payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n effective_date=date.fromisoformat("2019-12-27"),\n)\nprint(external_payment.user_defined_id)', + }, + java: { + method: 'externalPayments().settle', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPayment;\nimport com.lithic.api.models.ExternalPaymentSettleParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPaymentSettleParams params = ExternalPaymentSettleParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n ExternalPayment externalPayment = client.externalPayments().settle(params);\n }\n}', + }, + kotlin: { + method: 'externalPayments().settle', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPayment\nimport com.lithic.api.models.ExternalPaymentSettleParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalPaymentSettleParams = ExternalPaymentSettleParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val externalPayment: ExternalPayment = client.externalPayments().settle(params)\n}', + }, + go: { + method: 'client.ExternalPayments.Settle', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalPayment, err := client.ExternalPayments.Settle(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalPaymentSettleParams{\n\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalPayment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'external_payments.settle', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_payment = lithic.external_payments.settle("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27")\n\nputs(external_payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments/$EXTERNAL_PAYMENT_TOKEN/settle \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "effective_date": "2019-12-27"\n }\'', + }, + }, + }, + { + name: 'release', + endpoint: '/v1/external_payments/{external_payment_token}/release', + httpMethod: 'post', + summary: 'Release external payment', + description: 'Release external payment', + stainlessPath: '(resource) external_payments > (method) release', + qualified: 'client.externalPayments.release', + params: ['external_payment_token: string;', 'effective_date: string;', 'memo?: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## release\n\n`client.externalPayments.release(external_payment_token: string, effective_date: string, memo?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**post** `/v1/external_payments/{external_payment_token}/release`\n\nRelease external payment\n\n### Parameters\n\n- `external_payment_token: string`\n\n- `effective_date: string`\n\n- `memo?: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalPayment = await client.externalPayments.release('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { effective_date: '2019-12-27' });\n\nconsole.log(externalPayment);\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.release', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalPayment = await client.externalPayments.release(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { effective_date: '2019-12-27' },\n);\n\nconsole.log(externalPayment.user_defined_id);", + }, + python: { + method: 'external_payments.release', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_payment = client.external_payments.release(\n external_payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n effective_date=date.fromisoformat("2019-12-27"),\n)\nprint(external_payment.user_defined_id)', + }, + java: { + method: 'externalPayments().release', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPayment;\nimport com.lithic.api.models.ExternalPaymentReleaseParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPaymentReleaseParams params = ExternalPaymentReleaseParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n ExternalPayment externalPayment = client.externalPayments().release(params);\n }\n}', + }, + kotlin: { + method: 'externalPayments().release', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPayment\nimport com.lithic.api.models.ExternalPaymentReleaseParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalPaymentReleaseParams = ExternalPaymentReleaseParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val externalPayment: ExternalPayment = client.externalPayments().release(params)\n}', + }, + go: { + method: 'client.ExternalPayments.Release', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalPayment, err := client.ExternalPayments.Release(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalPaymentReleaseParams{\n\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalPayment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'external_payments.release', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_payment = lithic.external_payments.release("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27")\n\nputs(external_payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments/$EXTERNAL_PAYMENT_TOKEN/release \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "effective_date": "2019-12-27"\n }\'', + }, + }, + }, + { + name: 'cancel', + endpoint: '/v1/external_payments/{external_payment_token}/cancel', + httpMethod: 'post', + summary: 'Cancel external payment', + description: 'Cancel external payment', + stainlessPath: '(resource) external_payments > (method) cancel', + qualified: 'client.externalPayments.cancel', + params: ['external_payment_token: string;', 'effective_date: string;', 'memo?: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## cancel\n\n`client.externalPayments.cancel(external_payment_token: string, effective_date: string, memo?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**post** `/v1/external_payments/{external_payment_token}/cancel`\n\nCancel external payment\n\n### Parameters\n\n- `external_payment_token: string`\n\n- `effective_date: string`\n\n- `memo?: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalPayment = await client.externalPayments.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { effective_date: '2019-12-27' });\n\nconsole.log(externalPayment);\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.cancel', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalPayment = await client.externalPayments.cancel(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { effective_date: '2019-12-27' },\n);\n\nconsole.log(externalPayment.user_defined_id);", + }, + python: { + method: 'external_payments.cancel', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_payment = client.external_payments.cancel(\n external_payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n effective_date=date.fromisoformat("2019-12-27"),\n)\nprint(external_payment.user_defined_id)', + }, + java: { + method: 'externalPayments().cancel', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPayment;\nimport com.lithic.api.models.ExternalPaymentCancelParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPaymentCancelParams params = ExternalPaymentCancelParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n ExternalPayment externalPayment = client.externalPayments().cancel(params);\n }\n}', + }, + kotlin: { + method: 'externalPayments().cancel', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPayment\nimport com.lithic.api.models.ExternalPaymentCancelParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalPaymentCancelParams = ExternalPaymentCancelParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val externalPayment: ExternalPayment = client.externalPayments().cancel(params)\n}', + }, + go: { + method: 'client.ExternalPayments.Cancel', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalPayment, err := client.ExternalPayments.Cancel(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalPaymentCancelParams{\n\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalPayment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'external_payments.cancel', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_payment = lithic.external_payments.cancel("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27")\n\nputs(external_payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments/$EXTERNAL_PAYMENT_TOKEN/cancel \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "effective_date": "2019-12-27"\n }\'', + }, + }, + }, + { + name: 'reverse', + endpoint: '/v1/external_payments/{external_payment_token}/reverse', + httpMethod: 'post', + summary: 'Reverse external payment', + description: 'Reverse external payment', + stainlessPath: '(resource) external_payments > (method) reverse', + qualified: 'client.externalPayments.reverse', + params: ['external_payment_token: string;', 'effective_date: string;', 'memo?: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }", + markdown: + "## reverse\n\n`client.externalPayments.reverse(external_payment_token: string, effective_date: string, memo?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: object[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n**post** `/v1/external_payments/{external_payment_token}/reverse`\n\nReverse external payment\n\n### Parameters\n\n- `external_payment_token: string`\n\n- `effective_date: string`\n\n- `memo?: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]`\n - `family?: 'EXTERNAL_PAYMENT'`\n - `financial_account_token?: string`\n - `payment_type?: 'DEPOSIT' | 'WITHDRAWAL'`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst externalPayment = await client.externalPayments.reverse('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { effective_date: '2019-12-27' });\n\nconsole.log(externalPayment);\n```", + perLanguage: { + typescript: { + method: 'client.externalPayments.reverse', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst externalPayment = await client.externalPayments.reverse(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { effective_date: '2019-12-27' },\n);\n\nconsole.log(externalPayment.user_defined_id);", + }, + python: { + method: 'external_payments.reverse', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nexternal_payment = client.external_payments.reverse(\n external_payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n effective_date=date.fromisoformat("2019-12-27"),\n)\nprint(external_payment.user_defined_id)', + }, + java: { + method: 'externalPayments().reverse', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ExternalPayment;\nimport com.lithic.api.models.ExternalPaymentReverseParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ExternalPaymentReverseParams params = ExternalPaymentReverseParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n ExternalPayment externalPayment = client.externalPayments().reverse(params);\n }\n}', + }, + kotlin: { + method: 'externalPayments().reverse', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ExternalPayment\nimport com.lithic.api.models.ExternalPaymentReverseParams\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ExternalPaymentReverseParams = ExternalPaymentReverseParams.builder()\n .externalPaymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val externalPayment: ExternalPayment = client.externalPayments().reverse(params)\n}', + }, + go: { + method: 'client.ExternalPayments.Reverse', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\texternalPayment, err := client.ExternalPayments.Reverse(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ExternalPaymentReverseParams{\n\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalPayment.UserDefinedID)\n}\n', + }, + ruby: { + method: 'external_payments.reverse', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nexternal_payment = lithic.external_payments.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27")\n\nputs(external_payment)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/external_payments/$EXTERNAL_PAYMENT_TOKEN/reverse \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "effective_date": "2019-12-27"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/management_operations', + httpMethod: 'get', + summary: 'List management operations', + description: 'List management operations', + stainlessPath: '(resource) management_operations > (method) list', + qualified: 'client.managementOperations.list', + params: [ + 'begin?: string;', + 'business_account_token?: string;', + 'category?: string;', + 'end?: string;', + 'ending_before?: string;', + 'financial_account_token?: string;', + 'page_size?: number;', + 'starting_after?: string;', + "status?: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED';", + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }", + markdown: + "## list\n\n`client.managementOperations.list(begin?: string, business_account_token?: string, category?: string, end?: string, ending_before?: string, financial_account_token?: string, page_size?: number, starting_after?: string, status?: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: object[]; external_resource?: external_resource; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: object; user_defined_id?: string; }`\n\n**get** `/v1/management_operations`\n\nList management operations\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `business_account_token?: string`\n\n- `category?: string`\n Management operation category to be returned.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `financial_account_token?: string`\n Globally unique identifier for the financial account. Accepted type dependent on the program's use case.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n Management operation status to be returned.\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `direction?: 'CREDIT' | 'DEBIT'`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `family?: 'MANAGEMENT_OPERATION'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const managementOperationTransaction of client.managementOperations.list()) {\n console.log(managementOperationTransaction);\n}\n```", + perLanguage: { + typescript: { + method: 'client.managementOperations.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const managementOperationTransaction of client.managementOperations.list()) {\n console.log(managementOperationTransaction.user_defined_id);\n}", + }, + python: { + method: 'management_operations.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.management_operations.list()\npage = page.data[0]\nprint(page.user_defined_id)', + }, + java: { + method: 'managementOperations().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ManagementOperationListPage;\nimport com.lithic.api.models.ManagementOperationListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ManagementOperationListPage page = client.managementOperations().list();\n }\n}', + }, + kotlin: { + method: 'managementOperations().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ManagementOperationListPage\nimport com.lithic.api.models.ManagementOperationListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: ManagementOperationListPage = client.managementOperations().list()\n}', + }, + go: { + method: 'client.ManagementOperations.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.ManagementOperations.List(context.TODO(), lithic.ManagementOperationListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'management_operations.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.management_operations.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/management_operations \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/management_operations', + httpMethod: 'post', + summary: 'Create management operation', + description: 'Create management operation', + stainlessPath: '(resource) management_operations > (method) create', + qualified: 'client.managementOperations.create', + params: [ + 'amount: number;', + 'category: string;', + "direction: 'CREDIT' | 'DEBIT';", + 'effective_date: string;', + 'event_type: string;', + 'financial_account_token: string;', + 'token?: string;', + 'memo?: string;', + "on_closed_account?: 'FAIL' | 'USE_SUSPENSE';", + 'subtype?: string;', + 'user_defined_id?: string;', + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }", + markdown: + "## create\n\n`client.managementOperations.create(amount: number, category: string, direction: 'CREDIT' | 'DEBIT', effective_date: string, event_type: string, financial_account_token: string, token?: string, memo?: string, on_closed_account?: 'FAIL' | 'USE_SUSPENSE', subtype?: string, user_defined_id?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: object[]; external_resource?: external_resource; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: object; user_defined_id?: string; }`\n\n**post** `/v1/management_operations`\n\nCreate management operation\n\n### Parameters\n\n- `amount: number`\n\n- `category: string`\n\n- `direction: 'CREDIT' | 'DEBIT'`\n\n- `effective_date: string`\n\n- `event_type: string`\n\n- `financial_account_token: string`\n\n- `token?: string`\n Customer-provided token that will serve as an idempotency token. This token will become the transaction token.\n\n- `memo?: string`\n\n- `on_closed_account?: 'FAIL' | 'USE_SUSPENSE'`\n What to do if the financial account is closed when posting an operation\n\n- `subtype?: string`\n\n- `user_defined_id?: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `direction?: 'CREDIT' | 'DEBIT'`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `family?: 'MANAGEMENT_OPERATION'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst managementOperationTransaction = await client.managementOperations.create({\n amount: 1,\n category: 'MANAGEMENT_FEE',\n direction: 'CREDIT',\n effective_date: '2019-12-27',\n event_type: 'LOSS_WRITE_OFF',\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(managementOperationTransaction);\n```", + perLanguage: { + typescript: { + method: 'client.managementOperations.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst managementOperationTransaction = await client.managementOperations.create({\n amount: 1,\n category: 'MANAGEMENT_FEE',\n direction: 'CREDIT',\n effective_date: '2019-12-27',\n event_type: 'LOSS_WRITE_OFF',\n financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n});\n\nconsole.log(managementOperationTransaction.user_defined_id);", + }, + python: { + method: 'management_operations.create', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nmanagement_operation_transaction = client.management_operations.create(\n amount=1,\n category="MANAGEMENT_FEE",\n direction="CREDIT",\n effective_date=date.fromisoformat("2019-12-27"),\n event_type="LOSS_WRITE_OFF",\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(management_operation_transaction.user_defined_id)', + }, + java: { + method: 'managementOperations().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ManagementOperationCreateParams;\nimport com.lithic.api.models.ManagementOperationTransaction;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ManagementOperationCreateParams params = ManagementOperationCreateParams.builder()\n .amount(1L)\n .category(ManagementOperationCreateParams.ManagementOperationCategory.MANAGEMENT_FEE)\n .direction(ManagementOperationCreateParams.ManagementOperationDirection.CREDIT)\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .eventType(ManagementOperationCreateParams.ManagementOperationEventType.LOSS_WRITE_OFF)\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build();\n ManagementOperationTransaction managementOperationTransaction = client.managementOperations().create(params);\n }\n}', + }, + kotlin: { + method: 'managementOperations().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ManagementOperationCreateParams\nimport com.lithic.api.models.ManagementOperationTransaction\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ManagementOperationCreateParams = ManagementOperationCreateParams.builder()\n .amount(1L)\n .category(ManagementOperationCreateParams.ManagementOperationCategory.MANAGEMENT_FEE)\n .direction(ManagementOperationCreateParams.ManagementOperationDirection.CREDIT)\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .eventType(ManagementOperationCreateParams.ManagementOperationEventType.LOSS_WRITE_OFF)\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build()\n val managementOperationTransaction: ManagementOperationTransaction = client.managementOperations().create(params)\n}', + }, + go: { + method: 'client.ManagementOperations.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tmanagementOperationTransaction, err := client.ManagementOperations.New(context.TODO(), lithic.ManagementOperationNewParams{\n\t\tAmount: lithic.F(int64(1)),\n\t\tCategory: lithic.F(lithic.ManagementOperationNewParamsCategoryManagementFee),\n\t\tDirection: lithic.F(lithic.ManagementOperationNewParamsDirectionCredit),\n\t\tEffectiveDate: lithic.F(time.Now()),\n\t\tEventType: lithic.F(lithic.ManagementOperationNewParamsEventTypeLossWriteOff),\n\t\tFinancialAccountToken: lithic.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", managementOperationTransaction.UserDefinedID)\n}\n', + }, + ruby: { + method: 'management_operations.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nmanagement_operation_transaction = lithic.management_operations.create(\n amount: 1,\n category: :MANAGEMENT_FEE,\n direction: :CREDIT,\n effective_date: "2019-12-27",\n event_type: :LOSS_WRITE_OFF,\n financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n)\n\nputs(management_operation_transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/management_operations \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 1,\n "category": "MANAGEMENT_FEE",\n "direction": "CREDIT",\n "effective_date": "2019-12-27",\n "event_type": "LOSS_WRITE_OFF",\n "financial_account_token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/management_operations/{management_operation_token}', + httpMethod: 'get', + summary: 'Get management operation', + description: 'Get management operation', + stainlessPath: '(resource) management_operations > (method) retrieve', + qualified: 'client.managementOperations.retrieve', + params: ['management_operation_token: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }", + markdown: + "## retrieve\n\n`client.managementOperations.retrieve(management_operation_token: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: object[]; external_resource?: external_resource; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: object; user_defined_id?: string; }`\n\n**get** `/v1/management_operations/{management_operation_token}`\n\nGet management operation\n\n### Parameters\n\n- `management_operation_token: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `direction?: 'CREDIT' | 'DEBIT'`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `family?: 'MANAGEMENT_OPERATION'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst managementOperationTransaction = await client.managementOperations.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(managementOperationTransaction);\n```", + perLanguage: { + typescript: { + method: 'client.managementOperations.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst managementOperationTransaction = await client.managementOperations.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(managementOperationTransaction.user_defined_id);", + }, + python: { + method: 'management_operations.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nmanagement_operation_transaction = client.management_operations.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(management_operation_transaction.user_defined_id)', + }, + java: { + method: 'managementOperations().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ManagementOperationRetrieveParams;\nimport com.lithic.api.models.ManagementOperationTransaction;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ManagementOperationTransaction managementOperationTransaction = client.managementOperations().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'managementOperations().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ManagementOperationRetrieveParams\nimport com.lithic.api.models.ManagementOperationTransaction\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val managementOperationTransaction: ManagementOperationTransaction = client.managementOperations().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.ManagementOperations.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tmanagementOperationTransaction, err := client.ManagementOperations.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", managementOperationTransaction.UserDefinedID)\n}\n', + }, + ruby: { + method: 'management_operations.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nmanagement_operation_transaction = lithic.management_operations.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(management_operation_transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/management_operations/$MANAGEMENT_OPERATION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'reverse', + endpoint: '/v1/management_operations/{management_operation_token}/reverse', + httpMethod: 'post', + summary: 'Reverse management operation', + description: 'Reverse a management operation', + stainlessPath: '(resource) management_operations > (method) reverse', + qualified: 'client.managementOperations.reverse', + params: ['management_operation_token: string;', 'effective_date: string;', 'memo?: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }", + markdown: + "## reverse\n\n`client.managementOperations.reverse(management_operation_token: string, effective_date: string, memo?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: object[]; external_resource?: external_resource; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: object; user_defined_id?: string; }`\n\n**post** `/v1/management_operations/{management_operation_token}/reverse`\n\nReverse a management operation\n\n### Parameters\n\n- `management_operation_token: string`\n\n- `effective_date: string`\n\n- `memo?: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: { external_resource_token: string; external_resource_type: external_resource_type; external_resource_sub_token?: string; }; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; }`\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `category?: string`\n - `currency?: string`\n - `direction?: 'CREDIT' | 'DEBIT'`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]`\n - `external_resource?: { external_resource_token: string; external_resource_type: 'STATEMENT' | 'COLLECTION' | 'DISPUTE' | 'UNKNOWN'; external_resource_sub_token?: string; }`\n - `family?: 'MANAGEMENT_OPERATION'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `settled_amount?: number`\n - `transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst managementOperationTransaction = await client.managementOperations.reverse('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { effective_date: '2019-12-27' });\n\nconsole.log(managementOperationTransaction);\n```", + perLanguage: { + typescript: { + method: 'client.managementOperations.reverse', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst managementOperationTransaction = await client.managementOperations.reverse(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n { effective_date: '2019-12-27' },\n);\n\nconsole.log(managementOperationTransaction.user_defined_id);", + }, + python: { + method: 'management_operations.reverse', + example: + 'import os\nfrom datetime import date\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nmanagement_operation_transaction = client.management_operations.reverse(\n management_operation_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n effective_date=date.fromisoformat("2019-12-27"),\n)\nprint(management_operation_transaction.user_defined_id)', + }, + java: { + method: 'managementOperations().reverse', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.ManagementOperationReverseParams;\nimport com.lithic.api.models.ManagementOperationTransaction;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n ManagementOperationReverseParams params = ManagementOperationReverseParams.builder()\n .managementOperationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build();\n ManagementOperationTransaction managementOperationTransaction = client.managementOperations().reverse(params);\n }\n}', + }, + kotlin: { + method: 'managementOperations().reverse', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.ManagementOperationReverseParams\nimport com.lithic.api.models.ManagementOperationTransaction\nimport java.time.LocalDate\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: ManagementOperationReverseParams = ManagementOperationReverseParams.builder()\n .managementOperationToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .effectiveDate(LocalDate.parse("2019-12-27"))\n .build()\n val managementOperationTransaction: ManagementOperationTransaction = client.managementOperations().reverse(params)\n}', + }, + go: { + method: 'client.ManagementOperations.Reverse', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tmanagementOperationTransaction, err := client.ManagementOperations.Reverse(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.ManagementOperationReverseParams{\n\t\t\tEffectiveDate: lithic.F(time.Now()),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", managementOperationTransaction.UserDefinedID)\n}\n', + }, + ruby: { + method: 'management_operations.reverse', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nmanagement_operation_transaction = lithic.management_operations.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27")\n\nputs(management_operation_transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/management_operations/$MANAGEMENT_OPERATION_TOKEN/reverse \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "effective_date": "2019-12-27"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/funding_events', + httpMethod: 'get', + summary: 'List funding events', + description: 'Get all funding events for program', + stainlessPath: '(resource) funding_events > (method) list', + qualified: 'client.fundingEvents.list', + params: ['ending_before?: string;', 'page_size?: number;', 'starting_after?: string;'], + response: + "{ token: string; collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'; collection_tokens: string[]; created: string; high_watermark: string; network_settlement_summary: { network_settlement_date: string; settled_gross_amount: number; }[]; previous_high_watermark: string; updated: string; }", + markdown: + "## list\n\n`client.fundingEvents.list(ending_before?: string, page_size?: number, starting_after?: string): { token: string; collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'; collection_tokens: string[]; created: string; high_watermark: string; network_settlement_summary: object[]; previous_high_watermark: string; updated: string; }`\n\n**get** `/v1/funding_events`\n\nGet all funding events for program\n\n### Parameters\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n### Returns\n\n- `{ token: string; collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'; collection_tokens: string[]; created: string; high_watermark: string; network_settlement_summary: { network_settlement_date: string; settled_gross_amount: number; }[]; previous_high_watermark: string; updated: string; }`\n\n - `token: string`\n - `collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'`\n - `collection_tokens: string[]`\n - `created: string`\n - `high_watermark: string`\n - `network_settlement_summary: { network_settlement_date: string; settled_gross_amount: number; }[]`\n - `previous_high_watermark: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const fundingEvent of client.fundingEvents.list()) {\n console.log(fundingEvent);\n}\n```", + perLanguage: { + typescript: { + method: 'client.fundingEvents.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fundingEvent of client.fundingEvents.list()) {\n console.log(fundingEvent.token);\n}", + }, + python: { + method: 'funding_events.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.funding_events.list()\npage = page.data[0]\nprint(page.token)', + }, + java: { + method: 'fundingEvents().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FundingEventListPage;\nimport com.lithic.api.models.FundingEventListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FundingEventListPage page = client.fundingEvents().list();\n }\n}', + }, + kotlin: { + method: 'fundingEvents().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FundingEventListPage\nimport com.lithic.api.models.FundingEventListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: FundingEventListPage = client.fundingEvents().list()\n}', + }, + go: { + method: 'client.FundingEvents.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.FundingEvents.List(context.TODO(), lithic.FundingEventListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'funding_events.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.funding_events.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/funding_events \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/funding_events/{funding_event_token}', + httpMethod: 'get', + summary: 'Get funding event by ID', + description: 'Get funding event for program by id', + stainlessPath: '(resource) funding_events > (method) retrieve', + qualified: 'client.fundingEvents.retrieve', + params: ['funding_event_token: string;'], + response: + "{ token: string; collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'; collection_tokens: string[]; created: string; high_watermark: string; network_settlement_summary: { network_settlement_date: string; settled_gross_amount: number; }[]; previous_high_watermark: string; updated: string; }", + markdown: + "## retrieve\n\n`client.fundingEvents.retrieve(funding_event_token: string): { token: string; collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'; collection_tokens: string[]; created: string; high_watermark: string; network_settlement_summary: object[]; previous_high_watermark: string; updated: string; }`\n\n**get** `/v1/funding_events/{funding_event_token}`\n\nGet funding event for program by id\n\n### Parameters\n\n- `funding_event_token: string`\n\n### Returns\n\n- `{ token: string; collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'; collection_tokens: string[]; created: string; high_watermark: string; network_settlement_summary: { network_settlement_date: string; settled_gross_amount: number; }[]; previous_high_watermark: string; updated: string; }`\n\n - `token: string`\n - `collection_resource_type: 'BOOK_TRANSFER' | 'PAYMENT'`\n - `collection_tokens: string[]`\n - `created: string`\n - `high_watermark: string`\n - `network_settlement_summary: { network_settlement_date: string; settled_gross_amount: number; }[]`\n - `previous_high_watermark: string`\n - `updated: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst fundingEvent = await client.fundingEvents.retrieve('funding_event_token');\n\nconsole.log(fundingEvent);\n```", + perLanguage: { + typescript: { + method: 'client.fundingEvents.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst fundingEvent = await client.fundingEvents.retrieve('funding_event_token');\n\nconsole.log(fundingEvent.token);", + }, + python: { + method: 'funding_events.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nfunding_event = client.funding_events.retrieve(\n "funding_event_token",\n)\nprint(funding_event.token)', + }, + java: { + method: 'fundingEvents().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FundingEvent;\nimport com.lithic.api.models.FundingEventRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FundingEvent fundingEvent = client.fundingEvents().retrieve("funding_event_token");\n }\n}', + }, + kotlin: { + method: 'fundingEvents().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FundingEvent\nimport com.lithic.api.models.FundingEventRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val fundingEvent: FundingEvent = client.fundingEvents().retrieve("funding_event_token")\n}', + }, + go: { + method: 'client.FundingEvents.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tfundingEvent, err := client.FundingEvents.Get(context.TODO(), "funding_event_token")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", fundingEvent.Token)\n}\n', + }, + ruby: { + method: 'funding_events.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nfunding_event = lithic.funding_events.retrieve("funding_event_token")\n\nputs(funding_event)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/funding_events/$FUNDING_EVENT_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_details', + endpoint: '/v1/funding_events/{funding_event_token}/details', + httpMethod: 'get', + summary: 'Get funding event details', + description: 'Get funding event details by id', + stainlessPath: '(resource) funding_events > (method) retrieve_details', + qualified: 'client.fundingEvents.retrieveDetails', + params: ['funding_event_token: string;'], + response: '{ token: string; settlement_details_url: string; settlement_summary_url: string; }', + markdown: + "## retrieve_details\n\n`client.fundingEvents.retrieveDetails(funding_event_token: string): { token: string; settlement_details_url: string; settlement_summary_url: string; }`\n\n**get** `/v1/funding_events/{funding_event_token}/details`\n\nGet funding event details by id\n\n### Parameters\n\n- `funding_event_token: string`\n\n### Returns\n\n- `{ token: string; settlement_details_url: string; settlement_summary_url: string; }`\n\n - `token: string`\n - `settlement_details_url: string`\n - `settlement_summary_url: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.fundingEvents.retrieveDetails('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.fundingEvents.retrieveDetails', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fundingEvents.retrieveDetails('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response.token);", + }, + python: { + method: 'funding_events.retrieve_details', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.funding_events.retrieve_details(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response.token)', + }, + java: { + method: 'fundingEvents().retrieveDetails', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FundingEventRetrieveDetailsParams;\nimport com.lithic.api.models.FundingEventRetrieveDetailsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FundingEventRetrieveDetailsResponse response = client.fundingEvents().retrieveDetails("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'fundingEvents().retrieveDetails', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FundingEventRetrieveDetailsParams\nimport com.lithic.api.models.FundingEventRetrieveDetailsResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: FundingEventRetrieveDetailsResponse = client.fundingEvents().retrieveDetails("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.FundingEvents.GetDetails', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.FundingEvents.GetDetails(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Token)\n}\n', + }, + ruby: { + method: 'funding_events.retrieve_details', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.funding_events.retrieve_details("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/funding_events/$FUNDING_EVENT_TOKEN/details \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/fraud/transactions/{transaction_token}', + httpMethod: 'get', + summary: 'Get a fraud report for a transaction', + description: + 'Retrieve a fraud report for a specific transaction identified by its unique transaction token.\n', + stainlessPath: '(resource) fraud.transactions > (method) retrieve', + qualified: 'client.fraud.transactions.retrieve', + params: ['transaction_token: string;'], + response: + "{ fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'; transaction_token: string; comment?: string; created_at?: string; fraud_type?: string; updated_at?: string; }", + markdown: + "## retrieve\n\n`client.fraud.transactions.retrieve(transaction_token: string): { fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'; transaction_token: string; comment?: string; created_at?: string; fraud_type?: string; updated_at?: string; }`\n\n**get** `/v1/fraud/transactions/{transaction_token}`\n\nRetrieve a fraud report for a specific transaction identified by its unique transaction token.\n\n\n### Parameters\n\n- `transaction_token: string`\n\n### Returns\n\n- `{ fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'; transaction_token: string; comment?: string; created_at?: string; fraud_type?: string; updated_at?: string; }`\n\n - `fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'`\n - `transaction_token: string`\n - `comment?: string`\n - `created_at?: string`\n - `fraud_type?: string`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst transaction = await client.fraud.transactions.retrieve('00000000-0000-0000-0000-000000000000');\n\nconsole.log(transaction);\n```", + perLanguage: { + typescript: { + method: 'client.fraud.transactions.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst transaction = await client.fraud.transactions.retrieve(\n '00000000-0000-0000-0000-000000000000',\n);\n\nconsole.log(transaction.fraud_status);", + }, + python: { + method: 'fraud.transactions.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\ntransaction = client.fraud.transactions.retrieve(\n "00000000-0000-0000-0000-000000000000",\n)\nprint(transaction.fraud_status)', + }, + java: { + method: 'fraud().transactions().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FraudTransactionRetrieveParams;\nimport com.lithic.api.models.TransactionRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransactionRetrieveResponse transaction = client.fraud().transactions().retrieve("00000000-0000-0000-0000-000000000000");\n }\n}', + }, + kotlin: { + method: 'fraud().transactions().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FraudTransactionRetrieveParams\nimport com.lithic.api.models.TransactionRetrieveResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val transaction: TransactionRetrieveResponse = client.fraud().transactions().retrieve("00000000-0000-0000-0000-000000000000")\n}', + }, + go: { + method: 'client.Fraud.Transactions.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\ttransaction, err := client.Fraud.Transactions.Get(context.TODO(), "00000000-0000-0000-0000-000000000000")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", transaction.FraudStatus)\n}\n', + }, + ruby: { + method: 'fraud.transactions.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\ntransaction = lithic.fraud.transactions.retrieve("00000000-0000-0000-0000-000000000000")\n\nputs(transaction)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/fraud/transactions/$TRANSACTION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'report', + endpoint: '/v1/fraud/transactions/{transaction_token}', + httpMethod: 'post', + summary: 'Create or update a fraud report for a transaction', + description: + 'Report fraud for a specific transaction token by providing details such as fraud type, fraud status, and any additional comments.\n', + stainlessPath: '(resource) fraud.transactions > (method) report', + qualified: 'client.fraud.transactions.report', + params: [ + 'transaction_token: string;', + "fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT';", + 'comment?: string;', + 'fraud_type?: string;', + ], + response: + "{ fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'; transaction_token: string; comment?: string; created_at?: string; fraud_type?: string; updated_at?: string; }", + markdown: + "## report\n\n`client.fraud.transactions.report(transaction_token: string, fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT', comment?: string, fraud_type?: string): { fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'; transaction_token: string; comment?: string; created_at?: string; fraud_type?: string; updated_at?: string; }`\n\n**post** `/v1/fraud/transactions/{transaction_token}`\n\nReport fraud for a specific transaction token by providing details such as fraud type, fraud status, and any additional comments.\n\n\n### Parameters\n\n- `transaction_token: string`\n\n- `fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT'`\n The fraud status of the transaction, string (enum) supporting the following values:\n\n - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this hasn’t been confirmed.\n - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may immediately be moved into this state, or be graduated into this state from the `SUSPECTED_FRAUD` state.\n - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A transaction may immediately be moved into this state, or be graduated into this state from the `SUSPECTED_FRAUD` state.\n\n- `comment?: string`\n Optional field providing additional information or context about why the transaction is considered fraudulent.\n\n- `fraud_type?: string`\n Specifies the type or category of fraud that the transaction is suspected or confirmed to involve, string (enum) supporting the following values:\n\n - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or cardholder intentionally misuses financial services for personal gain. This includes actions such as disputing legitimate transactions to obtain a refund, abusing return policies, or defaulting on credit obligations without intent to repay.\n - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains unauthorized access to an existing account, modifies account settings, and carries out fraudulent transactions.\n - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains access to card details without taking over the account, such as through physical card theft, cloning, or online data breaches.\n - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen personal information, such as Social Security numbers or addresses, to open accounts, apply for loans, or conduct financial transactions in someone's name.\n - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster manipulates or coerces a legitimate cardholder into unauthorized transactions, often through social engineering tactics.\n\n### Returns\n\n- `{ fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'; transaction_token: string; comment?: string; created_at?: string; fraud_type?: string; updated_at?: string; }`\n\n - `fraud_status: 'SUSPECTED_FRAUD' | 'FRAUDULENT' | 'NOT_FRAUDULENT' | 'NO_REPORTED_FRAUD'`\n - `transaction_token: string`\n - `comment?: string`\n - `created_at?: string`\n - `fraud_type?: string`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.fraud.transactions.report('00000000-0000-0000-0000-000000000000', { fraud_status: 'SUSPECTED_FRAUD' });\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.fraud.transactions.report', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fraud.transactions.report('00000000-0000-0000-0000-000000000000', {\n fraud_status: 'SUSPECTED_FRAUD',\n});\n\nconsole.log(response.fraud_status);", + }, + python: { + method: 'fraud.transactions.report', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.fraud.transactions.report(\n transaction_token="00000000-0000-0000-0000-000000000000",\n fraud_status="SUSPECTED_FRAUD",\n)\nprint(response.fraud_status)', + }, + java: { + method: 'fraud().transactions().report', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.FraudTransactionReportParams;\nimport com.lithic.api.models.TransactionReportResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n FraudTransactionReportParams params = FraudTransactionReportParams.builder()\n .transactionToken("00000000-0000-0000-0000-000000000000")\n .fraudStatus(FraudTransactionReportParams.FraudStatus.SUSPECTED_FRAUD)\n .build();\n TransactionReportResponse response = client.fraud().transactions().report(params);\n }\n}', + }, + kotlin: { + method: 'fraud().transactions().report', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.FraudTransactionReportParams\nimport com.lithic.api.models.TransactionReportResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: FraudTransactionReportParams = FraudTransactionReportParams.builder()\n .transactionToken("00000000-0000-0000-0000-000000000000")\n .fraudStatus(FraudTransactionReportParams.FraudStatus.SUSPECTED_FRAUD)\n .build()\n val response: TransactionReportResponse = client.fraud().transactions().report(params)\n}', + }, + go: { + method: 'client.Fraud.Transactions.Report', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.Fraud.Transactions.Report(\n\t\tcontext.TODO(),\n\t\t"00000000-0000-0000-0000-000000000000",\n\t\tlithic.FraudTransactionReportParams{\n\t\t\tFraudStatus: lithic.F(lithic.FraudTransactionReportParamsFraudStatusSuspectedFraud),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.FraudStatus)\n}\n', + }, + ruby: { + method: 'fraud.transactions.report', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.fraud.transactions.report("00000000-0000-0000-0000-000000000000", fraud_status: :SUSPECTED_FRAUD)\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/fraud/transactions/$TRANSACTION_TOKEN \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "fraud_status": "SUSPECTED_FRAUD"\n }\'', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/network_programs', + httpMethod: 'get', + summary: 'List network programs', + description: 'List network programs.', + stainlessPath: '(resource) network_programs > (method) list', + qualified: 'client.networkPrograms.list', + params: ['begin?: string;', 'end?: string;', 'page_size?: number;'], + response: + '{ token: string; default_product_code: string; name: string; registered_program_identification_number: string; }', + markdown: + "## list\n\n`client.networkPrograms.list(begin?: string, end?: string, page_size?: number): { token: string; default_product_code: string; name: string; registered_program_identification_number: string; }`\n\n**get** `/v1/network_programs`\n\nList network programs.\n\n### Parameters\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `page_size?: number`\n Page size (for pagination).\n\n### Returns\n\n- `{ token: string; default_product_code: string; name: string; registered_program_identification_number: string; }`\n\n - `token: string`\n - `default_product_code: string`\n - `name: string`\n - `registered_program_identification_number: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const networkProgram of client.networkPrograms.list()) {\n console.log(networkProgram);\n}\n```", + perLanguage: { + typescript: { + method: 'client.networkPrograms.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const networkProgram of client.networkPrograms.list()) {\n console.log(networkProgram.registered_program_identification_number);\n}", + }, + python: { + method: 'network_programs.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.network_programs.list()\npage = page.data[0]\nprint(page.registered_program_identification_number)', + }, + java: { + method: 'networkPrograms().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.NetworkProgramListPage;\nimport com.lithic.api.models.NetworkProgramListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n NetworkProgramListPage page = client.networkPrograms().list();\n }\n}', + }, + kotlin: { + method: 'networkPrograms().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.NetworkProgramListPage\nimport com.lithic.api.models.NetworkProgramListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: NetworkProgramListPage = client.networkPrograms().list()\n}', + }, + go: { + method: 'client.NetworkPrograms.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.NetworkPrograms.List(context.TODO(), lithic.NetworkProgramListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'network_programs.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.network_programs.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/network_programs \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/network_programs/{network_program_token}', + httpMethod: 'get', + summary: 'Get network program', + description: 'Get network program.', + stainlessPath: '(resource) network_programs > (method) retrieve', + qualified: 'client.networkPrograms.retrieve', + params: ['network_program_token: string;'], + response: + '{ token: string; default_product_code: string; name: string; registered_program_identification_number: string; }', + markdown: + "## retrieve\n\n`client.networkPrograms.retrieve(network_program_token: string): { token: string; default_product_code: string; name: string; registered_program_identification_number: string; }`\n\n**get** `/v1/network_programs/{network_program_token}`\n\nGet network program.\n\n### Parameters\n\n- `network_program_token: string`\n\n### Returns\n\n- `{ token: string; default_product_code: string; name: string; registered_program_identification_number: string; }`\n\n - `token: string`\n - `default_product_code: string`\n - `name: string`\n - `registered_program_identification_number: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst networkProgram = await client.networkPrograms.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(networkProgram);\n```", + perLanguage: { + typescript: { + method: 'client.networkPrograms.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst networkProgram = await client.networkPrograms.retrieve(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(networkProgram.registered_program_identification_number);", + }, + python: { + method: 'network_programs.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nnetwork_program = client.network_programs.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(network_program.registered_program_identification_number)', + }, + java: { + method: 'networkPrograms().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.NetworkProgram;\nimport com.lithic.api.models.NetworkProgramRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n NetworkProgram networkProgram = client.networkPrograms().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'networkPrograms().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.NetworkProgram\nimport com.lithic.api.models.NetworkProgramRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val networkProgram: NetworkProgram = client.networkPrograms().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.NetworkPrograms.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tnetworkProgram, err := client.NetworkPrograms.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", networkProgram.RegisteredProgramIdentificationNumber)\n}\n', + }, + ruby: { + method: 'network_programs.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nnetwork_program = lithic.network_programs.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(network_program)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/network_programs/$NETWORK_PROGRAM_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/financial_accounts/{financial_account_token}/holds', + httpMethod: 'get', + summary: 'List holds', + description: 'List holds for a financial account.', + stainlessPath: '(resource) holds > (method) list', + qualified: 'client.holds.list', + params: [ + 'financial_account_token: string;', + 'begin?: string;', + 'end?: string;', + 'ending_before?: string;', + 'page_size?: number;', + 'starting_after?: string;', + "status?: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED';", + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }", + markdown: + "## list\n\n`client.holds.list(financial_account_token: string, begin?: string, end?: string, ending_before?: string, page_size?: number, starting_after?: string, status?: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED'): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: hold_event[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n\n**get** `/v1/financial_accounts/{financial_account_token}/holds`\n\nList holds for a financial account.\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED'`\n Hold status to filter by.\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration.\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]`\n - `expiration_datetime?: string`\n - `family?: 'HOLD'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const hold of client.holds.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(hold);\n}\n```", + perLanguage: { + typescript: { + method: 'client.holds.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const hold of client.holds.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e')) {\n console.log(hold.user_defined_id);\n}", + }, + python: { + method: 'holds.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.holds.list(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\npage = page.data[0]\nprint(page.user_defined_id)', + }, + java: { + method: 'holds().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.HoldListPage;\nimport com.lithic.api.models.HoldListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n HoldListPage page = client.holds().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'holds().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.HoldListPage\nimport com.lithic.api.models.HoldListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: HoldListPage = client.holds().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Holds.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.Holds.List(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.HoldListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'holds.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.holds.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/holds \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'create', + endpoint: '/v1/financial_accounts/{financial_account_token}/holds', + httpMethod: 'post', + summary: 'Create hold', + description: + 'Create a hold on a financial account. Holds reserve funds by moving them\nfrom available to pending balance. They can be resolved via settlement\n(linked to a payment or book transfer), voiding, or expiration.\n', + stainlessPath: '(resource) holds > (method) create', + qualified: 'client.holds.create', + params: [ + 'financial_account_token: string;', + 'amount: number;', + 'token?: string;', + 'expiration_datetime?: string;', + 'memo?: string;', + 'user_defined_id?: string;', + ], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }", + markdown: + "## create\n\n`client.holds.create(financial_account_token: string, amount: number, token?: string, expiration_datetime?: string, memo?: string, user_defined_id?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: hold_event[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n\n**post** `/v1/financial_accounts/{financial_account_token}/holds`\n\nCreate a hold on a financial account. Holds reserve funds by moving them\nfrom available to pending balance. They can be resolved via settlement\n(linked to a payment or book transfer), voiding, or expiration.\n\n\n### Parameters\n\n- `financial_account_token: string`\n\n- `amount: number`\n Amount to hold in cents\n\n- `token?: string`\n Customer-provided token for idempotency. Becomes the hold token.\n\n- `expiration_datetime?: string`\n When the hold should auto-expire\n\n- `memo?: string`\n Reason for the hold\n\n- `user_defined_id?: string`\n User-provided identifier for the hold\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration.\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]`\n - `expiration_datetime?: string`\n - `family?: 'HOLD'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst hold = await client.holds.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { amount: 1 });\n\nconsole.log(hold);\n```", + perLanguage: { + typescript: { + method: 'client.holds.create', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst hold = await client.holds.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { amount: 1 });\n\nconsole.log(hold.user_defined_id);", + }, + python: { + method: 'holds.create', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nhold = client.holds.create(\n financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n amount=1,\n)\nprint(hold.user_defined_id)', + }, + java: { + method: 'holds().create', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Hold;\nimport com.lithic.api.models.HoldCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n HoldCreateParams params = HoldCreateParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .amount(1L)\n .build();\n Hold hold = client.holds().create(params);\n }\n}', + }, + kotlin: { + method: 'holds().create', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Hold\nimport com.lithic.api.models.HoldCreateParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val params: HoldCreateParams = HoldCreateParams.builder()\n .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .amount(1L)\n .build()\n val hold: Hold = client.holds().create(params)\n}', + }, + go: { + method: 'client.Holds.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\thold, err := client.Holds.New(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.HoldNewParams{\n\t\t\tAmount: lithic.F(int64(1)),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", hold.UserDefinedID)\n}\n', + }, + ruby: { + method: 'holds.create', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nhold = lithic.holds.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", amount: 1)\n\nputs(hold)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/financial_accounts/$FINANCIAL_ACCOUNT_TOKEN/holds \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: $LITHIC_API_KEY" \\\n -d \'{\n "amount": 1\n }\'', + }, + }, + }, + { + name: 'retrieve', + endpoint: '/v1/holds/{hold_token}', + httpMethod: 'get', + summary: 'Get hold', + description: 'Get hold by token.', + stainlessPath: '(resource) holds > (method) retrieve', + qualified: 'client.holds.retrieve', + params: ['hold_token: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }", + markdown: + "## retrieve\n\n`client.holds.retrieve(hold_token: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: hold_event[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n\n**get** `/v1/holds/{hold_token}`\n\nGet hold by token.\n\n### Parameters\n\n- `hold_token: string`\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration.\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]`\n - `expiration_datetime?: string`\n - `family?: 'HOLD'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst hold = await client.holds.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(hold);\n```", + perLanguage: { + typescript: { + method: 'client.holds.retrieve', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst hold = await client.holds.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(hold.user_defined_id);", + }, + python: { + method: 'holds.retrieve', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nhold = client.holds.retrieve(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(hold.user_defined_id)', + }, + java: { + method: 'holds().retrieve', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Hold;\nimport com.lithic.api.models.HoldRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Hold hold = client.holds().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'holds().retrieve', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Hold\nimport com.lithic.api.models.HoldRetrieveParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val hold: Hold = client.holds().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Holds.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\thold, err := client.Holds.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", hold.UserDefinedID)\n}\n', + }, + ruby: { + method: 'holds.retrieve', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nhold = lithic.holds.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(hold)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/holds/$HOLD_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'void', + endpoint: '/v1/holds/{hold_token}/void', + httpMethod: 'post', + summary: 'Void hold', + description: + 'Void an active hold. This returns the held funds from pending back to\navailable balance. Only holds in PENDING status can be voided.\n', + stainlessPath: '(resource) holds > (method) void', + qualified: 'client.holds.void', + params: ['hold_token: string;', 'memo?: string;'], + response: + "{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }", + markdown: + "## void\n\n`client.holds.void(hold_token: string, memo?: string): { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: hold_event[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n\n**post** `/v1/holds/{hold_token}/void`\n\nVoid an active hold. This returns the held funds from pending back to\navailable balance. Only holds in PENDING status can be voided.\n\n\n### Parameters\n\n- `hold_token: string`\n\n- `memo?: string`\n Reason for voiding the hold\n\n### Returns\n\n- `{ token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration.\n\n - `token: string`\n - `created: string`\n - `status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'`\n - `updated: string`\n - `currency?: string`\n - `events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; memo: string; result: 'APPROVED' | 'DECLINED'; settling_transaction_token: string; type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; }[]`\n - `expiration_datetime?: string`\n - `family?: 'HOLD'`\n - `financial_account_token?: string`\n - `pending_amount?: number`\n - `result?: 'APPROVED' | 'DECLINED'`\n - `user_defined_id?: string`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst hold = await client.holds.void('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(hold);\n```", + perLanguage: { + typescript: { + method: 'client.holds.void', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst hold = await client.holds.void('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(hold.user_defined_id);", + }, + python: { + method: 'holds.void', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nhold = client.holds.void(\n hold_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(hold.user_defined_id)', + }, + java: { + method: 'holds().void_', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Hold;\nimport com.lithic.api.models.HoldVoidParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n Hold hold = client.holds().void_("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'holds().void', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Hold\nimport com.lithic.api.models.HoldVoidParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val hold: Hold = client.holds().void("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.Holds.Void', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\thold, err := client.Holds.Void(\n\t\tcontext.TODO(),\n\t\t"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n\t\tlithic.HoldVoidParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", hold.UserDefinedID)\n}\n', + }, + ruby: { + method: 'holds.void', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nhold = lithic.holds.void("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(hold)', + }, + http: { + example: + "curl https://api.lithic.com/v1/holds/$HOLD_TOKEN/void \\\n -H 'Content-Type: application/json' \\\n -H \"Authorization: $LITHIC_API_KEY\" \\\n -d '{}'", + }, + }, + }, + { + name: 'list', + endpoint: '/v1/account_activity', + httpMethod: 'get', + summary: 'List Account Activity', + description: 'Retrieve a list of transactions across all public accounts.', + stainlessPath: '(resource) account_activity > (method) list', + qualified: 'client.accountActivity.list', + params: [ + 'account_token?: string;', + 'begin?: string;', + 'business_account_token?: string;', + 'category?: string;', + 'end?: string;', + 'ending_before?: string;', + 'financial_account_token?: string;', + 'page_size?: number;', + "result?: 'APPROVED' | 'DECLINED';", + 'starting_after?: string;', + "status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED' | 'VOIDED';", + ], + response: + "{ token: string; category: string; created: string; currency: string; descriptor: string; events: financial_event[]; family: 'INTERNAL'; financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; } | object | object | object | object | object | object", + markdown: + "## list\n\n`client.accountActivity.list(account_token?: string, begin?: string, business_account_token?: string, category?: string, end?: string, ending_before?: string, financial_account_token?: string, page_size?: number, result?: 'APPROVED' | 'DECLINED', starting_after?: string, status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED' | 'VOIDED'): { token: string; category: string; created: string; currency: string; descriptor: string; events: financial_event[]; family: 'INTERNAL'; financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; } | object | object | object | object | object | object`\n\n**get** `/v1/account_activity`\n\nRetrieve a list of transactions across all public accounts.\n\n### Parameters\n\n- `account_token?: string`\n Filter by account token\n\n- `begin?: string`\n Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone.\n\n- `business_account_token?: string`\n Filter by business account token\n\n- `category?: string`\n Filter by transaction category\n\n- `end?: string`\n Date string in RFC 3339 format. Only entries created before the specified time will be included. UTC time zone.\n\n- `ending_before?: string`\n A cursor representing an item's token before which a page of results should end. Used to retrieve the previous page of results before this item.\n\n- `financial_account_token?: string`\n Filter by financial account token\n\n- `page_size?: number`\n Page size (for pagination).\n\n- `result?: 'APPROVED' | 'DECLINED'`\n Filter by transaction result\n\n- `starting_after?: string`\n A cursor representing an item's token after which a page of results should begin. Used to retrieve the next page of results after this item.\n\n- `status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED' | 'VOIDED'`\n Filter by transaction status\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; family: 'INTERNAL'; financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; } | { token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: object; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; } | { token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: { cardholder: object; hold: object; merchant: object; settlement: object; }; authorization_amount: number; authorization_code: string; avs: { address: string; zipcode: string; }; card_token: string; cardholder_authentication: object; created: string; financial_account_token: string; merchant: object; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: { entry_mode: object; terminal: object; }; result: string; service_location: { city: string; country: string; postal_code: string; state: string; street_address: string; }; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: object; updated: string; events?: { token: string; amount: number; amounts: object; created: string; detailed_results: string[]; effective_polarity: 'CREDIT' | 'DEBIT'; network_info: object; result: string; rule_results: object[]; type: string; account_type?: 'CHECKING' | 'SAVINGS'; network_specific_data?: object; }[]; } | { token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: wire_party_details; debtor?: wire_party_details; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; } | { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; } | { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: object; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; } | { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: object[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n Response containing multiple transaction types. The `family` field determines which transaction type is returned: INTERNAL returns FinancialTransaction, TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns HoldTransaction\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const accountActivityListResponse of client.accountActivity.list()) {\n console.log(accountActivityListResponse);\n}\n```", + perLanguage: { + typescript: { + method: 'client.accountActivity.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const accountActivityListResponse of client.accountActivity.list()) {\n console.log(accountActivityListResponse);\n}", + }, + python: { + method: 'account_activity.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.account_activity.list()\npage = page.data[0]\nprint(page)', + }, + java: { + method: 'accountActivity().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountActivityListPage;\nimport com.lithic.api.models.AccountActivityListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountActivityListPage page = client.accountActivity().list();\n }\n}', + }, + kotlin: { + method: 'accountActivity().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountActivityListPage\nimport com.lithic.api.models.AccountActivityListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: AccountActivityListPage = client.accountActivity().list()\n}', + }, + go: { + method: 'client.AccountActivity.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.AccountActivity.List(context.TODO(), lithic.AccountActivityListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'account_activity.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.account_activity.list\n\nputs(page)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_activity \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'retrieve_transaction', + endpoint: '/v1/account_activity/{transaction_token}', + httpMethod: 'get', + summary: 'Get Single Transaction from Account Activity', + description: 'Retrieve a single transaction', + stainlessPath: '(resource) account_activity > (method) retrieve_transaction', + qualified: 'client.accountActivity.retrieveTransaction', + params: ['transaction_token: string;'], + response: + "{ token: string; category: string; created: string; currency: string; descriptor: string; events: financial_event[]; family: 'INTERNAL'; financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; } | object | object | object | object | object | object", + markdown: + "## retrieve_transaction\n\n`client.accountActivity.retrieveTransaction(transaction_token: string): { token: string; category: string; created: string; currency: string; descriptor: string; events: financial_event[]; family: 'INTERNAL'; financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; } | object | object | object | object | object | object`\n\n**get** `/v1/account_activity/{transaction_token}`\n\nRetrieve a single transaction\n\n### Parameters\n\n- `transaction_token: string`\n\n### Returns\n\n- `{ token: string; category: string; created: string; currency: string; descriptor: string; events: { token?: string; amount?: number; created?: string; result?: 'APPROVED' | 'DECLINED'; type?: string; }[]; family: 'INTERNAL'; financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; } | { token: string; category: string; created: string; currency: string; events: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'FUNDS_INSUFFICIENT'[]; memo: string; result: 'APPROVED' | 'DECLINED'; subtype: string; type: string; }[]; family: 'TRANSFER'; from_financial_account_token: string; pending_amount: number; result: 'APPROVED' | 'DECLINED'; settled_amount: number; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; to_financial_account_token: string; updated: string; external_id?: string; external_resource?: object; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; } | { token: string; account_token: string; acquirer_fee: number; acquirer_reference_number: string; amount: number; amounts: { cardholder: object; hold: object; merchant: object; settlement: object; }; authorization_amount: number; authorization_code: string; avs: { address: string; zipcode: string; }; card_token: string; cardholder_authentication: object; created: string; financial_account_token: string; merchant: object; merchant_amount: number; merchant_authorization_amount: number; merchant_currency: string; network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; network_risk_score: number; pos: { entry_mode: object; terminal: object; }; result: string; service_location: { city: string; country: string; postal_code: string; state: string; street_address: string; }; settled_amount: number; status: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'SETTLED' | 'VOIDED'; tags: object; token_info: object; updated: string; events?: { token: string; amount: number; amounts: object; created: string; detailed_results: string[]; effective_polarity: 'CREDIT' | 'DEBIT'; network_info: object; result: string; rule_results: object[]; type: string; account_type?: 'CHECKING' | 'SAVINGS'; network_specific_data?: object; }[]; } | { token: string; category: string; created: string; descriptor: string; direction: 'CREDIT' | 'DEBIT'; events: { token: string; amount: number; created: string; result: 'APPROVED' | 'DECLINED'; type: string; detailed_results?: string[]; external_id?: string; }[]; family: 'PAYMENT'; financial_account_token: string; method: 'ACH_NEXT_DAY' | 'ACH_SAME_DAY' | 'WIRE'; method_attributes: { sec_code: 'CCD' | 'PPD' | 'WEB' | 'TEL' | 'CIE' | 'CTX'; ach_hold_period?: number; addenda?: string; company_id?: string; override_company_name?: string; receipt_routing_number?: string; recipient_name?: string; retries?: number; return_reason_code?: string; trace_numbers?: string[]; } | { wire_message_type: string; wire_network: 'FEDWIRE' | 'SWIFT'; creditor?: wire_party_details; debtor?: wire_party_details; message_id?: string; remittance_information?: string; }; pending_amount: number; related_account_tokens: { account_token: string; business_account_token: string; }; result: 'APPROVED' | 'DECLINED'; settled_amount: number; source: 'LITHIC' | 'EXTERNAL' | 'CUSTOMER'; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; expected_release_date?: string; external_bank_account_token?: string; tags?: object; type?: string; user_defined_id?: string; } | { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; }[]; family?: 'EXTERNAL_PAYMENT'; financial_account_token?: string; payment_type?: 'DEPOSIT' | 'WITHDRAWAL'; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; user_defined_id?: string; } | { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; category?: string; currency?: string; direction?: 'CREDIT' | 'DEBIT'; events?: { token: string; amount: number; created: string; detailed_results: 'APPROVED' | 'INSUFFICIENT_FUNDS'[]; effective_date: string; memo: string; result: 'APPROVED' | 'DECLINED'; type: string; subtype?: string; }[]; external_resource?: object; family?: 'MANAGEMENT_OPERATION'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; settled_amount?: number; transaction_series?: { related_transaction_event_token: string; related_transaction_token: string; type: string; }; user_defined_id?: string; } | { token: string; created: string; status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; updated: string; currency?: string; events?: object[]; expiration_datetime?: string; family?: 'HOLD'; financial_account_token?: string; pending_amount?: number; result?: 'APPROVED' | 'DECLINED'; user_defined_id?: string; }`\n Response containing multiple transaction types. The `family` field determines which transaction type is returned: INTERNAL returns FinancialTransaction, TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns HoldTransaction\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\nconst response = await client.accountActivity.retrieveTransaction('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');\n\nconsole.log(response);\n```", + perLanguage: { + typescript: { + method: 'client.accountActivity.retrieveTransaction', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.accountActivity.retrieveTransaction(\n '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',\n);\n\nconsole.log(response);", + }, + python: { + method: 'account_activity.retrieve_transaction', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.account_activity.retrieve_transaction(\n "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",\n)\nprint(response)', + }, + java: { + method: 'accountActivity().retrieveTransaction', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.AccountActivityRetrieveTransactionParams;\nimport com.lithic.api.models.AccountActivityRetrieveTransactionResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n AccountActivityRetrieveTransactionResponse response = client.accountActivity().retrieveTransaction("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");\n }\n}', + }, + kotlin: { + method: 'accountActivity().retrieveTransaction', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.AccountActivityRetrieveTransactionParams\nimport com.lithic.api.models.AccountActivityRetrieveTransactionResponse\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val response: AccountActivityRetrieveTransactionResponse = client.accountActivity().retrieveTransaction("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n}', + }, + go: { + method: 'client.AccountActivity.GetTransaction', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tresponse, err := client.AccountActivity.GetTransaction(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + }, + ruby: { + method: 'account_activity.retrieve_transaction', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresponse = lithic.account_activity.retrieve_transaction("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n\nputs(response)', + }, + http: { + example: + 'curl https://api.lithic.com/v1/account_activity/$TRANSACTION_TOKEN \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'list', + endpoint: '/v1/transfer_limits', + httpMethod: 'get', + summary: 'Get transfer limits', + description: 'Get transfer limits for a specified date', + stainlessPath: '(resource) transfer_limits > (method) list', + qualified: 'client.transferLimits.list', + params: ['date?: string;'], + response: + '{ company_id: string; daily_limit: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }; date: string; is_fbo: boolean; monthly_limit: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }; program_limit_per_transaction: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }; }', + markdown: + "## list\n\n`client.transferLimits.list(date?: string): { company_id: string; daily_limit: { credit: object; debit: object; }; date: string; is_fbo: boolean; monthly_limit: { credit: object; debit: object; }; program_limit_per_transaction: { credit: object; debit: object; }; }`\n\n**get** `/v1/transfer_limits`\n\nGet transfer limits for a specified date\n\n### Parameters\n\n- `date?: string`\n Date for which to retrieve transfer limits (ISO 8601 format)\n\n### Returns\n\n- `{ company_id: string; daily_limit: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }; date: string; is_fbo: boolean; monthly_limit: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }; program_limit_per_transaction: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }; }`\n\n - `company_id: string`\n - `daily_limit: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }`\n - `date: string`\n - `is_fbo: boolean`\n - `monthly_limit: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }`\n - `program_limit_per_transaction: { credit: { limit: number; amount_originated?: number; }; debit: { limit: number; amount_originated?: number; }; }`\n\n### Example\n\n```typescript\nimport Lithic from 'lithic';\n\nconst client = new Lithic();\n\n// Automatically fetches more pages as needed.\nfor await (const transferLimit of client.transferLimits.list()) {\n console.log(transferLimit);\n}\n```", + perLanguage: { + typescript: { + method: 'client.transferLimits.list', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const transferLimit of client.transferLimits.list()) {\n console.log(transferLimit.company_id);\n}", + }, + python: { + method: 'transfer_limits.list', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\npage = client.transfer_limits.list()\npage = page.data[0]\nprint(page.company_id)', + }, + java: { + method: 'transferLimits().list', + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.TransferLimitListPage;\nimport com.lithic.api.models.TransferLimitListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n TransferLimitListPage page = client.transferLimits().list();\n }\n}', + }, + kotlin: { + method: 'transferLimits().list', + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.TransferLimitListPage\nimport com.lithic.api.models.TransferLimitListParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n val page: TransferLimitListPage = client.transferLimits().list()\n}', + }, + go: { + method: 'client.TransferLimits.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\tpage, err := client.TransferLimits.List(context.TODO(), lithic.TransferLimitListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, + ruby: { + method: 'transfer_limits.list', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\npage = lithic.transfer_limits.list\n\nputs(page)', + }, + http: { + example: 'curl https://api.lithic.com/v1/transfer_limits \\\n -H "Authorization: $LITHIC_API_KEY"', + }, + }, + }, + { + name: 'parsed', + endpoint: '', + httpMethod: '', + summary: '', + description: '', + stainlessPath: '(resource) webhooks > (method) parsed', + qualified: 'client.webhooks.parsed', + perLanguage: { + typescript: { + method: 'client.webhooks.parsed', + example: + "import Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n});\n\nawait client.webhooks.parsed();", + }, + python: { + method: 'webhooks.parsed', + example: + 'import os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n)\nclient.webhooks.parsed()', + }, + java: { + example: + 'package com.lithic.api.example;\n\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.WebhookParsedParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n LithicClient client = LithicOkHttpClient.fromEnv();\n\n client.webhooks().parsed();\n }\n}', + }, + kotlin: { + example: + 'package com.lithic.api.example\n\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.WebhookParsedParams\n\nfun main() {\n val client: LithicClient = LithicOkHttpClient.fromEnv()\n\n client.webhooks().parsed()\n}', + }, + go: { + method: 'client.Webhooks.Parsed', + example: + 'package main\n\nimport (\n\t"context"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"),\n\t)\n\terr := client.Webhooks.Parsed(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n', + }, + ruby: { + method: 'webhooks.parsed', + example: + 'require "lithic"\n\nlithic = Lithic::Client.new(\n api_key: "My Lithic API Key",\n environment: "sandbox" # defaults to "production"\n)\n\nresult = lithic.webhooks.parsed\n\nputs(result)', + }, + }, + }, +]; + +const EMBEDDED_READMES: { language: string; content: string }[] = [ + { + language: 'go', + content: + '# Lithic Go API Library\n\nGo Reference\n\nThe Lithic Go library provides convenient access to the [Lithic REST API](https://docs.lithic.com)\nfrom applications written in Go.\n\n\n\n## MCP Server\n\nUse the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/lithic-com/lithic-go" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/lithic-com/lithic-go@v0.0.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/lithic-com/lithic-go"\n\t"github.com/lithic-com/lithic-go/option"\n)\n\nfunc main() {\n\tclient := lithic.NewClient(\n\t\toption.WithAPIKey("My Lithic API Key"), // defaults to os.LookupEnv("LITHIC_API_KEY")\n\t\toption.WithEnvironmentSandbox(), // defaults to option.WithEnvironmentProduction()\n\t)\n\tcard, err := client.Cards.New(context.TODO(), lithic.CardNewParams{\n\t\tType: lithic.F(lithic.CardNewParamsTypeSingleUse),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card.Token)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Cards.New(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/lithic-com/lithic-go/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.Cards.ListAutoPaging(context.TODO(), lithic.CardListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tnonPCICard := iter.Current()\n\tfmt.Printf("%+v\\n", nonPCICard)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.Cards.List(context.TODO(), lithic.CardListParams{})\nfor page != nil {\n\tfor _, card := range page.Data {\n\t\tfmt.Printf("%+v\\n", card)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Cards.New(context.TODO(), lithic.CardNewParams{\n\tType: lithic.F(lithic.CardNewParamsTypeMerchantLocked),\n})\nif err != nil {\n\tvar apierr *lithic.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t\tprintln(apierr.Message) // Invalid parameter(s): type\n\t\tprintln(apierr.DebuggingRequestID) // 94d5e915-xxxx-4cee-a4f5-2xd6ebd279ac\n\t}\n\tpanic(err.Error()) // GET "/v1/cards": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Cards.List(\n\tctx,\n\tlithic.CardListParams{\n\t\tPageSize: lithic.F(int64(10)),\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := lithic.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Cards.List(\n\tcontext.TODO(),\n\tlithic.CardListParams{\n\t\tPageSize: lithic.F(int64(10)),\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\ncard, err := client.Cards.New(\n\tcontext.TODO(),\n\tlithic.CardNewParams{\n\t\tType: lithic.F(lithic.CardNewParamsTypeSingleUse),\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", card)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/lithic-com/lithic-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + }, + { + language: 'java', + content: + '# Lithic Java API Library\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.0.1)\n[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.0.1)\n\n\nThe Lithic Java SDK provides convenient access to the [Lithic REST API](https://docs.lithic.com) from applications written in Java.\n\nThe Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.\n\n\n\n## MCP Server\n\nUse the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nThe REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.0.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("com.lithic.api:lithic-java:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n\n com.lithic.api\n lithic-java\n 0.0.1\n\n~~~\n\n\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardCreateParams;\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nLithicClient client = LithicOkHttpClient.fromEnv();\n\nCardCreateParams params = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build();\nCard card = client.cards().create(params);\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nLithicClient client = LithicOkHttpClient.fromEnv();\n```\n\nOr manually:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\nLithicClient client = LithicOkHttpClient.builder()\n .apiKey("My Lithic API Key")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\nLithicClient client = LithicOkHttpClient.builder()\n // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n // Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My Lithic API Key")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------------- | ---------------------- | ----------------------- | -------- | -------------------------- |\n| `apiKey` | `lithic.apiKey` | `LITHIC_API_KEY` | true | - |\n| `webhookSecret` | `lithic.webhookSecret` | `LITHIC_WEBHOOK_SECRET` | false | - |\n| `baseUrl` | `lithic.baseUrl` | `LITHIC_BASE_URL` | true | `"https://api.lithic.com"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.lithic.api.client.LithicClient;\n\nLithicClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Lithic API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.cards().create(...)` should be called with an instance of `CardCreateParams`, and it will return an instance of `Card`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardCreateParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nLithicClient client = LithicOkHttpClient.fromEnv();\n\nCardCreateParams params = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build();\nCompletableFuture card = client.async().cards().create(params);\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.lithic.api.client.LithicClientAsync;\nimport com.lithic.api.client.okhttp.LithicOkHttpClientAsync;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardCreateParams;\nimport java.util.concurrent.CompletableFuture;\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nLithicClientAsync client = LithicOkHttpClientAsync.fromEnv();\n\nCardCreateParams params = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build();\nCompletableFuture card = client.cards().create(params);\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.lithic.api.core.http.Headers;\nimport com.lithic.api.core.http.HttpResponseFor;\nimport com.lithic.api.models.Card;\nimport com.lithic.api.models.CardCreateParams;\n\nCardCreateParams params = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build();\nHttpResponseFor card = client.cards().withRawResponse().create(params);\n\nint statusCode = card.statusCode();\nHeaders headers = card.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.lithic.api.models.Card;\n\nCard parsedCard = card.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`LithicServiceException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`LithicIoException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicIoException.kt): I/O networking errors.\n\n- [`LithicRetryableException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`LithicInvalidDataException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`LithicException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport com.lithic.api.models.CardListPage;\nimport com.lithic.api.models.NonPciCard;\n\nCardListPage page = client.cards().list();\n\n// Process as an Iterable\nfor (NonPciCard card : page.autoPager()) {\n System.out.println(card);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(card -> System.out.println(card));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](lithic-java-core/src/main/kotlin/com/lithic/api/core/http/AsyncStreamResponse.kt):\n\n```java\nimport com.lithic.api.core.http.AsyncStreamResponse;\nimport com.lithic.api.models.CardListPageAsync;\nimport com.lithic.api.models.NonPciCard;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture pageFuture = client.async().cards().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(card -> {\n System.out.println(card);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(NonPciCard card) {\n System.out.println(card);\n }\n\n @Override\n public void onComplete(Optional error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(card -> {\n System.out.println(card);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport com.lithic.api.models.CardListPage;\nimport com.lithic.api.models.NonPciCard;\n\nCardListPage page = client.cards().list();\nwhile (true) {\n for (NonPciCard card : page.items()) {\n System.out.println(card);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nEnable logging by setting the `LITHIC_LOG` environment variable to `info`:\n\n```sh\nexport LITHIC_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport LITHIC_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.core.LogLevel;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `lithic-java-core` is published with a [configuration file](lithic-java-core/src/main/resources/META-INF/proguard/lithic-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`LithicOkHttpClient`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) or [`LithicOkHttpClientAsync`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.lithic.api.models.CardListPage;\n\nCardListPage page = client.cards().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport java.time.Duration;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport com.lithic.api.core.http.ProxyAuthenticator;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\nimport java.time.Duration;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build();\n```\n\n### Environments\n\nThe SDK sends requests to the production by default. To send requests to a different environment, configure the client like so:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .sandbox()\n .build();\n```\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `lithic-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LithicClient`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt), [`LithicClientAsync`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt), [`LithicClientImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt), and [`LithicClientAsyncImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), all of which can work with any HTTP client\n- `lithic-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LithicOkHttpClient`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) and [`LithicOkHttpClientAsync`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt), which provide a way to construct [`LithicClientImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt) and [`LithicClientAsyncImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), respectively, using OkHttp\n- `lithic-java`\n - Depends on and exposes the APIs of both `lithic-java-core` and `lithic-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`lithic-java` dependency](#installation) with `lithic-java-core`\n2. Copy `lithic-java-client-okhttp`\'s [`OkHttpClient`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`LithicClientImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt) or [`LithicClientAsyncImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), similarly to [`LithicOkHttpClient`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) or [`LithicOkHttpClientAsync`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`lithic-java` dependency](#installation) with `lithic-java-core`\n2. Write a class that implements the [`HttpClient`](lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpClient.kt) interface\n3. Construct [`LithicClientImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt) or [`LithicClientAsyncImpl`](lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), similarly to [`LithicOkHttpClient`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) or [`LithicOkHttpClientAsync`](lithic-java-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.lithic.api.core.JsonValue;\nimport com.lithic.api.models.CardCreateParams;\n\nCardCreateParams params = CardCreateParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```java\nimport com.lithic.api.core.JsonValue;\nimport com.lithic.api.models.CardCreateParams;\nimport com.lithic.api.models.ShippingAddress;\n\nCardCreateParams params = CardCreateParams.builder()\n .shippingAddress(ShippingAddress.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build();\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](lithic-java-core/src/main/kotlin/com/lithic/api/core/Values.kt) object to its setter:\n\n```java\nimport com.lithic.api.core.JsonValue;\nimport com.lithic.api.models.CardCreateParams;\n\nCardCreateParams params = CardCreateParams.builder()\n .type(JsonValue.from(42))\n .build();\n```\n\nThe most straightforward way to create a [`JsonValue`](lithic-java-core/src/main/kotlin/com/lithic/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.lithic.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](lithic-java-core/src/main/kotlin/com/lithic/api/core/Values.kt):\n\n```java\nimport com.lithic.api.core.JsonMissing;\nimport com.lithic.api.models.CardCreateParams;\n\nCardCreateParams params = CardCreateParams.builder()\n .type(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.lithic.api.core.JsonValue;\nimport java.util.Map;\n\nMap additionalProperties = client.cards().create(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.lithic.api.core.JsonField;\nimport com.lithic.api.models.CardCreateParams;\nimport java.util.Optional;\n\nJsonField type = client.cards().create(params)._type();\n\nif (type.isMissing()) {\n // The property is absent from the JSON response\n} else if (type.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional jsonString = type.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = type.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`LithicInvalidDataException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.lithic.api.models.Card;\n\nCard card = client.cards().create(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.lithic.api.models.Card;\n\nCard card = client.cards().create(\n params, RequestOptions.builder().responseValidation(true).build()\n);\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.lithic.api.client.LithicClient;\nimport com.lithic.api.client.okhttp.LithicOkHttpClient;\n\nLithicClient client = LithicOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField` instead of just plain `T`?\n\nUsing `JsonField` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/lithic-com/lithic-java/issues) with questions, bugs, or suggestions.\n', + }, + { + language: 'kotlin', + content: + '# Lithic Kotlin API Library\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-kotlin)](https://central.sonatype.com/artifact/com.lithic.api/lithic-kotlin/0.0.1)\n[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-kotlin/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-kotlin/0.0.1)\n\n\nThe Lithic Kotlin SDK provides convenient access to the [Lithic REST API](https://docs.lithic.com) from applications written in Kotlin.\n\nThe Lithic Kotlin SDK is similar to the Lithic Java SDK but with minor differences that make it more ergonomic for use in Kotlin, such as nullable values instead of `Optional`, `Sequence` instead of `Stream`, and suspend functions instead of `CompletableFuture`.\n\n\n\n## MCP Server\n\nUse the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nThe REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). KDocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-kotlin/0.0.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("com.lithic.api:lithic-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n\n com.lithic.api\n lithic-kotlin\n 0.0.1\n\n~~~\n\n\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardCreateParams\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nval client: LithicClient = LithicOkHttpClient.fromEnv()\n\nval params: CardCreateParams = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build()\nval card: Card = client.cards().create(params)\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nval client: LithicClient = LithicOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .apiKey("My Lithic API Key")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\nval client: LithicClient = LithicOkHttpClient.builder()\n // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n // Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\n .fromEnv()\n .apiKey("My Lithic API Key")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------------- | ---------------------- | ----------------------- | -------- | -------------------------- |\n| `apiKey` | `lithic.apiKey` | `LITHIC_API_KEY` | true | - |\n| `webhookSecret` | `lithic.webhookSecret` | `LITHIC_WEBHOOK_SECRET` | false | - |\n| `baseUrl` | `lithic.baseUrl` | `LITHIC_BASE_URL` | true | `"https://api.lithic.com"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\n\nval clientWithOptions: LithicClient = client.withOptions {\n it.baseUrl("https://example.com")\n it.maxRetries(42)\n}\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Lithic API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Kotlin class.\n\nFor example, `client.cards().create(...)` should be called with an instance of `CardCreateParams`, and it will return an instance of `Card`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardCreateParams\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nval client: LithicClient = LithicOkHttpClient.fromEnv()\n\nval params: CardCreateParams = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build()\nval card: Card = client.async().cards().create(params)\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport com.lithic.api.client.LithicClientAsync\nimport com.lithic.api.client.okhttp.LithicOkHttpClientAsync\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardCreateParams\n\n// Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties\n// Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables\nval client: LithicClientAsync = LithicOkHttpClientAsync.fromEnv()\n\nval params: CardCreateParams = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build()\nval card: Card = client.cards().create(params)\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods are [suspending](https://kotlinlang.org/docs/coroutines-guide.html).\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Kotlin classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```kotlin\nimport com.lithic.api.core.http.Headers\nimport com.lithic.api.core.http.HttpResponseFor\nimport com.lithic.api.models.Card\nimport com.lithic.api.models.CardCreateParams\n\nval params: CardCreateParams = CardCreateParams.builder()\n .type(CardCreateParams.Type.SINGLE_USE)\n .build()\nval card: HttpResponseFor = client.cards().withRawResponse().create(params)\n\nval statusCode: Int = card.statusCode()\nval headers: Headers = card.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport com.lithic.api.models.Card\n\nval parsedCard: Card = card.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`LithicServiceException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/LithicServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`LithicIoException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/LithicIoException.kt): I/O networking errors.\n\n- [`LithicRetryableException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/LithicRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`LithicInvalidDataException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`LithicException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/LithicException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns a [`Sequence`](https://kotlinlang.org/docs/sequences.html)\n\n```kotlin\nimport com.lithic.api.models.CardListPage\n\nval page: CardListPage = client.cards().list()\npage.autoPager()\n .take(50)\n .forEach { card -> println(card) }\n```\n\nWhen using the asynchronous client, the method returns a [`Flow`](https://kotlinlang.org/docs/flow.html):\n\n```kotlin\nimport com.lithic.api.models.CardListPageAsync\n\nval page: CardListPageAsync = client.async().cards().list()\npage.autoPager()\n .take(50)\n .forEach { card -> println(card) }\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```kotlin\nimport com.lithic.api.models.CardListPage\nimport com.lithic.api.models.NonPciCard\n\nval page: CardListPage = client.cards().list()\nwhile (true) {\n for (card in page.items()) {\n println(card)\n }\n\n if (!page.hasNextPage()) {\n break\n }\n\n page = page.nextPage()\n}\n```\n\n## Logging\n\nEnable logging by setting the `LITHIC_LOG` environment variable to `info`:\n\n```sh\nexport LITHIC_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport LITHIC_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.core.LogLevel\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .build()\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `lithic-kotlin-core` is published with a [configuration file](lithic-kotlin-core/src/main/resources/META-INF/proguard/lithic-kotlin-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`LithicOkHttpClient`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) or [`LithicOkHttpClientAsync`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .build()\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```kotlin\nimport com.lithic.api.models.CardListPage\n\nval page: CardListPage = client.cards().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build())\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport java.time.Duration\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .build()\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .proxy(Proxy(\n Proxy.Type.HTTP, InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .build()\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport com.lithic.api.core.http.ProxyAuthenticator\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .build()\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\nimport java.time.Duration\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .build()\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .build()\n```\n\n### Environments\n\nThe SDK sends requests to the production by default. To send requests to a different environment, configure the client like so:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .sandbox()\n .build()\n```\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `lithic-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LithicClient`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt), [`LithicClientAsync`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt), [`LithicClientImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt), and [`LithicClientAsyncImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), all of which can work with any HTTP client\n- `lithic-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LithicOkHttpClient`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) and [`LithicOkHttpClientAsync`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt), which provide a way to construct [`LithicClientImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt) and [`LithicClientAsyncImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), respectively, using OkHttp\n- `lithic-kotlin`\n - Depends on and exposes the APIs of both `lithic-kotlin-core` and `lithic-kotlin-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`lithic-kotlin` dependency](#installation) with `lithic-kotlin-core`\n2. Copy `lithic-kotlin-client-okhttp`\'s [`OkHttpClient`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`LithicClientImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt) or [`LithicClientAsyncImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), similarly to [`LithicOkHttpClient`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) or [`LithicOkHttpClientAsync`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`lithic-kotlin` dependency](#installation) with `lithic-kotlin-core`\n2. Write a class that implements the [`HttpClient`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/core/http/HttpClient.kt) interface\n3. Construct [`LithicClientImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt) or [`LithicClientAsyncImpl`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt), similarly to [`LithicOkHttpClient`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClient.kt) or [`LithicOkHttpClientAsync`](lithic-kotlin-client-okhttp/src/main/kotlin/com/lithic/api/client/okhttp/LithicOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```kotlin\nimport com.lithic.api.core.JsonValue\nimport com.lithic.api.models.CardCreateParams\n\nval params: CardCreateParams = CardCreateParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build()\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:\n\n```kotlin\nimport com.lithic.api.core.JsonValue\nimport com.lithic.api.models.CardCreateParams\nimport com.lithic.api.models.ShippingAddress\n\nval params: CardCreateParams = CardCreateParams.builder()\n .shippingAddress(ShippingAddress.builder()\n .putAdditionalProperty("secretProperty", JsonValue.from("42"))\n .build())\n .build()\n```\n\nThese properties can be accessed on the nested built object later using the `_additionalProperties()` method.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/core/Values.kt) object to its setter:\n\n```kotlin\nimport com.lithic.api.core.JsonValue\nimport com.lithic.api.models.CardCreateParams\n\nval params: CardCreateParams = CardCreateParams.builder()\n .type(JsonValue.from(42))\n .build()\n```\n\nThe most straightforward way to create a [`JsonValue`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport com.lithic.api.core.JsonValue\n\n// Create primitive JSON values\nval nullValue: JsonValue = JsonValue.from(null)\nval booleanValue: JsonValue = JsonValue.from(true)\nval numberValue: JsonValue = JsonValue.from(42)\nval stringValue: JsonValue = JsonValue.from("Hello World!")\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nval arrayValue: JsonValue = JsonValue.from(listOf(\n "Hello", "World"\n))\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nval objectValue: JsonValue = JsonValue.from(mapOf(\n "a" to 1, "b" to 2\n))\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nval complexValue: JsonValue = JsonValue.from(mapOf(\n "a" to listOf(\n 1, 2\n ), "b" to listOf(\n 3, 4\n )\n))\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/core/Values.kt):\n\n```kotlin\nimport com.lithic.api.core.JsonMissing\nimport com.lithic.api.models.CardCreateParams\n\nval params: CardCreateParams = CardCreateParams.builder()\n .type(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport com.lithic.api.core.JsonBoolean\nimport com.lithic.api.core.JsonNull\nimport com.lithic.api.core.JsonNumber\nimport com.lithic.api.core.JsonValue\n\nval additionalProperties: Map = client.cards().create(params)._additionalProperties()\nval secretPropertyValue: JsonValue = additionalProperties.get("secretProperty")\n\nval result = when (secretPropertyValue) {\n is JsonNull -> "It\'s null!"\n is JsonBoolean -> "It\'s a boolean!"\n is JsonNumber -> "It\'s a number!"\n // Other types include `JsonMissing`, `JsonString`, `JsonArray`, and `JsonObject`\n else -> "It\'s something else!"\n}\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```kotlin\nimport com.lithic.api.core.JsonField\nimport com.lithic.api.models.CardCreateParams\n\nval type: JsonField = client.cards().create(params)._type()\n\nif (type.isMissing()) {\n // The property is absent from the JSON response\n} else if (type.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n val jsonString: String? = type.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = type.asUnknown()!!.convert(MyClass::class.java)\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`LithicInvalidDataException`](lithic-kotlin-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```kotlin\nimport com.lithic.api.models.Card\n\nval card: Card = client.cards().create(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport com.lithic.api.models.Card\n\nval card: Card = client.cards().create(\n params, RequestOptions.builder().responseValidation(true).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.lithic.api.client.LithicClient\nimport com.lithic.api.client.okhttp.LithicOkHttpClient\n\nval client: LithicClient = LithicOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .build()\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nKotlin `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField` instead of just plain `T`?\n\nUsing `JsonField` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/lithic-com/lithic-kotlin/issues) with questions, bugs, or suggestions.\n', + }, + { + language: 'python', + content: + '# Lithic Python API library\n\n\n[![PyPI version](https://img.shields.io/pypi/v/lithic.svg?label=pypi%20(stable))](https://pypi.org/project/lithic/)\n\nThe Lithic Python library provides convenient access to the Lithic REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\n\n\n## MCP Server\n\nUse the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install lithic\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom lithic import Lithic\n\nclient = Lithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n # defaults to "production".\n environment="sandbox",\n)\n\ncard = client.cards.create(\n type="SINGLE_USE",\n)\nprint(card.token)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `LITHIC_API_KEY="My Lithic API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncLithic` instead of `Lithic` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom lithic import AsyncLithic\n\nclient = AsyncLithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n # defaults to "production".\n environment="sandbox",\n)\n\nasync def main() -> None:\n card = await client.cards.create(\n type="SINGLE_USE",\n )\n print(card.token)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install lithic[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom lithic import DefaultAioHttpClient\nfrom lithic import AsyncLithic\n\nasync def main() -> None:\n async with AsyncLithic(\n api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n card = await client.cards.create(\n type="SINGLE_USE",\n )\n print(card.token)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n## Pagination\n\nList methods in the Lithic API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```python\nfrom lithic import Lithic\n\nclient = Lithic()\n\nall_cards = []\n# Automatically fetches more pages as needed.\nfor card in client.cards.list():\n # Do something with card here\n all_cards.append(card)\nprint(all_cards)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom lithic import AsyncLithic\n\nclient = AsyncLithic()\n\nasync def main() -> None:\n all_cards = []\n # Iterate through items across all pages, issuing requests as needed.\n async for card in client.cards.list():\n all_cards.append(card)\n print(all_cards)\n\nasyncio.run(main())\n```\n\nAlternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:\n\n```python\nfirst_page = await client.cards.list()\nif first_page.has_next_page():\n print(f"will fetch next page using these details: {first_page.next_page_info()}")\n next_page = await first_page.get_next_page()\n print(f"number of items we just fetched: {len(next_page.data)}")\n\n# Remove `await` for non-async usage.\n```\n\nOr just work directly with the returned data:\n\n```python\nfirst_page = await client.cards.list()\n\nprint(f"next page cursor: {first_page.starting_after}") # => "next page cursor: ..."\nfor card in first_page.data:\n print(card.product_id)\n\n# Remove `await` for non-async usage.\n```\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom lithic import Lithic\n\nclient = Lithic()\n\ncard = client.cards.create(\n type="PHYSICAL",\n shipping_address={\n "address1": "123",\n "city": "NEW YORK",\n "country": "USA",\n "first_name": "Johnny",\n "last_name": "Appleseed",\n "postal_code": "10001",\n "state": "NY",\n },\n)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `lithic.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `lithic.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `lithic.APIError`.\n\n```python\nimport lithic\nfrom lithic import Lithic\n\nclient = Lithic()\n\ntry:\n client.cards.create(\n type="MERCHANT_LOCKED",\n )\nexcept lithic.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept lithic.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept lithic.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom lithic import Lithic\n\n# Configure the default for all requests:\nclient = Lithic(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).cards.list(\n page_size=10,\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom lithic import Lithic\n\n# Configure the default for all requests:\nclient = Lithic(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = Lithic(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).cards.list(\n page_size=10,\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `LITHIC_LOG` to `info`.\n\n```shell\n$ export LITHIC_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom lithic import Lithic\n\nclient = Lithic()\nresponse = client.cards.with_raw_response.create(\n type="SINGLE_USE",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\ncard = response.parse() # get the object that `cards.create()` would have returned\nprint(card.token)\n```\n\nThese methods return a [`LegacyAPIResponse`](https://github.com/lithic-com/lithic-python/tree/main/src/lithic/_legacy_response.py) object. This is a legacy class as we\'re changing it slightly in the next major version.\n\nFor the sync client this will mostly be the same with the exception\nof `content` & `text` will be methods instead of properties. In the\nasync client, all methods will be async.\n\nA migration script will be provided & the migration in general should\nbe smooth.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\nAs such, `.with_streaming_response` methods return a different [`APIResponse`](https://github.com/lithic-com/lithic-python/tree/main/src/lithic/_response.py) object, and the async client returns an [`AsyncAPIResponse`](https://github.com/lithic-com/lithic-python/tree/main/src/lithic/_response.py) object.\n\n```python\nwith client.cards.with_streaming_response.create(\n type="SINGLE_USE",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom lithic import Lithic, DefaultHttpxClient\n\nclient = Lithic(\n # Or use the `LITHIC_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom lithic import Lithic\n\nwith Lithic() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/lithic-com/lithic-python/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport lithic\nprint(lithic.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + }, + { + language: 'ruby', + content: + '# Lithic Ruby API library\n\nThe Lithic Ruby library provides convenient access to the Lithic REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/lithic-com/lithic-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\n\n\n## MCP Server\n\nUse the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/lithic).\n\nThe REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com).\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n\n\n```ruby\ngem "lithic", "~> 0.0.1"\n```\n\n\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "lithic"\n\nlithic = Lithic::Client.new(\n api_key: ENV["LITHIC_API_KEY"], # This is the default and can be omitted\n environment: "sandbox" # defaults to "production"\n)\n\ncard = lithic.cards.create(type: "SINGLE_USE")\n\nputs(card.token)\n```\n\n\n\n### Pagination\n\nList methods in the Lithic API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```ruby\npage = lithic.cards.list\n\n# Fetch single item from page.\ncard = page.data[0]\nputs(card.product_id)\n\n# Automatically fetches more pages as needed.\npage.auto_paging_each do |card|\n puts(card.product_id)\nend\n```\n\nAlternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.\n\n```ruby\nif page.next_page?\n new_page = page.next_page\n puts(new_page.data[0].product_id)\nend\n```\n\n\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Lithic::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n card = lithic.cards.create(type: "MERCHANT_LOCKED")\nrescue Lithic::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue Lithic::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue Lithic::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nlithic = Lithic::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nlithic.cards.list(page_size: 10, request_options: {max_retries: 5})\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nlithic = Lithic::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nlithic.cards.list(page_size: 10, request_options: {timeout: 5})\n```\n\nOn timeout, `Lithic::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `Lithic::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\npage =\n lithic.cards.list(\n page_size: 10,\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(page[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `Lithic::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `Lithic::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nlithic.cards.create(type: "SINGLE_USE")\n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nlithic.cards.create(type: "SINGLE_USE")\n\n# You can also splat a full Params class:\nparams = Lithic::CardCreateParams.new(type: "SINGLE_USE")\nlithic.cards.create(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :ACTIVE\nputs(Lithic::AccountUpdateParams::State::ACTIVE)\n\n# Revealed type: `T.all(Lithic::AccountUpdateParams::State, Symbol)`\nT.reveal_type(Lithic::AccountUpdateParams::State::ACTIVE)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nlithic.accounts.update(\n state: Lithic::AccountUpdateParams::State::ACTIVE,\n # …\n)\n\n# Literal values are also permissible:\nlithic.accounts.update(\n state: :ACTIVE,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/lithic-com/lithic-ruby/tree/main/CONTRIBUTING.md).\n', + }, + { + language: 'terraform', + content: + '# Lithic Terraform Provider\n\nThe [Lithic Terraform provider](https://registry.terraform.io/providers/stainless-sdks/lithic/latest/docs) provides convenient access to\nthe [Lithic REST API](https://docs.lithic.com) from Terraform.\n\n\n\n## Requirements\n\nThis provider requires Terraform CLI 1.0 or later. You can [install it for your system](https://developer.hashicorp.com/terraform/install)\non Hashicorp\'s website.\n\n## Usage\n\nAdd the following to your `main.tf` file:\n\n\n\n```hcl\n# Declare the provider and version\nterraform {\n required_providers {\n SDK_ProviderTypeName = {\n source = "stainless-sdks/lithic"\n version = "~> 0.0.1"\n }\n }\n}\n\n# Initialize the provider\nprovider "lithic" {\n api_key = "My Lithic API Key" # or set LITHIC_API_KEY env variable\n webhook_secret = "My Webhook Secret" # or set LITHIC_WEBHOOK_SECRET env variable\n}\n\n# Configure a resource\nresource "lithic_event_subscription" "example_event_subscription" {\n url = "https://example.com"\n description = "description"\n disabled = true\n event_types = ["account_holder_document.updated"]\n}\n```\n\n\n\nInitialize your project by running `terraform init` in the directory.\n\nAdditional examples can be found in the [./examples](./examples) folder within this repository, and you can\nrefer to the full documentation on [the Terraform Registry](https://registry.terraform.io/providers/stainless-sdks/lithic/latest/docs).\n\n### Provider Options\nWhen you initialize the provider, the following options are supported. It is recommended to use environment variables for sensitive values like access tokens.\nIf an environment variable is provided, then the option does not need to be set in the terraform source.\n\n| Property | Environment variable | Required | Default value |\n| -------------- | ----------------------- | -------- | ------------- |\n| api_key | `LITHIC_API_KEY` | true | — |\n| webhook_secret | `LITHIC_WEBHOOK_SECRET` | false | — |\n\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/lithic-terraform/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + }, + { + language: 'typescript', + content: + "# Lithic TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/lithic.svg?label=npm%20(stable))](https://npmjs.org/package/lithic) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/lithic)\n\nThis library provides convenient access to the Lithic REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). The full API of this library can be found in [api.md](api.md).\n\n\n\n## MCP Server\n\nUse the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install lithic\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n environment: 'sandbox', // defaults to 'production'\n});\n\nconst card = await client.cards.create({ type: 'SINGLE_USE' });\n\nconsole.log(card.token);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport Lithic from 'lithic';\n\nconst client = new Lithic({\n apiKey: process.env['LITHIC_API_KEY'], // This is the default and can be omitted\n environment: 'sandbox', // defaults to 'production'\n});\n\nconst params: Lithic.CardCreateParams = { type: 'SINGLE_USE' };\nconst card: Lithic.Card = await client.cards.create(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst card = await client.cards.create({ type: 'MERCHANT_LOCKED' }).catch(async (err) => {\n if (err instanceof Lithic.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.error?.message); // Invalid parameter(s): type\n console.log(err.error?.debugging_request_id); // 94d5e915-xxxx-4cee-a4f5-2xd6ebd279ac\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n});\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new Lithic({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.cards.list({ page_size: 10 }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new Lithic({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.cards.list({ page_size: 10 }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Auto-pagination\n\nList methods in the Lithic API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllNonPCICards(params) {\n const allNonPCICards = [];\n // Automatically fetches more pages as needed.\n for await (const nonPCICard of client.cards.list()) {\n allNonPCICards.push(nonPCICard);\n }\n return allNonPCICards;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.cards.list();\nfor (const nonPCICard of page.data) {\n console.log(nonPCICard);\n}\n\n// Convenience methods are provided for manually paginating:\nwhile (page.hasNextPage()) {\n page = await page.getNextPage();\n // ...\n}\n```\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new Lithic();\n\nconst response = await client.cards.create({ type: 'SINGLE_USE' }).asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: card, response: raw } = await client.cards\n .create({ type: 'SINGLE_USE' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(card.token);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `LITHIC_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport Lithic from 'lithic';\n\nconst client = new Lithic({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport Lithic from 'lithic';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new Lithic({\n logger: logger.child({ name: 'Lithic' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.cards.create({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport Lithic from 'lithic';\nimport fetch from 'my-fetch';\n\nconst client = new Lithic({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport Lithic from 'lithic';\n\nconst client = new Lithic({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n **Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport Lithic from 'lithic';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new Lithic({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n **Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport Lithic from 'lithic';\n\nconst client = new Lithic({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n **Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport Lithic from 'npm:lithic';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new Lithic({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/lithic-com/lithic-node/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n", + }, +]; + +const INDEX_OPTIONS = { + fields: [ + 'name', + 'endpoint', + 'summary', + 'description', + 'qualified', + 'stainlessPath', + 'content', + 'sectionContext', + ], + storeFields: ['kind', '_original'], + searchOptions: { + prefix: true, + fuzzy: 0.1, + boost: { + name: 5, + stainlessPath: 3, + endpoint: 3, + qualified: 3, + summary: 2, + content: 1, + description: 1, + } as Record, + }, +}; + +/** + * Self-contained local search engine backed by MiniSearch. + * Method data is embedded at SDK build time; prose documents + * can be loaded from an optional docs directory at runtime. + */ +export class LocalDocsSearch { + private methodIndex: MiniSearch; + private proseIndex: MiniSearch; + + private constructor() { + this.methodIndex = new MiniSearch(INDEX_OPTIONS); + this.proseIndex = new MiniSearch(INDEX_OPTIONS); + } + + static async create(opts?: { docsDir?: string }): Promise { + const instance = new LocalDocsSearch(); + instance.indexMethods(EMBEDDED_METHODS); + for (const readme of EMBEDDED_READMES) { + instance.indexProse(readme.content, `readme:${readme.language}`); + } + if (opts?.docsDir) { + await instance.loadDocsDirectory(opts.docsDir); + } + return instance; + } + + search(props: { + query: string; + language?: string; + detail?: string; + maxResults?: number; + maxLength?: number; + }): SearchResult { + const { query, language = 'typescript', detail = 'default', maxResults = 5, maxLength = 100_000 } = props; + + const useMarkdown = detail === 'verbose' || detail === 'high'; + + // Search both indices and merge results by score. + // Filter prose hits so language-tagged content (READMEs and docs with + // frontmatter) only matches the requested language. + const methodHits = this.methodIndex + .search(query) + .map((hit) => ({ ...hit, _kind: 'http_method' as const })); + const proseHits = this.proseIndex + .search(query) + .filter((hit) => { + const source = ((hit as Record)['_original'] as ProseChunk | undefined)?.source; + if (!source) return true; + // Check for language-tagged sources: "readme:" or "lang::" + let taggedLang: string | undefined; + if (source.startsWith('readme:')) taggedLang = source.slice('readme:'.length); + else if (source.startsWith('lang:')) taggedLang = source.split(':')[1]; + if (!taggedLang) return true; + return taggedLang === language || (language === 'javascript' && taggedLang === 'typescript'); + }) + .map((hit) => ({ ...hit, _kind: 'prose' as const })); + const merged = [...methodHits, ...proseHits].sort((a, b) => b.score - a.score); + const top = merged.slice(0, maxResults); + + const fullResults: (string | Record)[] = []; + + for (const hit of top) { + const original = (hit as Record)['_original']; + if (hit._kind === 'http_method') { + const m = original as MethodEntry; + if (useMarkdown && m.markdown) { + fullResults.push(m.markdown); + } else { + // Use per-language data when available, falling back to the + // top-level fields (which are TypeScript-specific in the + // legacy codepath). + const langData = m.perLanguage?.[language]; + fullResults.push({ + method: langData?.method ?? m.qualified, + summary: m.summary, + description: m.description, + endpoint: `${m.httpMethod.toUpperCase()} ${m.endpoint}`, + ...(langData?.example ? { example: langData.example } : {}), + ...(m.params ? { params: m.params } : {}), + ...(m.response ? { response: m.response } : {}), + }); + } + } else { + const c = original as ProseChunk; + fullResults.push({ + content: c.content, + ...(c.source ? { source: c.source } : {}), + }); + } + } + + let totalLength = 0; + const results: (string | Record)[] = []; + for (const result of fullResults) { + const len = typeof result === 'string' ? result.length : JSON.stringify(result).length; + totalLength += len; + if (totalLength > maxLength) break; + results.push(result); + } + + if (results.length < fullResults.length) { + results.unshift(`Truncated; showing ${results.length} of ${fullResults.length} results.`); + } + + return { results }; + } + + private indexMethods(methods: MethodEntry[]): void { + const docs: MiniSearchDocument[] = methods.map((m, i) => ({ + id: `method-${i}`, + kind: 'http_method' as const, + name: m.name, + endpoint: m.endpoint, + summary: m.summary, + description: m.description, + qualified: m.qualified, + stainlessPath: m.stainlessPath, + _original: m as unknown as Record, + })); + if (docs.length > 0) { + this.methodIndex.addAll(docs); + } + } + + private async loadDocsDirectory(docsDir: string): Promise { + let entries; + try { + entries = await fs.readdir(docsDir, { withFileTypes: true }); + } catch (err) { + getLogger().warn({ err, docsDir }, 'Could not read docs directory'); + return; + } + + const files = entries + .filter((e) => e.isFile()) + .filter((e) => e.name.endsWith('.md') || e.name.endsWith('.markdown') || e.name.endsWith('.json')); + + for (const file of files) { + try { + const filePath = path.join(docsDir, file.name); + const content = await fs.readFile(filePath, 'utf-8'); + + if (file.name.endsWith('.json')) { + const texts = extractTexts(JSON.parse(content)); + if (texts.length > 0) { + this.indexProse(texts.join('\n\n'), file.name); + } + } else { + // Parse optional YAML frontmatter for language tagging. + // Files with a "language" field in frontmatter will only + // surface in searches for that language. + // + // Example: + // --- + // language: python + // --- + // # Error handling in Python + // ... + const frontmatter = parseFrontmatter(content); + const source = frontmatter.language ? `lang:${frontmatter.language}:${file.name}` : file.name; + this.indexProse(content, source); + } + } catch (err) { + getLogger().warn({ err, file: file.name }, 'Failed to index docs file'); + } + } + } + + private indexProse(markdown: string, source: string): void { + const chunks = chunkMarkdown(markdown); + const baseId = this.proseIndex.documentCount; + + const docs: MiniSearchDocument[] = chunks.map((chunk, i) => ({ + id: `prose-${baseId + i}`, + kind: 'prose' as const, + content: chunk.content, + ...(chunk.sectionContext != null ? { sectionContext: chunk.sectionContext } : {}), + _original: { ...chunk, source } as unknown as Record, + })); + + if (docs.length > 0) { + this.proseIndex.addAll(docs); + } + } +} + +/** Lightweight markdown chunker — splits on headers, chunks by word count. */ +function chunkMarkdown(markdown: string): { content: string; tag: string; sectionContext?: string }[] { + // Strip YAML frontmatter + const stripped = markdown.replace(/^---\n[\s\S]*?\n---\n?/, ''); + const lines = stripped.split('\n'); + + const chunks: { content: string; tag: string; sectionContext?: string }[] = []; + const headers: string[] = []; + let current: string[] = []; + + const flush = () => { + const text = current.join('\n').trim(); + if (!text) return; + const sectionContext = headers.length > 0 ? headers.join(' > ') : undefined; + // Split into ~200-word chunks + const words = text.split(/\s+/); + for (let i = 0; i < words.length; i += 200) { + const slice = words.slice(i, i + 200).join(' '); + if (slice) { + chunks.push({ content: slice, tag: 'p', ...(sectionContext != null ? { sectionContext } : {}) }); + } + } + current = []; + }; + + for (const line of lines) { + const headerMatch = line.match(/^(#{1,6})\s+(.+)/); + if (headerMatch) { + flush(); + const level = headerMatch[1]!.length; + const text = headerMatch[2]!.trim(); + while (headers.length >= level) headers.pop(); + headers.push(text); + } else { + current.push(line); + } + } + flush(); + + return chunks; +} + +/** Recursively extracts string values from a JSON structure. */ +function extractTexts(data: unknown, depth = 0): string[] { + if (depth > 10) return []; + if (typeof data === 'string') return data.trim() ? [data] : []; + if (Array.isArray(data)) return data.flatMap((item) => extractTexts(item, depth + 1)); + if (typeof data === 'object' && data !== null) { + return Object.values(data).flatMap((v) => extractTexts(v, depth + 1)); + } + return []; +} + +/** Parses YAML frontmatter from a markdown string, extracting the language field if present. */ +function parseFrontmatter(markdown: string): { language?: string } { + const match = markdown.match(/^---\n([\s\S]*?)\n---/); + if (!match) return {}; + const body = match[1] ?? ''; + const langMatch = body.match(/^language:\s*(.+)$/m); + return langMatch ? { language: langMatch[1]!.trim() } : {}; +} diff --git a/packages/mcp-server/src/methods.ts b/packages/mcp-server/src/methods.ts index eb007c75..11638770 100644 --- a/packages/mcp-server/src/methods.ts +++ b/packages/mcp-server/src/methods.ts @@ -34,6 +34,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/v1/accounts', }, + { + clientCallName: 'client.accounts.retrieveSignals', + fullyQualifiedName: 'accounts.retrieveSignals', + httpMethod: 'get', + httpPath: '/v1/accounts/{account_token}/signals', + }, { clientCallName: 'client.accounts.retrieveSpendLimits', fullyQualifiedName: 'accounts.retrieveSpendLimits', @@ -148,6 +154,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/v2/auth_rules/results', }, + { + clientCallName: 'client.authRules.v2.listVersions', + fullyQualifiedName: 'authRules.v2.listVersions', + httpMethod: 'get', + httpPath: '/v2/auth_rules/{auth_rule_token}/versions', + }, { clientCallName: 'client.authRules.v2.promote', fullyQualifiedName: 'authRules.v2.promote', @@ -178,6 +190,114 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}', }, + { + clientCallName: 'client.transactionMonitoring.cases.retrieve', + fullyQualifiedName: 'transactionMonitoring.cases.retrieve', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases/{case_token}', + }, + { + clientCallName: 'client.transactionMonitoring.cases.update', + fullyQualifiedName: 'transactionMonitoring.cases.update', + httpMethod: 'patch', + httpPath: '/v1/transaction_monitoring/cases/{case_token}', + }, + { + clientCallName: 'client.transactionMonitoring.cases.list', + fullyQualifiedName: 'transactionMonitoring.cases.list', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases', + }, + { + clientCallName: 'client.transactionMonitoring.cases.listActivity', + fullyQualifiedName: 'transactionMonitoring.cases.listActivity', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/activity', + }, + { + clientCallName: 'client.transactionMonitoring.cases.listTransactions', + fullyQualifiedName: 'transactionMonitoring.cases.listTransactions', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/transactions', + }, + { + clientCallName: 'client.transactionMonitoring.cases.retrieveCards', + fullyQualifiedName: 'transactionMonitoring.cases.retrieveCards', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/cards', + }, + { + clientCallName: 'client.transactionMonitoring.cases.comments.create', + fullyQualifiedName: 'transactionMonitoring.cases.comments.create', + httpMethod: 'post', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/comments', + }, + { + clientCallName: 'client.transactionMonitoring.cases.comments.update', + fullyQualifiedName: 'transactionMonitoring.cases.comments.update', + httpMethod: 'patch', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/comments/{comment_token}', + }, + { + clientCallName: 'client.transactionMonitoring.cases.comments.delete', + fullyQualifiedName: 'transactionMonitoring.cases.comments.delete', + httpMethod: 'delete', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/comments/{comment_token}', + }, + { + clientCallName: 'client.transactionMonitoring.cases.files.create', + fullyQualifiedName: 'transactionMonitoring.cases.files.create', + httpMethod: 'post', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/files', + }, + { + clientCallName: 'client.transactionMonitoring.cases.files.retrieve', + fullyQualifiedName: 'transactionMonitoring.cases.files.retrieve', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/files/{file_token}', + }, + { + clientCallName: 'client.transactionMonitoring.cases.files.list', + fullyQualifiedName: 'transactionMonitoring.cases.files.list', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/files', + }, + { + clientCallName: 'client.transactionMonitoring.cases.files.delete', + fullyQualifiedName: 'transactionMonitoring.cases.files.delete', + httpMethod: 'delete', + httpPath: '/v1/transaction_monitoring/cases/{case_token}/files/{file_token}', + }, + { + clientCallName: 'client.transactionMonitoring.queues.create', + fullyQualifiedName: 'transactionMonitoring.queues.create', + httpMethod: 'post', + httpPath: '/v1/transaction_monitoring/queues', + }, + { + clientCallName: 'client.transactionMonitoring.queues.retrieve', + fullyQualifiedName: 'transactionMonitoring.queues.retrieve', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/queues/{queue_token}', + }, + { + clientCallName: 'client.transactionMonitoring.queues.update', + fullyQualifiedName: 'transactionMonitoring.queues.update', + httpMethod: 'patch', + httpPath: '/v1/transaction_monitoring/queues/{queue_token}', + }, + { + clientCallName: 'client.transactionMonitoring.queues.list', + fullyQualifiedName: 'transactionMonitoring.queues.list', + httpMethod: 'get', + httpPath: '/v1/transaction_monitoring/queues', + }, + { + clientCallName: 'client.transactionMonitoring.queues.delete', + fullyQualifiedName: 'transactionMonitoring.queues.delete', + httpMethod: 'delete', + httpPath: '/v1/transaction_monitoring/queues/{queue_token}', + }, { clientCallName: 'client.authStreamEnrollment.retrieveSecret', fullyQualifiedName: 'authStreamEnrollment.retrieveSecret', @@ -310,6 +430,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'post', httpPath: '/v1/cards/{card_token}/renew', }, + { + clientCallName: 'client.cards.retrieveSignals', + fullyQualifiedName: 'cards.retrieveSignals', + httpMethod: 'get', + httpPath: '/v1/cards/{card_token}/signals', + }, { clientCallName: 'client.cards.retrieveSpendLimits', fullyQualifiedName: 'cards.retrieveSpendLimits', @@ -346,6 +472,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/v1/cards/{card_token}/financial_transactions', }, + { + clientCallName: 'client.cardAuthorizations.challengeResponse', + fullyQualifiedName: 'cardAuthorizations.challengeResponse', + httpMethod: 'post', + httpPath: '/v1/card_authorizations/{event_token}/challenge_response', + }, { clientCallName: 'client.cardBulkOrders.create', fullyQualifiedName: 'cardBulkOrders.create', @@ -689,6 +821,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'post', httpPath: '/v1/transactions/{transaction_token}/expire_authorization', }, + { + clientCallName: 'client.transactions.route', + fullyQualifiedName: 'transactions.route', + httpMethod: 'post', + httpPath: '/v1/transactions/{transaction_token}/route', + }, { clientCallName: 'client.transactions.simulateAuthorization', fullyQualifiedName: 'transactions.simulateAuthorization', @@ -791,6 +929,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/v1/external_bank_accounts', }, + { + clientCallName: 'client.externalBankAccounts.pause', + fullyQualifiedName: 'externalBankAccounts.pause', + httpMethod: 'post', + httpPath: '/v1/external_bank_accounts/{external_bank_account_token}/pause', + }, { clientCallName: 'client.externalBankAccounts.retryMicroDeposits', fullyQualifiedName: 'externalBankAccounts.retryMicroDeposits', @@ -803,6 +947,12 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'post', httpPath: '/v1/external_bank_accounts/{external_bank_account_token}/retry_prenote', }, + { + clientCallName: 'client.externalBankAccounts.setVerificationMethod', + fullyQualifiedName: 'externalBankAccounts.setVerificationMethod', + httpMethod: 'post', + httpPath: '/v1/external_bank_accounts/{external_bank_account_token}/set_verification_method', + }, { clientCallName: 'client.externalBankAccounts.unpause', fullyQualifiedName: 'externalBankAccounts.unpause', @@ -1109,6 +1259,30 @@ export const sdkMethods: SdkMethod[] = [ httpMethod: 'get', httpPath: '/v1/network_programs', }, + { + clientCallName: 'client.holds.create', + fullyQualifiedName: 'holds.create', + httpMethod: 'post', + httpPath: '/v1/financial_accounts/{financial_account_token}/holds', + }, + { + clientCallName: 'client.holds.retrieve', + fullyQualifiedName: 'holds.retrieve', + httpMethod: 'get', + httpPath: '/v1/holds/{hold_token}', + }, + { + clientCallName: 'client.holds.list', + fullyQualifiedName: 'holds.list', + httpMethod: 'get', + httpPath: '/v1/financial_accounts/{financial_account_token}/holds', + }, + { + clientCallName: 'client.holds.void', + fullyQualifiedName: 'holds.void', + httpMethod: 'post', + httpPath: '/v1/holds/{hold_token}/void', + }, { clientCallName: 'client.accountActivity.list', fullyQualifiedName: 'accountActivity.list', diff --git a/packages/mcp-server/src/options.ts b/packages/mcp-server/src/options.ts index b9e8e8a6..f1518764 100644 --- a/packages/mcp-server/src/options.ts +++ b/packages/mcp-server/src/options.ts @@ -18,10 +18,13 @@ export type McpOptions = { includeCodeTool?: boolean | undefined; includeDocsTools?: boolean | undefined; stainlessApiKey?: string | undefined; + docsSearchMode?: 'stainless-api' | 'local' | undefined; + docsDir?: string | undefined; codeAllowHttpGets?: boolean | undefined; codeAllowedMethods?: string[] | undefined; codeBlockedMethods?: string[] | undefined; codeExecutionMode: McpCodeExecutionMode; + customInstructionsPath?: string | undefined; }; export type McpCodeExecutionMode = 'stainless-sandbox' | 'local'; @@ -52,7 +55,23 @@ export function parseCLIOptions(): CLIOptions { description: "Where to run code execution in code tool; 'stainless-sandbox' will execute code in Stainless-hosted sandboxes whereas 'local' will execute code locally on the MCP server machine.", }) + .option('custom-instructions-path', { + type: 'string', + description: 'Path to custom instructions for the MCP server', + }) .option('debug', { type: 'boolean', description: 'Enable debug logging' }) + .option('docs-dir', { + type: 'string', + description: + 'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.', + }) + .option('docs-search-mode', { + type: 'string', + choices: ['stainless-api', 'local'], + default: 'stainless-api', + description: + "Where to search documentation; 'stainless-api' uses the Stainless-hosted search API whereas 'local' uses an in-memory search index built from embedded SDK method data and optional local docs files.", + }) .option('log-format', { type: 'string', choices: ['json', 'pretty'], @@ -113,10 +132,13 @@ export function parseCLIOptions(): CLIOptions { ...(includeDocsTools !== undefined && { includeDocsTools }), debug: !!argv.debug, stainlessApiKey: argv.stainlessApiKey, + docsSearchMode: argv.docsSearchMode as 'stainless-api' | 'local' | undefined, + docsDir: argv.docsDir, codeAllowHttpGets: argv.codeAllowHttpGets, codeAllowedMethods: argv.codeAllowedMethods, codeBlockedMethods: argv.codeBlockedMethods, codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode, + customInstructionsPath: argv.customInstructionsPath, transport, logFormat, port: argv.port, @@ -157,5 +179,7 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M ...(codeTool !== undefined && { includeCodeTool: codeTool }), ...(docsTools !== undefined && { includeDocsTools: docsTools }), codeExecutionMode: defaultOptions.codeExecutionMode, + docsSearchMode: defaultOptions.docsSearchMode, + docsDir: defaultOptions.docsDir, }; } diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 44a5f7ea..6465ef6d 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -11,20 +11,28 @@ import { ClientOptions } from 'lithic'; import Lithic from 'lithic'; import { codeTool } from './code-tool'; import docsSearchTool from './docs-search-tool'; +import { setLocalSearch } from './docs-search-tool'; +import { LocalDocsSearch } from './local-docs-search'; import { getInstructions } from './instructions'; import { McpOptions } from './options'; import { blockedMethodsForCodeTool } from './methods'; import { HandlerFunction, McpRequestContext, ToolCallResult, McpTool } from './types'; import { readEnv } from './util'; -export const newMcpServer = async (stainlessApiKey: string | undefined) => +export const newMcpServer = async ({ + stainlessApiKey, + customInstructionsPath, +}: { + stainlessApiKey?: string | undefined; + customInstructionsPath?: string | undefined; +}) => new McpServer( { name: 'lithic_api', - version: '0.131.0', + version: '0.145.0', }, { - instructions: await getInstructions(stainlessApiKey), + instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }), capabilities: { tools: {}, logging: {} }, }, ); @@ -38,6 +46,9 @@ export async function initMcpServer(params: { clientOptions?: ClientOptions; mcpOptions?: McpOptions; stainlessApiKey?: string | undefined; + upstreamClientEnvs?: Record | undefined; + mcpSessionId?: string | undefined; + mcpClientInfo?: { name: string; version: string } | undefined; }) { const server = params.server instanceof McpServer ? params.server.server : params.server; @@ -56,6 +67,12 @@ export async function initMcpServer(params: { error: logAtLevel('error'), }; + if (params.mcpOptions?.docsSearchMode === 'local') { + const docsDir = params.mcpOptions?.docsDir; + const localSearch = await LocalDocsSearch.create(docsDir ? { docsDir } : undefined); + setLocalSearch(localSearch); + } + let _client: Lithic | undefined; let _clientError: Error | undefined; let _logLevel: 'debug' | 'info' | 'warn' | 'error' | 'off' | undefined; @@ -120,6 +137,9 @@ export async function initMcpServer(params: { reqContext: { client, stainlessApiKey: params.stainlessApiKey ?? params.mcpOptions?.stainlessApiKey, + upstreamClientEnvs: params.upstreamClientEnvs, + mcpSessionId: params.mcpSessionId, + mcpClientInfo: params.mcpClientInfo, }, args, }); diff --git a/packages/mcp-server/src/stdio.ts b/packages/mcp-server/src/stdio.ts index e8bcbb19..b04a5441 100644 --- a/packages/mcp-server/src/stdio.ts +++ b/packages/mcp-server/src/stdio.ts @@ -4,7 +4,10 @@ import { initMcpServer, newMcpServer } from './server'; import { getLogger } from './logger'; export const launchStdioServer = async (mcpOptions: McpOptions) => { - const server = await newMcpServer(mcpOptions.stainlessApiKey); + const server = await newMcpServer({ + stainlessApiKey: mcpOptions.stainlessApiKey, + customInstructionsPath: mcpOptions.customInstructionsPath, + }); await initMcpServer({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey }); diff --git a/packages/mcp-server/src/types.ts b/packages/mcp-server/src/types.ts index aab33389..21994833 100644 --- a/packages/mcp-server/src/types.ts +++ b/packages/mcp-server/src/types.ts @@ -45,6 +45,9 @@ export type ToolCallResult = { export type McpRequestContext = { client: Lithic; stainlessApiKey?: string | undefined; + upstreamClientEnvs?: Record | undefined; + mcpSessionId?: string | undefined; + mcpClientInfo?: { name: string; version: string } | undefined; }; export type HandlerFunction = ({ diff --git a/packages/mcp-server/src/util.ts b/packages/mcp-server/src/util.ts index 40ed5501..069a2b47 100644 --- a/packages/mcp-server/src/util.ts +++ b/packages/mcp-server/src/util.ts @@ -2,9 +2,9 @@ export const readEnv = (env: string): string | undefined => { if (typeof (globalThis as any).process !== 'undefined') { - return (globalThis as any).process.env?.[env]?.trim(); + return (globalThis as any).process.env?.[env]?.trim() || undefined; } else if (typeof (globalThis as any).Deno !== 'undefined') { - return (globalThis as any).Deno.env?.get?.(env)?.trim(); + return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined; } return; }; diff --git a/packages/mcp-server/yarn.lock b/packages/mcp-server/yarn.lock index 14529bc9..c6b17b02 100644 --- a/packages/mcp-server/yarn.lock +++ b/packages/mcp-server/yarn.lock @@ -297,61 +297,101 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": +"@eslint-community/eslint-utils@^4.4.0", "@eslint-community/eslint-utils@^4.8.0": version "4.9.1" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595" integrity sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ== dependencies: eslint-visitor-keys "^3.4.3" -"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.6.1": +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1": version "4.12.2" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.2.tgz#bccdf615bcf7b6e8db830ec0b8d21c9a25de597b" integrity sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew== -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== +"@eslint/config-array@^0.21.2": + version "0.21.2" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.2.tgz#f29e22057ad5316cf23836cee9a34c81fffcb7e6" + integrity sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw== dependencies: - ajv "^6.12.4" + "@eslint/object-schema" "^2.1.7" + debug "^4.3.1" + minimatch "^3.1.5" + +"@eslint/config-helpers@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz#1bd006ceeb7e2e55b2b773ab318d300e1a66aeda" + integrity sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw== + dependencies: + "@eslint/core" "^0.17.0" + +"@eslint/core@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.17.0.tgz#77225820413d9617509da9342190a2019e78761c" + integrity sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ== + dependencies: + "@types/json-schema" "^7.0.15" + +"@eslint/eslintrc@^3.3.5": + version "3.3.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.5.tgz#c131793cfc1a7b96f24a83e0a8bbd4b881558c60" + integrity sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg== + dependencies: + ajv "^6.14.0" debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" + espree "^10.0.1" + globals "^14.0.0" ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^4.1.0" - minimatch "^3.1.2" + js-yaml "^4.1.1" + minimatch "^3.1.5" strip-json-comments "^3.1.1" -"@eslint/js@8.57.1": - version "8.57.1" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.1.tgz#de633db3ec2ef6a3c89e2f19038063e8a122e2c2" - integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== +"@eslint/js@9.39.4": + version "9.39.4" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.39.4.tgz#a3f83bfc6fd9bf33a853dfacd0b49b398eb596c1" + integrity sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw== -"@hono/node-server@^1.19.9": - version "1.19.10" - resolved "https://registry.yarnpkg.com/@hono/node-server/-/node-server-1.19.10.tgz#e230fbb7fb31891cafc653d01deee03f437dd66b" - integrity sha512-hZ7nOssGqRgyV3FVVQdfi+U4q02uB23bpnYpdvNXkYTRRyWx84b7yf1ans+dnJ/7h41sGL3CeQTfO+ZGxuO+Iw== +"@eslint/object-schema@^2.1.7": + version "2.1.7" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.7.tgz#6e2126a1347e86a4dedf8706ec67ff8e107ebbad" + integrity sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA== -"@humanwhocodes/config-array@^0.13.0": - version "0.13.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748" - integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== +"@eslint/plugin-kit@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz#9779e3fd9b7ee33571a57435cf4335a1794a6cb2" + integrity sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA== dependencies: - "@humanwhocodes/object-schema" "^2.0.3" - debug "^4.3.1" - minimatch "^3.0.5" + "@eslint/core" "^0.17.0" + levn "^0.4.1" + +"@hono/node-server@^1.19.10", "@hono/node-server@^1.19.9": + version "1.19.11" + resolved "https://registry.yarnpkg.com/@hono/node-server/-/node-server-1.19.11.tgz#dc419f0826dd2504e9fc86ad289d5636a0444e2f" + integrity sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g== + +"@humanfs/core@^0.19.1": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77" + integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== + +"@humanfs/node@^0.16.6": + version "0.16.7" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.7.tgz#822cb7b3a12c5a240a24f621b5a2413e27a45f26" + integrity sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ== + dependencies: + "@humanfs/core" "^0.19.1" + "@humanwhocodes/retry" "^0.4.0" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@humanwhocodes/retry@^0.4.0", "@humanwhocodes/retry@^0.4.2": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" + integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== "@inquirer/checkbox@^3.0.1": version "3.0.1" @@ -741,7 +781,7 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@modelcontextprotocol/sdk@^1.26.0": +"@modelcontextprotocol/sdk@^1.27.1": version "1.27.1" resolved "https://registry.yarnpkg.com/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz#a602cf823bf8a68e13e7112f50aeb02b09fb83b9" integrity sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA== @@ -777,7 +817,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": +"@nodelib/fs.walk@^1.2.3": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -814,11 +854,6 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@stablelib/base64@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@stablelib/base64/-/base64-1.0.1.tgz#bdfc1c6d3a62d7a3b7bbc65b6cce1bb4561641be" - integrity sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ== - "@ts-morph/common@~0.20.0": version "0.20.0" resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" @@ -909,6 +944,11 @@ dependencies: "@types/node" "*" +"@types/estree@^1.0.6": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + "@types/express-serve-static-core@^5.0.0": version "5.1.1" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.1.1.tgz#1a77faffee9572d39124933259be2523837d7eaa" @@ -967,6 +1007,11 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/json-schema@^7.0.15": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/mute-stream@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" @@ -1116,11 +1161,6 @@ "@typescript-eslint/types" "8.31.1" eslint-visitor-keys "^4.2.0" -"@ungap/structured-clone@^1.2.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8" - integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== - "@valtown/deno-http-worker@^0.0.21": version "0.0.21" resolved "https://registry.yarnpkg.com/@valtown/deno-http-worker/-/deno-http-worker-0.0.21.tgz#9ce3b5c1d0db211fe7ea8297881fe551838474ad" @@ -1146,11 +1186,16 @@ acorn-walk@^8.1.1: dependencies: acorn "^8.11.0" -acorn@^8.11.0, acorn@^8.4.1, acorn@^8.9.0: +acorn@^8.11.0, acorn@^8.4.1: version "8.15.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== +acorn@^8.15.0: + version "8.16.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" + integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -1166,10 +1211,10 @@ ajv-formats@^3.0.1: dependencies: ajv "^8.0.0" -ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== +ajv@^6.14.0: + version "6.14.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.14.0.tgz#fd067713e228210636ebb08c60bd3765d6dbe73a" + integrity sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" @@ -1186,6 +1231,16 @@ ajv@^8.0.0, ajv@^8.17.1: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" +ajv@^8.18.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.18.0.tgz#8864186b6738d003eb3a933172bb3833e10cefbc" + integrity sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -1574,7 +1629,7 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^7.0.2, cross-spawn@^7.0.3, cross-spawn@^7.0.5: +cross-spawn@^7.0.3, cross-spawn@^7.0.5, cross-spawn@^7.0.6: version "7.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== @@ -1630,13 +1685,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - dunder-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" @@ -1722,7 +1770,7 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-prettier@^5.0.1: +eslint-plugin-prettier@^5.4.1: version "5.5.5" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.5.tgz#9eae11593faa108859c26f9a9c367d619a0769c0" integrity sha512-hscXkbqUZ2sPithAuLm5MXL+Wph+U7wHngPBv9OMWwlP8iaflyxpjTYZkmdgB4/vPIhemRlBEoLrH7UC1n7aUw== @@ -1730,95 +1778,84 @@ eslint-plugin-prettier@^5.0.1: prettier-linter-helpers "^1.0.1" synckit "^0.11.12" -eslint-plugin-unused-imports@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.2.0.tgz#63a98c9ad5f622cd9f830f70bc77739f25ccfe0d" - integrity sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ== - dependencies: - eslint-rule-composer "^0.3.0" - -eslint-rule-composer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" - integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== +eslint-plugin-unused-imports@^4.1.4: + version "4.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.4.1.tgz#a831f0a2937d7631eba30cb87091ab7d3a5da0e1" + integrity sha512-oZGYUz1X3sRMGUB+0cZyK2VcvRX5lm/vB56PgNNcU+7ficUCKm66oZWKUubXWnOuPjQ8PvmXtCViXBMONPe7tQ== -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== +eslint-scope@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82" + integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint-visitor-keys@^4.2.0: +eslint-visitor-keys@^4.2.0, eslint-visitor-keys@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== -eslint@^8.49.0: - version "8.57.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.1.tgz#7df109654aba7e3bbe5c8eae533c5e461d3c6ca9" - integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.1" - "@humanwhocodes/config-array" "^0.13.0" +eslint@^9.39.1: + version "9.39.4" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.4.tgz#855da1b2e2ad66dc5991195f35e262bcec8117b5" + integrity sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ== + dependencies: + "@eslint-community/eslint-utils" "^4.8.0" + "@eslint-community/regexpp" "^4.12.1" + "@eslint/config-array" "^0.21.2" + "@eslint/config-helpers" "^0.4.2" + "@eslint/core" "^0.17.0" + "@eslint/eslintrc" "^3.3.5" + "@eslint/js" "9.39.4" + "@eslint/plugin-kit" "^0.4.1" + "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" - ajv "^6.12.4" + "@humanwhocodes/retry" "^0.4.2" + "@types/estree" "^1.0.6" + ajv "^6.14.0" chalk "^4.0.0" - cross-spawn "^7.0.2" + cross-spawn "^7.0.6" debug "^4.3.2" - doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" + eslint-scope "^8.4.0" + eslint-visitor-keys "^4.2.1" + espree "^10.4.0" + esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" + file-entry-cache "^8.0.0" find-up "^5.0.0" glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.1.2" + minimatch "^3.1.5" natural-compare "^1.4.0" optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== +espree@^10.0.1, espree@^10.4.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837" + integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ== dependencies: - acorn "^8.9.0" + acorn "^8.15.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" + eslint-visitor-keys "^4.2.1" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.2: +esquery@^1.5.0: version "1.7.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.7.0.tgz#08d048f261f0ddedb5bae95f46809463d9c9496d" integrity sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g== @@ -1891,11 +1928,11 @@ expect@^29.0.0, expect@^29.7.0: jest-util "^29.7.0" express-rate-limit@^8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-8.2.1.tgz#ec75fdfe280ecddd762b8da8784c61bae47d7f7f" - integrity sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g== + version "8.3.1" + resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-8.3.1.tgz#0aaba098eadd40f6737f30a98e6b16fa1a29edfb" + integrity sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw== dependencies: - ip-address "10.0.1" + ip-address "10.1.0" express@^5.1.0, express@^5.2.1: version "5.2.1" @@ -1981,11 +2018,6 @@ fast-safe-stringify@^2.1.1: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== -fast-sha256@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fast-sha256/-/fast-sha256-1.3.0.tgz#7916ba2054eeb255982608cccd0f6660c79b7ae6" - integrity sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ== - fast-uri@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa" @@ -2010,12 +2042,12 @@ fflate@^0.8.2: resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.0.4" + flat-cache "^4.0.0" fill-range@^7.1.1: version "7.1.1" @@ -2052,14 +2084,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== dependencies: flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" + keyv "^4.5.4" flatted@^3.2.9: version "3.3.3" @@ -2197,12 +2228,10 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^13.19.0: - version "13.24.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== gopd@^1.2.0: version "1.2.0" @@ -2253,10 +2282,10 @@ help-me@^5.0.0: resolved "https://registry.yarnpkg.com/help-me/-/help-me-5.0.0.tgz#b1ebe63b967b74060027c2ac61f9be12d354a6f6" integrity sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg== -hono@^4.11.4: - version "4.12.4" - resolved "https://registry.yarnpkg.com/hono/-/hono-4.12.4.tgz#fcfb5a064b90d5203dd41231e0d5a67262fc1729" - integrity sha512-ooiZW1Xy8rQ4oELQ++otI2T9DsKpV0M6c6cO6JGx4RTfav9poFFLlet9UMXHZnoM1yG0HWGlQLswBGX3RZmHtg== +hono@^4.11.4, hono@^4.12.4: + version "4.12.7" + resolved "https://registry.yarnpkg.com/hono/-/hono-4.12.7.tgz#ca000956e965c2b3d791e43540498e616d6c6442" + integrity sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw== html-escaper@^2.0.0: version "2.0.2" @@ -2342,10 +2371,10 @@ inherits@2, inherits@^2.0.3, inherits@~2.0.4: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ip-address@10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-10.0.1.tgz#a8180b783ce7788777d796286d61bce4276818ed" - integrity sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA== +ip-address@10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-10.1.0.tgz#d8dcffb34d0e02eb241427444a6e23f5b0595aa4" + integrity sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q== ipaddr.js@1.9.1: version "1.9.1" @@ -2391,11 +2420,6 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - is-promise@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" @@ -2823,9 +2847,9 @@ jest@^29.4.0: jest-cli "^29.7.0" jose@^6.1.3: - version "6.1.3" - resolved "https://registry.yarnpkg.com/jose/-/jose-6.1.3.tgz#8453d7be88af7bb7d64a0481d6a35a0145ba3ea5" - integrity sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ== + version "6.2.1" + resolved "https://registry.yarnpkg.com/jose/-/jose-6.2.1.tgz#7a6b1de83816deaee9055a558e1278a7b2b9ea1b" + integrity sha512-jUaKr1yrbfaImV7R2TN/b3IcZzsw38/chqMpo2XJ7i2F8AfM/lA4G1goC3JVEwg0H7UldTmSt3P68nt31W7/mw== joycon@^3.1.1: version "3.1.1" @@ -2849,7 +2873,7 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: +js-yaml@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== @@ -2905,7 +2929,7 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -keyv@^4.5.3: +keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== @@ -2935,11 +2959,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -"lithic@file:../../dist": - version "0.130.0" - dependencies: - standardwebhooks "^1.0.0" - locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -3040,10 +3059,10 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.5.tgz#580c88f8d5445f2bd6aa8f3cadefa0de79fbd69e" + integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== dependencies: brace-expansion "^1.1.7" @@ -3527,13 +3546,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - router@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/router/-/router-2.2.0.tgz#019be620b711c87641167cc79b99090f00b146ef" @@ -3723,14 +3735,6 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -standardwebhooks@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/standardwebhooks/-/standardwebhooks-1.0.0.tgz#5faa23ceacbf9accd344361101d9e3033b64324f" - integrity sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg== - dependencies: - "@stablelib/base64" "^1.0.0" - fast-sha256 "^1.3.0" - statuses@^2.0.1, statuses@^2.0.2, statuses@~2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" @@ -3839,11 +3843,6 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - thread-stream@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-4.0.0.tgz#732f007c24da7084f729d6e3a7e3f5934a7380b7" @@ -3922,9 +3921,9 @@ ts-node@^10.5.0: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz": - version "1.1.9" - resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz#777f6f5d9e26bf0e94e5170990dd3a841d6707cd" +"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz": + version "1.1.11" + resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz#010247051be13b55abdc98f787c017285149f4f2" dependencies: debug "^4.3.7" fast-glob "^3.3.2" @@ -3963,11 +3962,6 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" diff --git a/scripts/bootstrap b/scripts/bootstrap index a8b69ff3..2e315f53 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response diff --git a/scripts/build b/scripts/build index 8847b24d..a1ba882a 100755 --- a/scripts/build +++ b/scripts/build @@ -52,6 +52,6 @@ fi # build all sub-packages for dir in packages/*; do if [ -d "$dir" ]; then - (cd "$dir" && yarn install && yarn build) + (cd "$dir" && yarn install --pure-lockfile && yarn build) fi done diff --git a/scripts/fast-format b/scripts/fast-format index 53721ac0..f1873aef 100755 --- a/scripts/fast-format +++ b/scripts/fast-format @@ -31,10 +31,7 @@ if ! [ -z "$ESLINT_FILES" ]; then fi echo "==> Running prettier --write" -# format things eslint didn't -PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" -if ! [ -z "$PRETTIER_FILES" ]; then - echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ - --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ - '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +if ! [ -z "$FILE_LIST" ]; then + cat "$FILE_LIST" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern --ignore-unknown fi diff --git a/scripts/format b/scripts/format index 7a756401..b1b2c17a 100755 --- a/scripts/format +++ b/scripts/format @@ -8,5 +8,4 @@ echo "==> Running eslint --fix" ./node_modules/.bin/eslint --fix . echo "==> Running prettier --write" -# format things eslint didn't -./node_modules/.bin/prettier --write --cache --cache-strategy metadata . '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +./node_modules/.bin/prettier --write --cache --cache-strategy metadata . diff --git a/scripts/lint b/scripts/lint index 3ffb78a6..1f532548 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,6 +4,9 @@ set -e cd "$(dirname "$0")/.." +echo "==> Running prettier --check" +./node_modules/.bin/prettier --check . + echo "==> Running eslint" ./node_modules/.bin/eslint . diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index deae575e..a8cdeb7c 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -23,12 +23,19 @@ async function postprocess() { // strip out lib="dom", types="node", and types="react" references; these // are needed at build time, but would pollute the user's TS environment - const transformed = code.replace( + let transformed = code.replace( /^ *\/\/\/ * ' '.repeat(match.length - 1) + '\n', ); + // TypeScript's declaration emitter collapses /** @ts-ignore */ onto the same + // line as the type declaration, which doesn't work. So we convert to // @ts-ignore + // on its own line to properly suppresses errors. + if (file.endsWith('.d.ts') || file.endsWith('.d.mts') || file.endsWith('.d.cts')) { + transformed = transformed.replace(/\/\*\* @ts-ignore\b[^*]*\*\/ /gm, '// @ts-ignore\n'); + } + if (transformed !== code) { console.error(`wrote ${path.relative(process.cwd(), file)}`); await fs.promises.writeFile(file, transformed, 'utf8'); diff --git a/src/client.ts b/src/client.ts index c49a950f..980f9079 100644 --- a/src/client.ts +++ b/src/client.ts @@ -53,6 +53,11 @@ import { BookTransferReverseParams, BookTransfers, } from './resources/book-transfers'; +import { + CardAuthorization, + CardAuthorizationChallengeResponseParams, + CardAuthorizations, +} from './resources/card-authorizations'; import { CardBulkOrder, CardBulkOrderCreateParams, @@ -106,6 +111,15 @@ import { FundingEvents, FundingEventsCursorPage, } from './resources/funding-events'; +import { + Hold, + HoldCreateParams, + HoldEvent, + HoldListParams, + HoldVoidParams, + Holds, + HoldsCursorPage, +} from './resources/holds'; import { InternalTransaction, InternalTransactionResource } from './resources/internal-transaction'; import { ExternalResource, @@ -186,6 +200,8 @@ import { BookTransferTransactionCreatedWebhookEvent, BookTransferTransactionUpdatedWebhookEvent, CardAuthorizationApprovalRequestWebhookEvent, + CardAuthorizationChallengeResponseWebhookEvent, + CardAuthorizationChallengeWebhookEvent, CardConvertedWebhookEvent, CardCreatedWebhookEvent, CardReissuedWebhookEvent, @@ -195,6 +211,11 @@ import { CardTransactionEnhancedDataUpdatedWebhookEvent, CardTransactionUpdatedWebhookEvent, CardUpdatedWebhookEvent, + ClaimCreatedWebhookEvent, + ClaimDocumentAcceptedWebhookEvent, + ClaimDocumentRejectedWebhookEvent, + ClaimDocumentUploadedWebhookEvent, + ClaimUpdatedWebhookEvent, DigitalWalletTokenizationApprovalRequestWebhookEvent, DigitalWalletTokenizationResultWebhookEvent, DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, @@ -204,6 +225,8 @@ import { DisputeTransactionCreatedWebhookEvent, DisputeTransactionUpdatedWebhookEvent, DisputeUpdatedWebhookEvent, + EmbedSessionGeneratedWebhookEvent, + EmbedViewedWebhookEvent, ExternalBankAccountCreatedWebhookEvent, ExternalBankAccountUpdatedWebhookEvent, ExternalPaymentCreatedWebhookEvent, @@ -229,7 +252,6 @@ import { ThreeDSAuthenticationCreatedWebhookEvent, ThreeDSAuthenticationUpdatedWebhookEvent, TokenizationApprovalRequestWebhookEvent, - TokenizationDecisioningRequestWebhookEvent, TokenizationResultWebhookEvent, TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, TokenizationTwoFactorAuthenticationCodeWebhookEvent, @@ -258,7 +280,7 @@ import { KYCExempt, RequiredDocument, } from './resources/account-holders/account-holders'; -import { AuthRules } from './resources/auth-rules/auth-rules'; +import { AuthRules, SignalsResponse } from './resources/auth-rules/auth-rules'; import { Card, CardConvertPhysicalParams, @@ -304,6 +326,7 @@ import { ExternalBankAccountRetryMicroDepositsParams, ExternalBankAccountRetryMicroDepositsResponse, ExternalBankAccountRetryPrenoteParams, + ExternalBankAccountSetVerificationMethodParams, ExternalBankAccountUpdateParams, ExternalBankAccountUpdateResponse, ExternalBankAccounts, @@ -333,11 +356,13 @@ import { SettlementSummaryDetails, } from './resources/reports/reports'; import { ThreeDS, ThreeDSAuthentication } from './resources/three-ds/three-ds'; +import { TransactionMonitoring } from './resources/transaction-monitoring/transaction-monitoring'; import { CardholderAuthentication, TokenInfo, Transaction, TransactionListParams, + TransactionRouteParams, TransactionSimulateAuthorizationAdviceParams, TransactionSimulateAuthorizationAdviceResponse, TransactionSimulateAuthorizationParams, @@ -539,6 +564,18 @@ export class Lithic { this.fetch = options.fetch ?? Shims.getDefaultFetch(); this.#encoder = Opts.FallbackEncoder; + const customHeadersEnv = readEnv('LITHIC_CUSTOM_HEADERS'); + if (customHeadersEnv) { + const parsed: Record = {}; + for (const line of customHeadersEnv.split('\n')) { + const colon = line.indexOf(':'); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + this._options = options; this.apiKey = apiKey; @@ -625,8 +662,9 @@ export class Lithic { : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query }; + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query }; } if (typeof query === 'object' && query && !Array.isArray(query)) { @@ -1055,11 +1093,19 @@ export class Lithic { return () => controller.abort(); } - private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): { + private buildBody({ options }: { options: FinalRequestOptions }): { bodyHeaders: HeadersLike; body: BodyInit | undefined; } { + const { body, headers: rawHeaders } = options; if (!body) { + // A resource method always passes a `body` key when its operation defines a + // request body, even if the caller omitted an optional body param. Keep the + // content-type for those, and only elide it for operations with no body at + // all (e.g. GET/DELETE). + if (body == null && 'body' in options) { + return this.#encoder({ body, headers: buildHeaders([rawHeaders]) }); + } return { bodyHeaders: undefined, body: undefined }; } const headers = buildHeaders([rawHeaders]); @@ -1122,10 +1168,12 @@ export class Lithic { accounts: API.Accounts = new API.Accounts(this); accountHolders: API.AccountHolders = new API.AccountHolders(this); authRules: API.AuthRules = new API.AuthRules(this); + transactionMonitoring: API.TransactionMonitoring = new API.TransactionMonitoring(this); authStreamEnrollment: API.AuthStreamEnrollment = new API.AuthStreamEnrollment(this); tokenizationDecisioning: API.TokenizationDecisioning = new API.TokenizationDecisioning(this); tokenizations: API.Tokenizations = new API.Tokenizations(this); cards: API.Cards = new API.Cards(this); + cardAuthorizations: API.CardAuthorizations = new API.CardAuthorizations(this); cardBulkOrders: API.CardBulkOrders = new API.CardBulkOrders(this); balances: API.Balances = new API.Balances(this); disputes: API.Disputes = new API.Disputes(this); @@ -1149,6 +1197,7 @@ export class Lithic { fundingEvents: API.FundingEvents = new API.FundingEvents(this); fraud: API.Fraud = new API.Fraud(this); networkPrograms: API.NetworkPrograms = new API.NetworkPrograms(this); + holds: API.Holds = new API.Holds(this); accountActivity: API.AccountActivity = new API.AccountActivity(this); transferLimits: API.TransferLimits = new API.TransferLimits(this); webhooks: API.Webhooks = new API.Webhooks(this); @@ -1157,10 +1206,12 @@ export class Lithic { Lithic.Accounts = Accounts; Lithic.AccountHolders = AccountHolders; Lithic.AuthRules = AuthRules; +Lithic.TransactionMonitoring = TransactionMonitoring; Lithic.AuthStreamEnrollment = AuthStreamEnrollment; Lithic.TokenizationDecisioning = TokenizationDecisioning; Lithic.Tokenizations = Tokenizations; Lithic.Cards = Cards; +Lithic.CardAuthorizations = CardAuthorizations; Lithic.CardBulkOrders = CardBulkOrders; Lithic.Balances = Balances; Lithic.Disputes = Disputes; @@ -1184,6 +1235,7 @@ Lithic.InternalTransactionResource = InternalTransactionResource; Lithic.FundingEvents = FundingEvents; Lithic.Fraud = Fraud; Lithic.NetworkPrograms = NetworkPrograms; +Lithic.Holds = Holds; Lithic.AccountActivity = AccountActivity; Lithic.TransferLimits = TransferLimits; Lithic.Webhooks = Webhooks; @@ -1231,7 +1283,9 @@ export declare namespace Lithic { type AccountHolderUploadDocumentParams as AccountHolderUploadDocumentParams, }; - export { AuthRules as AuthRules }; + export { AuthRules as AuthRules, type SignalsResponse as SignalsResponse }; + + export { TransactionMonitoring as TransactionMonitoring }; export { AuthStreamEnrollment as AuthStreamEnrollment, type AuthStreamSecret as AuthStreamSecret }; @@ -1280,6 +1334,12 @@ export declare namespace Lithic { type CardWebProvisionParams as CardWebProvisionParams, }; + export { + CardAuthorizations as CardAuthorizations, + type CardAuthorization as CardAuthorization, + type CardAuthorizationChallengeResponseParams as CardAuthorizationChallengeResponseParams, + }; + export { CardBulkOrders as CardBulkOrders, type CardBulkOrder as CardBulkOrder, @@ -1365,6 +1425,7 @@ export declare namespace Lithic { type TransactionSimulateVoidResponse as TransactionSimulateVoidResponse, type TransactionsCursorPage as TransactionsCursorPage, type TransactionListParams as TransactionListParams, + type TransactionRouteParams as TransactionRouteParams, type TransactionSimulateAuthorizationParams as TransactionSimulateAuthorizationParams, type TransactionSimulateAuthorizationAdviceParams as TransactionSimulateAuthorizationAdviceParams, type TransactionSimulateClearingParams as TransactionSimulateClearingParams, @@ -1401,6 +1462,7 @@ export declare namespace Lithic { type ExternalBankAccountListParams as ExternalBankAccountListParams, type ExternalBankAccountRetryMicroDepositsParams as ExternalBankAccountRetryMicroDepositsParams, type ExternalBankAccountRetryPrenoteParams as ExternalBankAccountRetryPrenoteParams, + type ExternalBankAccountSetVerificationMethodParams as ExternalBankAccountSetVerificationMethodParams, }; export { @@ -1503,6 +1565,16 @@ export declare namespace Lithic { type NetworkProgramListParams as NetworkProgramListParams, }; + export { + Holds as Holds, + type Hold as Hold, + type HoldEvent as HoldEvent, + type HoldsCursorPage as HoldsCursorPage, + type HoldCreateParams as HoldCreateParams, + type HoldListParams as HoldListParams, + type HoldVoidParams as HoldVoidParams, + }; + export { AccountActivity as AccountActivity, type WirePartyDetails as WirePartyDetails, @@ -1526,7 +1598,8 @@ export declare namespace Lithic { type AccountHolderVerificationWebhookEvent as AccountHolderVerificationWebhookEvent, type AccountHolderDocumentUpdatedWebhookEvent as AccountHolderDocumentUpdatedWebhookEvent, type CardAuthorizationApprovalRequestWebhookEvent as CardAuthorizationApprovalRequestWebhookEvent, - type TokenizationDecisioningRequestWebhookEvent as TokenizationDecisioningRequestWebhookEvent, + type CardAuthorizationChallengeWebhookEvent as CardAuthorizationChallengeWebhookEvent, + type CardAuthorizationChallengeResponseWebhookEvent as CardAuthorizationChallengeResponseWebhookEvent, type AuthRulesBacktestReportCreatedWebhookEvent as AuthRulesBacktestReportCreatedWebhookEvent, type BalanceUpdatedWebhookEvent as BalanceUpdatedWebhookEvent, type BookTransferTransactionCreatedWebhookEvent as BookTransferTransactionCreatedWebhookEvent, @@ -1540,6 +1613,11 @@ export declare namespace Lithic { type CardTransactionUpdatedWebhookEvent as CardTransactionUpdatedWebhookEvent, type CardTransactionEnhancedDataCreatedWebhookEvent as CardTransactionEnhancedDataCreatedWebhookEvent, type CardTransactionEnhancedDataUpdatedWebhookEvent as CardTransactionEnhancedDataUpdatedWebhookEvent, + type ClaimCreatedWebhookEvent as ClaimCreatedWebhookEvent, + type ClaimUpdatedWebhookEvent as ClaimUpdatedWebhookEvent, + type ClaimDocumentUploadedWebhookEvent as ClaimDocumentUploadedWebhookEvent, + type ClaimDocumentAcceptedWebhookEvent as ClaimDocumentAcceptedWebhookEvent, + type ClaimDocumentRejectedWebhookEvent as ClaimDocumentRejectedWebhookEvent, type DigitalWalletTokenizationApprovalRequestWebhookEvent as DigitalWalletTokenizationApprovalRequestWebhookEvent, type DigitalWalletTokenizationResultWebhookEvent as DigitalWalletTokenizationResultWebhookEvent, type DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent as DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, @@ -1547,6 +1625,8 @@ export declare namespace Lithic { type DigitalWalletTokenizationUpdatedWebhookEvent as DigitalWalletTokenizationUpdatedWebhookEvent, type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent, type DisputeEvidenceUploadFailedWebhookEvent as DisputeEvidenceUploadFailedWebhookEvent, + type EmbedSessionGeneratedWebhookEvent as EmbedSessionGeneratedWebhookEvent, + type EmbedViewedWebhookEvent as EmbedViewedWebhookEvent, type ExternalBankAccountCreatedWebhookEvent as ExternalBankAccountCreatedWebhookEvent, type ExternalBankAccountUpdatedWebhookEvent as ExternalBankAccountUpdatedWebhookEvent, type ExternalPaymentCreatedWebhookEvent as ExternalPaymentCreatedWebhookEvent, diff --git a/src/internal/types.ts b/src/internal/types.ts index b668dfc0..a050513a 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -40,7 +40,6 @@ type OverloadedParameters = : T extends (...args: infer A) => unknown ? A : never; -/* eslint-disable */ /** * These imports attempt to get types from a parent package's dependencies. * Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which @@ -63,19 +62,18 @@ type OverloadedParameters = * * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition */ -/** @ts-ignore For users with \@types/node */ +/** @ts-ignore For users with \@types/node */ /* prettier-ignore */ type UndiciTypesRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with undici */ +/** @ts-ignore For users with undici */ /* prettier-ignore */ type UndiciRequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with \@types/bun */ +/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */ type BunRequestInit = globalThis.FetchRequestInit; -/** @ts-ignore For users with node-fetch@2 */ +/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */ type NodeFetch2RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ +/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */ type NodeFetch3RequestInit = NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny | NotAny; -/** @ts-ignore For users who use Deno */ +/** @ts-ignore For users who use Deno */ /* prettier-ignore */ type FetchRequestInit = NonNullable[1]>; -/* eslint-enable */ type RequestInits = | NotAny diff --git a/src/internal/utils/env.ts b/src/internal/utils/env.ts index 2d848007..cc5fa0fa 100644 --- a/src/internal/utils/env.ts +++ b/src/internal/utils/env.ts @@ -9,10 +9,10 @@ */ export const readEnv = (env: string): string | undefined => { if (typeof (globalThis as any).process !== 'undefined') { - return (globalThis as any).process.env?.[env]?.trim() ?? undefined; + return (globalThis as any).process.env?.[env]?.trim() || undefined; } if (typeof (globalThis as any).Deno !== 'undefined') { - return (globalThis as any).Deno.env?.get?.(env)?.trim(); + return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined; } return undefined; }; diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts index a646c534..95d2eee8 100644 --- a/src/internal/utils/log.ts +++ b/src/internal/utils/log.ts @@ -107,6 +107,8 @@ export const formatRequestDetails = (details: { name, ( name.toLowerCase() === 'authorization' || + name.toLowerCase() === 'api-key' || + name.toLowerCase() === 'x-api-key' || name.toLowerCase() === 'cookie' || name.toLowerCase() === 'set-cookie' ) ? diff --git a/src/resources/account-activity.ts b/src/resources/account-activity.ts index fba9ee6e..cb98eaa7 100644 --- a/src/resources/account-activity.ts +++ b/src/resources/account-activity.ts @@ -3,6 +3,7 @@ import { APIResource } from '../core/resource'; import * as BookTransfersAPI from './book-transfers'; import * as ExternalPaymentsAPI from './external-payments'; +import * as HoldsAPI from './holds'; import * as ManagementOperationsAPI from './management-operations'; import * as PaymentsAPI from './payments'; import * as Shared from './shared'; @@ -66,7 +67,8 @@ export interface WirePartyDetails { * which transaction type is returned: INTERNAL returns FinancialTransaction, * TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT * returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, - * and MANAGEMENT_OPERATION returns ManagementOperationTransaction + * MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + * HoldTransaction */ export type AccountActivityListResponse = | AccountActivityListResponse.FinancialTransaction @@ -74,7 +76,8 @@ export type AccountActivityListResponse = | AccountActivityListResponse.CardTransaction | PaymentsAPI.Payment | ExternalPaymentsAPI.ExternalPayment - | ManagementOperationsAPI.ManagementOperationTransaction; + | ManagementOperationsAPI.ManagementOperationTransaction + | HoldsAPI.Hold; export namespace AccountActivityListResponse { /** @@ -91,6 +94,8 @@ export namespace AccountActivityListResponse { */ category: | 'ACH' + | 'WIRE' + | 'STABLECOIN' | 'BALANCE_OR_FUNDING' | 'FEE' | 'REWARD' @@ -109,7 +114,9 @@ export namespace AccountActivityListResponse { | 'MANAGEMENT_FEE' | 'MANAGEMENT_REWARD' | 'MANAGEMENT_DISBURSEMENT' - | 'PROGRAM_FUNDING'; + | 'HOLD' + | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER'; /** * ISO 8601 timestamp of when the transaction was created @@ -203,7 +210,8 @@ export namespace AccountActivityListResponse { * which transaction type is returned: INTERNAL returns FinancialTransaction, * TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT * returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, - * and MANAGEMENT_OPERATION returns ManagementOperationTransaction + * MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + * HoldTransaction */ export type AccountActivityRetrieveTransactionResponse = | AccountActivityRetrieveTransactionResponse.FinancialTransaction @@ -211,7 +219,8 @@ export type AccountActivityRetrieveTransactionResponse = | AccountActivityRetrieveTransactionResponse.CardTransaction | PaymentsAPI.Payment | ExternalPaymentsAPI.ExternalPayment - | ManagementOperationsAPI.ManagementOperationTransaction; + | ManagementOperationsAPI.ManagementOperationTransaction + | HoldsAPI.Hold; export namespace AccountActivityRetrieveTransactionResponse { /** @@ -228,6 +237,8 @@ export namespace AccountActivityRetrieveTransactionResponse { */ category: | 'ACH' + | 'WIRE' + | 'STABLECOIN' | 'BALANCE_OR_FUNDING' | 'FEE' | 'REWARD' @@ -246,7 +257,9 @@ export namespace AccountActivityRetrieveTransactionResponse { | 'MANAGEMENT_FEE' | 'MANAGEMENT_REWARD' | 'MANAGEMENT_DISBURSEMENT' - | 'PROGRAM_FUNDING'; + | 'HOLD' + | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER'; /** * ISO 8601 timestamp of when the transaction was created @@ -357,6 +370,8 @@ export interface AccountActivityListParams extends CursorPageParams { */ category?: | 'ACH' + | 'WIRE' + | 'STABLECOIN' | 'BALANCE_OR_FUNDING' | 'FEE' | 'REWARD' @@ -375,7 +390,9 @@ export interface AccountActivityListParams extends CursorPageParams { | 'MANAGEMENT_FEE' | 'MANAGEMENT_REWARD' | 'MANAGEMENT_DISBURSEMENT' - | 'PROGRAM_FUNDING'; + | 'HOLD' + | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER'; /** * Date string in RFC 3339 format. Only entries created before the specified time diff --git a/src/resources/account-holders/account-holders.ts b/src/resources/account-holders/account-holders.ts index 39d12907..8ffa9be3 100644 --- a/src/resources/account-holders/account-holders.ts +++ b/src/resources/account-holders/account-holders.ts @@ -272,8 +272,8 @@ export class AccountHolders extends APIResource { * * This endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state. * - * Uploaded images must either be a `jpg` or `png` file, and each must be less than - * 15 MiB. Once both required uploads have been successfully completed, your + * Supported file types include `jpg`, `png`, and `pdf`. Each file must be less + * than 15 MiB. Once both required uploads have been successfully completed, your * document will be run through KYC verification. * * If you have registered a webhook, you will receive evaluation updates for any @@ -736,7 +736,8 @@ export interface KYB { /** * Short description of the company's line of business (i.e., what does the company - * do?). + * do?). Values longer than 255 characters will be truncated before KYB + * verification */ nature_of_business: string; @@ -952,7 +953,7 @@ export interface KYBBusinessEntity { /** * Parent company name (if applicable). */ - parent_company?: string; + parent_company?: string | null; } export namespace KYBBusinessEntity { @@ -1283,7 +1284,7 @@ export namespace AccountHolderUpdateResponse { email?: string; /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account * holder is not KYC-Exempt. */ exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; @@ -1838,16 +1839,16 @@ export interface AccountHolderSimulateEnrollmentReviewResponse { email?: string; /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + * The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account * holder is not KYC-Exempt. */ - exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER'; + exemption_type?: 'AUTHORIZED_USER' | 'PREPAID_CARD_USER' | null; /** * Customer-provided token that indicates a relationship with an object outside of * the Lithic ecosystem. */ - external_id?: string; + external_id?: string | null; /** * Only present when user_type == "INDIVIDUAL". Information about the individual @@ -1859,7 +1860,7 @@ export interface AccountHolderSimulateEnrollmentReviewResponse { * Only present when user_type == "BUSINESS". 6-digit North American Industry * Classification System (NAICS) code for the business. */ - naics_code?: string; + naics_code?: string | null; /** * Only present when user_type == "BUSINESS". User-submitted description of the @@ -2282,7 +2283,8 @@ export declare namespace AccountHolderCreateParams { /** * Short description of the company's line of business (i.e., what does the company - * do?). + * do?). Values longer than 255 characters will be truncated before KYB + * verification */ nature_of_business: string; @@ -2506,7 +2508,8 @@ export declare namespace AccountHolderCreateParams { /** * Short description of the company's line of business (i.e., what does the company - * do?). + * do?). Values longer than 255 characters will be truncated before KYB + * verification */ nature_of_business?: string; @@ -2570,30 +2573,36 @@ export declare namespace AccountHolderCreateParams { } /** - * Individuals associated with a KYB application. Phone number is optional. + * Individuals associated with a KYB_DELEGATED application. Only first and last + * name are required. */ export interface BeneficialOwnerIndividual { + /** + * Individual's first name, as it appears on government-issued identity documents. + */ + first_name: string; + + /** + * Individual's last name, as it appears on government-issued identity documents. + */ + last_name: string; + /** * Individual's current address - PO boxes, UPS drops, and FedEx drops are not * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. */ - address: Shared.Address; + address?: Shared.Address; /** * Individual's date of birth, as an RFC 3339 date. */ - dob: string; + dob?: string; /** * Individual's email address. If utilizing Lithic for chargeback processing, this * customer email address may be used to communicate dispute status and resolution. */ - email: string; - - /** - * Individual's first name, as it appears on government-issued identity documents. - */ - first_name: string; + email?: string; /** * Government-issued identification number (required for identity verification and @@ -2601,12 +2610,7 @@ export declare namespace AccountHolderCreateParams { * Individual Taxpayer Identification Numbers (ITIN) are currently supported, * entered as full nine-digits, with or without hyphens */ - government_id: string; - - /** - * Individual's last name, as it appears on government-issued identity documents. - */ - last_name: string; + government_id?: string; /** * Individual's phone number, entered in E.164 format. @@ -2625,27 +2629,32 @@ export declare namespace AccountHolderCreateParams { * (Section II) for more background. */ export interface ControlPerson { + /** + * Individual's first name, as it appears on government-issued identity documents. + */ + first_name: string; + + /** + * Individual's last name, as it appears on government-issued identity documents. + */ + last_name: string; + /** * Individual's current address - PO boxes, UPS drops, and FedEx drops are not * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. */ - address: Shared.Address; + address?: Shared.Address; /** * Individual's date of birth, as an RFC 3339 date. */ - dob: string; + dob?: string; /** * Individual's email address. If utilizing Lithic for chargeback processing, this * customer email address may be used to communicate dispute status and resolution. */ - email: string; - - /** - * Individual's first name, as it appears on government-issued identity documents. - */ - first_name: string; + email?: string; /** * Government-issued identification number (required for identity verification and @@ -2653,12 +2662,7 @@ export declare namespace AccountHolderCreateParams { * Individual Taxpayer Identification Numbers (ITIN) are currently supported, * entered as full nine-digits, with or without hyphens */ - government_id: string; - - /** - * Individual's last name, as it appears on government-issued identity documents. - */ - last_name: string; + government_id?: string; /** * Individual's phone number, entered in E.164 format. @@ -2850,7 +2854,8 @@ export declare namespace AccountHolderUpdateParams { /** * Short description of the company's line of business (i.e., what does the company - * do?). + * do?). Values longer than 255 characters will be truncated before KYB + * verification */ nature_of_business?: string; diff --git a/src/resources/account-holders/entities.ts b/src/resources/account-holders/entities.ts index 3ca8796d..d36f9141 100644 --- a/src/resources/account-holders/entities.ts +++ b/src/resources/account-holders/entities.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../core/resource'; import * as AccountHoldersAPI from './account-holders'; +import * as CasesAPI from '../transaction-monitoring/cases/cases'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; @@ -126,7 +127,7 @@ export interface AccountHolderEntity { /** * The type of entity */ - type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'; + type: CasesAPI.EntityType; } export namespace AccountHolderEntity { @@ -274,7 +275,7 @@ export interface EntityCreateParams { /** * The type of entity to create on the account holder */ - type: 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'; + type: CasesAPI.EntityType; } export namespace EntityCreateParams { diff --git a/src/resources/accounts.ts b/src/resources/accounts.ts index b73824ca..053eb699 100644 --- a/src/resources/accounts.ts +++ b/src/resources/accounts.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; +import * as AuthRulesAPI from './auth-rules/auth-rules'; import { APIPromise } from '../core/api-promise'; import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; @@ -56,6 +57,28 @@ export class Accounts extends APIResource { return this._client.getAPIList('/v1/accounts', CursorPage, { query, ...options }); } + /** + * Returns behavioral feature state derived from an account's transaction history. + * + * These signals expose the same data used by behavioral rule attributes (e.g. + * `AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`) + * and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to + * inspect feature values before writing rules and debug rule behavior. + * + * Note: 3DS fields are not available at the account scope and will be null. + * + * @example + * ```ts + * const signalsResponse = + * await client.accounts.retrieveSignals( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` + */ + retrieveSignals(accountToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v1/accounts/${accountToken}/signals`, options); + } + /** * Get an Account's available spend limits, which is based on the spend limit * configured on the Account and the amount already spent over the spend limit's @@ -110,7 +133,7 @@ export interface Account { * accounts are unable to be transitioned to `ACTIVE` or `PAUSED` states. * Accounts can be manually set to `CLOSED`, or this can be done by Lithic due to * failure to pass KYB/KYC or for risk/compliance reasons. Please contact - * [support@lithic.com](mailto:support@lithic.com) if you believe this was done + * [support.lithic.com](https://support.lithic.com/) if you believe this was done * by mistake. */ state: 'ACTIVE' | 'PAUSED' | 'CLOSED'; @@ -172,7 +195,8 @@ export interface Account { | 'ISSUER_REQUEST' | 'NOT_ACTIVE' | 'INTERNAL_REVIEW' - | 'OTHER'; + | 'OTHER' + | null; /** * @deprecated @@ -406,7 +430,8 @@ export interface AccountUpdateParams { | 'ISSUER_REQUEST' | 'NOT_ACTIVE' | 'INTERNAL_REVIEW' - | 'OTHER'; + | 'OTHER' + | null; /** * @deprecated Address used during Address Verification Service (AVS) checks during diff --git a/src/resources/auth-rules/auth-rules.ts b/src/resources/auth-rules/auth-rules.ts index 4d3b2a36..99011da6 100644 --- a/src/resources/auth-rules/auth-rules.ts +++ b/src/resources/auth-rules/auth-rules.ts @@ -3,21 +3,30 @@ import { APIResource } from '../../core/resource'; import * as V2API from './v2/v2'; import { + ACHPaymentUpdateAction, AuthRule, AuthRuleCondition, + AuthRuleVersion, AuthRulesCursorPage, BacktestStats, + CardTransactionUpdateAction, Conditional3DSActionParameters, ConditionalACHActionParameters, + ConditionalACHPaymentUpdateActionParameters, ConditionalAttribute, ConditionalAuthorizationActionParameters, + ConditionalAuthorizationAdjustmentParameters, ConditionalBlockParameters, + ConditionalCardTransactionUpdateActionParameters, ConditionalOperation, ConditionalTokenizationActionParameters, ConditionalValue, EventStream, MerchantLockParameters, ReportStats, + RuleFeature, + SpendVelocityFilters, + TypescriptCodeParameters, V2, V2CreateParams, V2DraftParams, @@ -25,11 +34,13 @@ import { V2ListResultsParams, V2ListResultsResponse, V2ListResultsResponsesCursorPage, + V2ListVersionsResponse, V2RetrieveFeaturesParams, V2RetrieveFeaturesResponse, V2RetrieveReportParams, V2RetrieveReportResponse, V2UpdateParams, + VelocityLimitFilters, VelocityLimitParams, VelocityLimitPeriod, } from './v2/v2'; @@ -38,28 +49,246 @@ export class AuthRules extends APIResource { v2: V2API.V2 = new V2API.V2(this._client); } +/** + * Behavioral feature state for a card or account derived from its transaction + * history. + * + * Derived statistical features (averages, standard deviations, z-scores) are + * computed using Welford's online algorithm over approved transactions. Average + * fields are null when fewer than 5 approved transactions have been recorded. + * Standard deviation fields are null when fewer than 30 approved transactions have + * been recorded. + * + * 3DS fields (`three_ds_success_rate`, `three_ds_success_count`, + * `three_ds_total_count`) are card-scoped and will be null for account responses. + * + * Raw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are + * included so clients can compute their own transaction-specific derivations, such + * as checking whether a new transaction's country is in `seen_countries` to + * determine `is_new_country`, or computing a z-score using the raw mean and M2 + * values. + */ +export interface SignalsResponse { + /** + * The Welford M2 accumulator for lifetime approved transaction amounts. Used + * together with `avg_transaction_amount` and `approved_txn_count` to compute the + * z-score of a new transaction amount (variance = M2 / (count - 1)). + */ + approved_txn_amount_m2: number | null; + + /** + * The Welford M2 accumulator for approved transaction amounts over the last 30 + * days. + */ + approved_txn_amount_m2_30d: number | null; + + /** + * The Welford M2 accumulator for approved transaction amounts over the last 7 + * days. + */ + approved_txn_amount_m2_7d: number | null; + + /** + * The Welford M2 accumulator for approved transaction amounts over the last 90 + * days. + */ + approved_txn_amount_m2_90d: number | null; + + /** + * The total number of approved transactions over the entity's lifetime. + */ + approved_txn_count: number | null; + + /** + * The number of approved transactions in the last 30 days. + */ + approved_txn_count_30d: number | null; + + /** + * The number of approved transactions in the last 7 days. + */ + approved_txn_count_7d: number | null; + + /** + * The number of approved transactions in the last 90 days. + */ + approved_txn_count_90d: number | null; + + /** + * The average approved transaction amount over the entity's lifetime, in cents. + * Null if fewer than 5 approved transactions have been recorded. + */ + avg_transaction_amount: number | null; + + /** + * The average approved transaction amount over the last 30 days, in cents. Null if + * fewer than 5 approved transactions in window. + */ + avg_transaction_amount_30d: number | null; + + /** + * The average approved transaction amount over the last 7 days, in cents. Null if + * fewer than 5 approved transactions in window. + */ + avg_transaction_amount_7d: number | null; + + /** + * The average approved transaction amount over the last 90 days, in cents. Null if + * fewer than 5 approved transactions in window. + */ + avg_transaction_amount_90d: number | null; + + /** + * The number of distinct merchant countries seen in the entity's transaction + * history. + */ + distinct_country_count: number | null; + + /** + * The number of distinct MCCs seen in the entity's transaction history. + */ + distinct_mcc_count: number | null; + + /** + * The timestamp of the first approved transaction for the entity, in ISO 8601 + * format. + */ + first_txn_at: string | null; + + /** + * Whether the entity has no prior transaction history. Returns true if no history + * is found. Null if transaction history exists but a first transaction timestamp + * is unavailable. + */ + is_first_transaction: boolean | null; + + /** + * The merchant country of the last card-present transaction. + */ + last_cp_country: string | null; + + /** + * The merchant postal code of the last card-present transaction. + */ + last_cp_postal_code: string | null; + + /** + * The timestamp of the last card-present transaction, in ISO 8601 format. + */ + last_cp_timestamp: string | null; + + /** + * The timestamp of the most recent approved transaction for the entity, in ISO + * 8601 format. + */ + last_txn_approved_at: string | null; + + /** + * The set of merchant countries seen in the entity's transaction history. Clients + * can use this to determine whether a new transaction's country is novel (i.e. + * compute `is_new_country`). + */ + seen_countries: Array | null; + + /** + * The set of MCCs seen in the entity's transaction history. Clients can use this + * to determine whether a new transaction's MCC is novel (i.e. compute + * `is_new_mcc`). + */ + seen_mccs: Array | null; + + /** + * The set of card acceptor IDs seen in the card's approved transaction history, + * capped at the 1000 most recently seen. Null for account responses. Clients can + * use this to determine whether a new transaction's merchant is novel (i.e. + * compute `is_new_merchant`). + */ + seen_merchants: Array | null; + + /** + * The standard deviation of approved transaction amounts over the entity's + * lifetime, in cents. Null if fewer than 30 approved transactions have been + * recorded. + */ + stdev_transaction_amount: number | null; + + /** + * The standard deviation of approved transaction amounts over the last 30 days, in + * cents. Null if fewer than 30 approved transactions in window. + */ + stdev_transaction_amount_30d: number | null; + + /** + * The standard deviation of approved transaction amounts over the last 7 days, in + * cents. Null if fewer than 30 approved transactions in window. + */ + stdev_transaction_amount_7d: number | null; + + /** + * The standard deviation of approved transaction amounts over the last 90 days, in + * cents. Null if fewer than 30 approved transactions in window. + */ + stdev_transaction_amount_90d: number | null; + + /** + * The number of successful 3DS authentications for the card. Null for account + * responses. + */ + three_ds_success_count: number | null; + + /** + * The 3DS authentication success rate for the card, as a percentage from 0.0 to + * 100.0. Null for account responses. + */ + three_ds_success_rate: number | null; + + /** + * The total number of 3DS authentication attempts for the card. Null for account + * responses. + */ + three_ds_total_count: number | null; + + /** + * The number of days since the last approved transaction on the entity. + */ + time_since_last_transaction_days: number | null; +} + AuthRules.V2 = V2; export declare namespace AuthRules { + export { type SignalsResponse as SignalsResponse }; + export { V2 as V2, + type ACHPaymentUpdateAction as ACHPaymentUpdateAction, type AuthRule as AuthRule, type AuthRuleCondition as AuthRuleCondition, + type AuthRuleVersion as AuthRuleVersion, type BacktestStats as BacktestStats, + type CardTransactionUpdateAction as CardTransactionUpdateAction, type Conditional3DSActionParameters as Conditional3DSActionParameters, type ConditionalACHActionParameters as ConditionalACHActionParameters, + type ConditionalACHPaymentUpdateActionParameters as ConditionalACHPaymentUpdateActionParameters, type ConditionalAttribute as ConditionalAttribute, type ConditionalAuthorizationActionParameters as ConditionalAuthorizationActionParameters, + type ConditionalAuthorizationAdjustmentParameters as ConditionalAuthorizationAdjustmentParameters, type ConditionalBlockParameters as ConditionalBlockParameters, + type ConditionalCardTransactionUpdateActionParameters as ConditionalCardTransactionUpdateActionParameters, type ConditionalOperation as ConditionalOperation, type ConditionalTokenizationActionParameters as ConditionalTokenizationActionParameters, type ConditionalValue as ConditionalValue, type EventStream as EventStream, type MerchantLockParameters as MerchantLockParameters, type ReportStats as ReportStats, + type RuleFeature as RuleFeature, + type SpendVelocityFilters as SpendVelocityFilters, + type TypescriptCodeParameters as TypescriptCodeParameters, + type VelocityLimitFilters as VelocityLimitFilters, type VelocityLimitParams as VelocityLimitParams, type VelocityLimitPeriod as VelocityLimitPeriod, type V2ListResultsResponse as V2ListResultsResponse, + type V2ListVersionsResponse as V2ListVersionsResponse, type V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse, type V2RetrieveReportResponse as V2RetrieveReportResponse, type AuthRulesCursorPage as AuthRulesCursorPage, diff --git a/src/resources/auth-rules/index.ts b/src/resources/auth-rules/index.ts index 2e33e3c2..eaebb637 100644 --- a/src/resources/auth-rules/index.ts +++ b/src/resources/auth-rules/index.ts @@ -1,25 +1,36 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { AuthRules } from './auth-rules'; +export { AuthRules, type SignalsResponse } from './auth-rules'; export { V2, + type ACHPaymentUpdateAction, type AuthRule, type AuthRuleCondition, + type AuthRuleVersion, type BacktestStats, + type CardTransactionUpdateAction, type Conditional3DSActionParameters, type ConditionalACHActionParameters, + type ConditionalACHPaymentUpdateActionParameters, type ConditionalAttribute, type ConditionalAuthorizationActionParameters, + type ConditionalAuthorizationAdjustmentParameters, type ConditionalBlockParameters, + type ConditionalCardTransactionUpdateActionParameters, type ConditionalOperation, type ConditionalTokenizationActionParameters, type ConditionalValue, type EventStream, type MerchantLockParameters, type ReportStats, + type RuleFeature, + type SpendVelocityFilters, + type TypescriptCodeParameters, + type VelocityLimitFilters, type VelocityLimitParams, type VelocityLimitPeriod, type V2ListResultsResponse, + type V2ListVersionsResponse, type V2RetrieveFeaturesResponse, type V2RetrieveReportResponse, type V2CreateParams, diff --git a/src/resources/auth-rules/v2/backtests.ts b/src/resources/auth-rules/v2/backtests.ts index 20f71d75..792dbac8 100644 --- a/src/resources/auth-rules/v2/backtests.ts +++ b/src/resources/auth-rules/v2/backtests.ts @@ -95,19 +95,14 @@ export namespace BacktestResults { export interface SimulationParameters { /** - * Auth Rule Token + * The end time of the simulation */ - auth_rule_token?: string; + end: string; /** - * The end time of the simulation. + * The start time of the simulation */ - end?: string; - - /** - * The start time of the simulation. - */ - start?: string; + start: string; } } diff --git a/src/resources/auth-rules/v2/index.ts b/src/resources/auth-rules/v2/index.ts index f35dc3a5..44356ceb 100644 --- a/src/resources/auth-rules/v2/index.ts +++ b/src/resources/auth-rules/v2/index.ts @@ -9,23 +9,34 @@ export { } from './backtests'; export { V2, + type ACHPaymentUpdateAction, type AuthRule, type AuthRuleCondition, + type AuthRuleVersion, type BacktestStats, + type CardTransactionUpdateAction, type Conditional3DSActionParameters, type ConditionalACHActionParameters, + type ConditionalACHPaymentUpdateActionParameters, type ConditionalAttribute, type ConditionalAuthorizationActionParameters, + type ConditionalAuthorizationAdjustmentParameters, type ConditionalBlockParameters, + type ConditionalCardTransactionUpdateActionParameters, type ConditionalOperation, type ConditionalTokenizationActionParameters, type ConditionalValue, type EventStream, type MerchantLockParameters, type ReportStats, + type RuleFeature, + type SpendVelocityFilters, + type TypescriptCodeParameters, + type VelocityLimitFilters, type VelocityLimitParams, type VelocityLimitPeriod, type V2ListResultsResponse, + type V2ListVersionsResponse, type V2RetrieveFeaturesResponse, type V2RetrieveReportResponse, type V2CreateParams, diff --git a/src/resources/auth-rules/v2/v2.ts b/src/resources/auth-rules/v2/v2.ts index c096b249..ff8de973 100644 --- a/src/resources/auth-rules/v2/v2.ts +++ b/src/resources/auth-rules/v2/v2.ts @@ -35,9 +35,9 @@ export class V2 extends APIResource { /** * Updates a V2 Auth rule's properties * - * If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` - * is provided, this will replace existing associations with the provided list of - * entities. + * If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`, + * `excluded_account_tokens`, or `excluded_business_account_tokens` is provided, + * this will replace existing associations with the provided list of entities. */ update(authRuleToken: string, body: V2UpdateParams, options?: RequestOptions): APIPromise { return this._client.patch(path`/v2/auth_rules/${authRuleToken}`, { body, ...options }); @@ -89,6 +89,14 @@ export class V2 extends APIResource { }); } + /** + * Returns all versions of an auth rule, sorted by version number descending + * (newest first). + */ + listVersions(authRuleToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v2/auth_rules/${authRuleToken}/versions`, options); + } + /** * Promotes the draft version of an Auth rule to the currently active version such * that it is enforced in the respective stream. @@ -144,6 +152,46 @@ export type AuthRulesCursorPage = CursorPage; export type V2ListResultsResponsesCursorPage = CursorPage; +export type ACHPaymentUpdateAction = + | ACHPaymentUpdateAction.TagAction + | ACHPaymentUpdateAction.CreateCaseAction; + +export namespace ACHPaymentUpdateAction { + export interface TagAction { + /** + * The key of the tag to apply to the payment + */ + key: string; + + /** + * Tag the payment with key-value metadata + */ + type: 'TAG'; + + /** + * The value of the tag to apply to the payment + */ + value: string; + } + + export interface CreateCaseAction { + /** + * The token of the queue to create the case in + */ + queue_token: string; + + /** + * The scope of the case to create + */ + scope: 'FINANCIAL_ACCOUNT'; + + /** + * Create a case for the payment + */ + type: 'CREATE_CASE'; + } +} + export interface AuthRule { /** * Auth Rule Token @@ -206,9 +254,23 @@ export interface AuthRule { * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. + * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. */ - type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION'; + type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; + + /** + * Account tokens to which the Auth Rule does not apply. + */ + excluded_account_tokens?: Array; + + /** + * Business account tokens to which the Auth Rule does not apply. + */ + excluded_business_account_tokens?: Array; /** * Card tokens to which the Auth Rule does not apply. @@ -228,7 +290,11 @@ export namespace AuthRule { | V2API.Conditional3DSActionParameters | V2API.ConditionalAuthorizationActionParameters | V2API.ConditionalACHActionParameters - | V2API.ConditionalTokenizationActionParameters; + | V2API.ConditionalTokenizationActionParameters + | V2API.ConditionalCardTransactionUpdateActionParameters + | V2API.ConditionalACHPaymentUpdateActionParameters + | V2API.TypescriptCodeParameters + | V2API.ConditionalAuthorizationAdjustmentParameters; /** * The version of the rule, this is incremented whenever the rule's parameters @@ -238,6 +304,12 @@ export namespace AuthRule { } export interface DraftVersion { + /** + * An error message if the draft version failed compilation. Populated when `state` + * is `ERROR`, `null` otherwise. + */ + error: string | null; + /** * Parameters for the Auth Rule */ @@ -248,7 +320,25 @@ export namespace AuthRule { | V2API.Conditional3DSActionParameters | V2API.ConditionalAuthorizationActionParameters | V2API.ConditionalACHActionParameters - | V2API.ConditionalTokenizationActionParameters; + | V2API.ConditionalTokenizationActionParameters + | V2API.ConditionalCardTransactionUpdateActionParameters + | V2API.ConditionalACHPaymentUpdateActionParameters + | V2API.TypescriptCodeParameters + | V2API.ConditionalAuthorizationAdjustmentParameters; + + /** + * The state of the draft version. Most rules are created synchronously and the + * state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + * asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + * success or `ERROR` on failure. + * + * - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + * - `SHADOWING`: The draft version is ready and evaluating in shadow mode + * alongside the current active version. It can be promoted to the active + * version. + * - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + */ + state: 'PENDING' | 'SHADOWING' | 'ERROR'; /** * The version of the rule, this is incremented whenever the rule's parameters @@ -324,6 +414,40 @@ export interface AuthRuleCondition { value: ConditionalValue; } +export interface AuthRuleVersion { + /** + * Timestamp of when this version was created. + */ + created: string; + + /** + * Parameters for the Auth Rule + */ + parameters: + | ConditionalBlockParameters + | VelocityLimitParams + | MerchantLockParameters + | Conditional3DSActionParameters + | ConditionalAuthorizationActionParameters + | ConditionalACHActionParameters + | ConditionalTokenizationActionParameters + | ConditionalCardTransactionUpdateActionParameters + | ConditionalACHPaymentUpdateActionParameters + | TypescriptCodeParameters + | ConditionalAuthorizationAdjustmentParameters; + + /** + * The current state of this version. + */ + state: 'ACTIVE' | 'SHADOW' | 'INACTIVE'; + + /** + * The version of the rule, this is incremented whenever the rule's parameters + * change. + */ + version: number; +} + export interface BacktestStats { /** * The total number of historical transactions approved by this rule during the @@ -375,6 +499,51 @@ export namespace BacktestStats { * The timestamp of the event. */ timestamp?: string; + + /** + * The token of the transaction associated with the event + */ + transaction_token?: string | null; + } +} + +export type CardTransactionUpdateAction = + | CardTransactionUpdateAction.TagAction + | CardTransactionUpdateAction.CreateCaseAction; + +export namespace CardTransactionUpdateAction { + export interface TagAction { + /** + * The key of the tag to apply to the transaction + */ + key: string; + + /** + * Tag the transaction with key-value metadata + */ + type: 'TAG'; + + /** + * The value of the tag to apply to the transaction + */ + value: string; + } + + export interface CreateCaseAction { + /** + * The token of the queue to create the case in + */ + queue_token: string; + + /** + * The scope of the case to create + */ + scope: 'CARD' | 'ACCOUNT'; + + /** + * Create a case for the transaction + */ + type: 'CREATE_CASE'; } } @@ -407,9 +576,10 @@ export namespace Conditional3DSActionParameters { * - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer * fee field in the settlement/cardholder billing currency. This is the amount * the issuer should authorize against unless the issuer is paying the acquirer - * fee on behalf of the cardholder. + * fee on behalf of the cardholder. Use an integer value. * - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication - * risk level, with a higher value indicating a higher amount of risk. + * risk level, with a higher value indicating a higher amount of risk. Use an + * integer value. * - `MESSAGE_CATEGORY`: The category of the authentication being processed. * - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address * data with the cardholder KYC data if it exists. Valid values are `MATCH`, @@ -550,14 +720,91 @@ export namespace ConditionalACHActionParameters { * ID) of the entity initiating the ACH transaction. * - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format. * - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units - * (cents). + * (cents). Use an integer value. * - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. * Valid values include PPD (Prearranged Payment and Deposit Entry), CCD * (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL * (Telephone-Initiated Entry), and others. * - `MEMO`: Optional memo or description field included with the ACH transaction. + * - `RECIPIENT_NAME`: The name of the recipient of the ACH transaction. */ - attribute: 'COMPANY_NAME' | 'COMPANY_ID' | 'TIMESTAMP' | 'TRANSACTION_AMOUNT' | 'SEC_CODE' | 'MEMO'; + attribute: + | 'COMPANY_NAME' + | 'COMPANY_ID' + | 'TIMESTAMP' + | 'TRANSACTION_AMOUNT' + | 'SEC_CODE' + | 'MEMO' + | 'RECIPIENT_NAME'; + + /** + * The operation to apply to the attribute + */ + operation: V2API.ConditionalOperation; + + /** + * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + */ + value: V2API.ConditionalValue; + } +} + +export interface ConditionalACHPaymentUpdateActionParameters { + /** + * The action to take if the conditions are met. + */ + action: ACHPaymentUpdateAction; + + conditions: Array; +} + +export namespace ConditionalACHPaymentUpdateActionParameters { + export interface Condition { + /** + * The attribute to target. + * + * The following attributes may be targeted: + * + * - `TRANSACTION_AMOUNT`: The total amount of the ACH payment in minor units + * (cents), calculated as the sum of the settled and pending amounts. Use an + * integer value. + * - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + * Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + * (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + * (Telephone-Initiated Entry), and others. + * - `RETURN_REASON_CODE`: NACHA return reason code associated with the payment + * (for example, `R01`). + * - `ACCOUNT_AGE`: The age of the account in seconds at the time of the payment. + * Use an integer value. For programs where Lithic does not manage or retain + * account holder data, this attribute does not evaluate. + * - `EXTERNAL_BANK_ACCOUNT_AGE`: The age of the external bank account in seconds + * at the time of the payment. Use an integer value. + * - `EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD`: The method used to verify the + * external bank account. Valid values are `MANUAL`, `MICRO_DEPOSIT`, `PRENOTE`, + * `EXTERNALLY_VERIFIED`, or `UNVERIFIED`. + * - `EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE`: The verification state of the + * external bank account. Valid values are `PENDING`, `ENABLED`, + * `FAILED_VERIFICATION`, or `INSUFFICIENT_FUNDS`. + * - `EXTERNAL_BANK_ACCOUNT_OWNER_TYPE`: The owner type of the external bank + * account. Valid values are `INDIVIDUAL` or `BUSINESS`. + * - `ACH_EVENT_TYPE`: The type of ACH payment event being evaluated. Valid values + * include `ACH_ORIGINATION_INITIATED`, `ACH_ORIGINATION_REVIEWED`, + * `ACH_ORIGINATION_CANCELLED`, `ACH_ORIGINATION_PROCESSED`, + * `ACH_ORIGINATION_SETTLED`, `ACH_ORIGINATION_RELEASED`, + * `ACH_ORIGINATION_REJECTED`, `ACH_RECEIPT_PROCESSED`, `ACH_RECEIPT_SETTLED`, + * `ACH_RECEIPT_RELEASED`, `ACH_RECEIPT_RELEASED_EARLY`, `ACH_RETURN_INITIATED`, + * `ACH_RETURN_PROCESSED`, `ACH_RETURN_SETTLED`, and `ACH_RETURN_REJECTED`. + */ + attribute: + | 'TRANSACTION_AMOUNT' + | 'SEC_CODE' + | 'RETURN_REASON_CODE' + | 'ACCOUNT_AGE' + | 'EXTERNAL_BANK_ACCOUNT_AGE' + | 'EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD' + | 'EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE' + | 'EXTERNAL_BANK_ACCOUNT_OWNER_TYPE' + | 'ACH_EVENT_TYPE'; /** * The operation to apply to the attribute @@ -679,20 +926,27 @@ export namespace ConditionalAuthorizationActionParameters { * - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer * fee field in the settlement/cardholder billing currency. This is the amount * the issuer should authorize against unless the issuer is paying the acquirer - * fee on behalf of the cardholder. + * fee on behalf of the cardholder. Use an integer value. * - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This - * represents the amount of cash being withdrawn or advanced. + * represents the amount of cash being withdrawn or advanced. Use an integer + * value. * - `RISK_SCORE`: Network-provided score assessing risk level associated with a * given authorization. Scores are on a range of 0-999, with 0 representing the * lowest risk and 999 representing the highest risk. For Visa transactions, * where the raw score has a range of 0-99, Lithic will normalize the score by - * multiplying the raw score by 10x. + * multiplying the raw score by 10x. Use an integer value. * - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the - * trailing 15 minutes before the authorization. + * trailing 15 minutes before the authorization. Use an integer value. * - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the - * trailing hour up and until the authorization. + * trailing hour up and until the authorization. Use an integer value. * - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the - * trailing 24 hours up and until the authorization. + * trailing 24 hours up and until the authorization. Use an integer value. + * - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + * the trailing 15 minutes before the authorization. Use an integer value. + * - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + * the trailing hour up and until the authorization. Use an integer value. + * - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + * the trailing 24 hours up and until the authorization. Use an integer value. * - `CARD_STATE`: The current state of the card associated with the transaction. * Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, * `PENDING_FULFILLMENT`. @@ -708,6 +962,65 @@ export namespace ConditionalAuthorizationActionParameters { * - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address * data with the cardholder KYC data if it exists. Valid values are `MATCH`, * `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + * - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + * cardholder received the service, e.g. "NY". When a service location is present + * in the network data, the service location state is used. Otherwise, falls back + * to the card acceptor state. + * - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + * the service, e.g. "10001". When a service location is present in the network + * data, the service location postal code is used. Otherwise, falls back to the + * card acceptor postal code. + * - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + * Use an integer value. + * - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + * of the authorization. Use an integer value. For programs where Lithic does not + * manage or retain account holder data, this attribute does not evaluate. + * - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + * entity's transaction history. Null if fewer than 30 approved transactions in + * the specified window. Requires `parameters.scope` and `parameters.interval`. + * Use a decimal value. + * - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + * entity over the specified window, in cents. Requires `parameters.scope` and + * `parameters.interval`. Use a decimal value. + * - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + * amounts for the entity over the specified window, in cents. Null if fewer than + * 30 approved transactions in the specified window. Requires `parameters.scope` + * and `parameters.interval`. Use a decimal value. + * - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + * in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + * Requires `parameters.scope`. + * - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + * transaction history. Valid values are `TRUE`, `FALSE`. Requires + * `parameters.scope`. + * - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + * Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + * - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + * the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + * supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + * - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + * transaction for the entity, rounded to the nearest whole day. Requires + * `parameters.scope`. Use an integer value. + * - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + * the entity's transaction history. Requires `parameters.scope`. Use an integer + * value. + * - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + * card's approved transaction history (capped at the 1000 most recently seen + * merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + * `parameters` required. + * - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + * a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + * Use a decimal value. + * - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + * between the postal code centers of the last card-present transaction and the + * current transaction, divided by the elapsed time. Null if there is no prior + * card-present transaction, if either postal code cannot be geocoded, or if + * elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + * decimal value. + * - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + * code centers of the last card-present transaction and the current transaction. + * Null if there is no prior card-present transaction or if either postal code + * cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + * Use a decimal value. */ attribute: | 'MCC' @@ -723,12 +1036,287 @@ export namespace ConditionalAuthorizationActionParameters { | 'CARD_TRANSACTION_COUNT_15M' | 'CARD_TRANSACTION_COUNT_1H' | 'CARD_TRANSACTION_COUNT_24H' + | 'CARD_DECLINE_COUNT_15M' + | 'CARD_DECLINE_COUNT_1H' + | 'CARD_DECLINE_COUNT_24H' | 'CARD_STATE' | 'PIN_ENTERED' | 'PIN_STATUS' | 'WALLET_TYPE' | 'TRANSACTION_INITIATOR' - | 'ADDRESS_MATCH'; + | 'ADDRESS_MATCH' + | 'SERVICE_LOCATION_STATE' + | 'SERVICE_LOCATION_POSTAL_CODE' + | 'CARD_AGE' + | 'ACCOUNT_AGE' + | 'AMOUNT_Z_SCORE' + | 'AVG_TRANSACTION_AMOUNT' + | 'STDEV_TRANSACTION_AMOUNT' + | 'IS_NEW_COUNTRY' + | 'IS_NEW_MCC' + | 'IS_FIRST_TRANSACTION' + | 'CONSECUTIVE_DECLINES' + | 'TIME_SINCE_LAST_TRANSACTION' + | 'DISTINCT_COUNTRY_COUNT' + | 'IS_NEW_MERCHANT' + | 'THREE_DS_SUCCESS_RATE' + | 'TRAVEL_SPEED' + | 'DISTANCE_FROM_LAST_TRANSACTION'; + + /** + * The operation to apply to the attribute + */ + operation: V2API.ConditionalOperation; + + /** + * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + */ + value: V2API.ConditionalValue; + + /** + * Additional parameters for certain attributes. Required when `attribute` is one + * of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + * `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + * `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + * for other attributes. + */ + parameters?: Condition.Parameters; + } + + export namespace Condition { + /** + * Additional parameters for certain attributes. Required when `attribute` is one + * of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + * `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + * `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + * for other attributes. + */ + export interface Parameters { + /** + * The time window for statistical attributes (`AMOUNT_Z_SCORE`, + * `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + * all-time history or a specific window (`7D`, `30D`, `90D`). + */ + interval?: 'LIFETIME' | '7D' | '30D' | '90D'; + + /** + * The entity scope to evaluate the attribute against. + */ + scope?: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; + + /** + * The unit for impossible travel attributes. Required when `attribute` is + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + * + * For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + * + * For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + */ + unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; + } + } +} + +export interface ConditionalAuthorizationAdjustmentParameters { + /** + * The hold adjustment to apply if the conditions are met. + */ + action: ConditionalAuthorizationAdjustmentParameters.Action; + + conditions: Array; +} + +export namespace ConditionalAuthorizationAdjustmentParameters { + /** + * The hold adjustment to apply if the conditions are met. + */ + export interface Action { + /** + * The mode of the hold adjustment, determining how the value is interpreted: + * + * - `REPLACE_WITH_AMOUNT`: The value is the approved hold amount in cents. + * - `ADD_PERCENTAGE`: The value adjusts the hold amount by a percentage. 1000 + * represents a 10% increase, 0 represents no change. + * - `ADD_AMOUNT`: The value is added to the hold amount in cents. + */ + mode: 'REPLACE_WITH_AMOUNT' | 'ADD_PERCENTAGE' | 'ADD_AMOUNT'; + + /** + * The type of adjustment to apply + */ + type: 'HOLD_ADJUSTMENT'; + + /** + * The value used for the hold adjustment, interpreted based on the mode + */ + value: number; + } + + export interface Condition { + /** + * The attribute to target. + * + * The following attributes may be targeted: + * + * - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + * business by the types of goods or services it provides. + * - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + * ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + * Netherlands Antilles. + * - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + * the transaction. + * - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + * (merchant). + * - `DESCRIPTOR`: Short description of card acceptor. + * - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + * applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + * `TOKEN_AUTHENTICATED`. + * - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + * (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + * `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + * `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + * `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + * - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + * fee field in the settlement/cardholder billing currency. This is the amount + * the issuer should authorize against unless the issuer is paying the acquirer + * fee on behalf of the cardholder. Use an integer value. + * - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + * represents the amount of cash being withdrawn or advanced. Use an integer + * value. + * - `RISK_SCORE`: Network-provided score assessing risk level associated with a + * given authorization. Scores are on a range of 0-999, with 0 representing the + * lowest risk and 999 representing the highest risk. For Visa transactions, + * where the raw score has a range of 0-99, Lithic will normalize the score by + * multiplying the raw score by 10x. Use an integer value. + * - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + * trailing 15 minutes before the authorization. Use an integer value. + * - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + * trailing hour up and until the authorization. Use an integer value. + * - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + * trailing 24 hours up and until the authorization. Use an integer value. + * - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + * the trailing 15 minutes before the authorization. Use an integer value. + * - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + * the trailing hour up and until the authorization. Use an integer value. + * - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + * the trailing 24 hours up and until the authorization. Use an integer value. + * - `CARD_STATE`: The current state of the card associated with the transaction. + * Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + * `PENDING_FULFILLMENT`. + * - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + * Valid values are `TRUE`, `FALSE`. + * - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + * `OK`, `BLOCKED`. + * - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + * source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + * `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + * - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + * the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + * - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + * data with the cardholder KYC data if it exists. Valid values are `MATCH`, + * `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + * - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + * cardholder received the service, e.g. "NY". When a service location is present + * in the network data, the service location state is used. Otherwise, falls back + * to the card acceptor state. + * - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + * the service, e.g. "10001". When a service location is present in the network + * data, the service location postal code is used. Otherwise, falls back to the + * card acceptor postal code. + * - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + * Use an integer value. + * - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + * of the authorization. Use an integer value. For programs where Lithic does not + * manage or retain account holder data, this attribute does not evaluate. + * - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + * entity's transaction history. Null if fewer than 30 approved transactions in + * the specified window. Requires `parameters.scope` and `parameters.interval`. + * Use a decimal value. + * - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + * entity over the specified window, in cents. Requires `parameters.scope` and + * `parameters.interval`. Use a decimal value. + * - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + * amounts for the entity over the specified window, in cents. Null if fewer than + * 30 approved transactions in the specified window. Requires `parameters.scope` + * and `parameters.interval`. Use a decimal value. + * - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + * in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + * Requires `parameters.scope`. + * - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + * transaction history. Valid values are `TRUE`, `FALSE`. Requires + * `parameters.scope`. + * - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + * Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + * - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + * the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + * supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + * - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + * transaction for the entity, rounded to the nearest whole day. Requires + * `parameters.scope`. Use an integer value. + * - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + * the entity's transaction history. Requires `parameters.scope`. Use an integer + * value. + * - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + * card's approved transaction history (capped at the 1000 most recently seen + * merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + * `parameters` required. + * - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + * a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + * Use a decimal value. + * - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + * between the postal code centers of the last card-present transaction and the + * current transaction, divided by the elapsed time. Null if there is no prior + * card-present transaction, if either postal code cannot be geocoded, or if + * elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + * decimal value. + * - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + * code centers of the last card-present transaction and the current transaction. + * Null if there is no prior card-present transaction or if either postal code + * cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + * Use a decimal value. + */ + attribute: + | 'MCC' + | 'COUNTRY' + | 'CURRENCY' + | 'MERCHANT_ID' + | 'DESCRIPTOR' + | 'LIABILITY_SHIFT' + | 'PAN_ENTRY_MODE' + | 'TRANSACTION_AMOUNT' + | 'CASH_AMOUNT' + | 'RISK_SCORE' + | 'CARD_TRANSACTION_COUNT_15M' + | 'CARD_TRANSACTION_COUNT_1H' + | 'CARD_TRANSACTION_COUNT_24H' + | 'CARD_DECLINE_COUNT_15M' + | 'CARD_DECLINE_COUNT_1H' + | 'CARD_DECLINE_COUNT_24H' + | 'CARD_STATE' + | 'PIN_ENTERED' + | 'PIN_STATUS' + | 'WALLET_TYPE' + | 'TRANSACTION_INITIATOR' + | 'ADDRESS_MATCH' + | 'SERVICE_LOCATION_STATE' + | 'SERVICE_LOCATION_POSTAL_CODE' + | 'CARD_AGE' + | 'ACCOUNT_AGE' + | 'AMOUNT_Z_SCORE' + | 'AVG_TRANSACTION_AMOUNT' + | 'STDEV_TRANSACTION_AMOUNT' + | 'IS_NEW_COUNTRY' + | 'IS_NEW_MCC' + | 'IS_FIRST_TRANSACTION' + | 'CONSECUTIVE_DECLINES' + | 'TIME_SINCE_LAST_TRANSACTION' + | 'DISTINCT_COUNTRY_COUNT' + | 'IS_NEW_MERCHANT' + | 'THREE_DS_SUCCESS_RATE' + | 'TRAVEL_SPEED' + | 'DISTANCE_FROM_LAST_TRANSACTION'; /** * The operation to apply to the attribute @@ -739,6 +1327,50 @@ export namespace ConditionalAuthorizationActionParameters { * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ value: V2API.ConditionalValue; + + /** + * Additional parameters for certain attributes. Required when `attribute` is one + * of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + * `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + * `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + * for other attributes. + */ + parameters?: Condition.Parameters; + } + + export namespace Condition { + /** + * Additional parameters for certain attributes. Required when `attribute` is one + * of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + * `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + * `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + * for other attributes. + */ + export interface Parameters { + /** + * The time window for statistical attributes (`AMOUNT_Z_SCORE`, + * `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + * all-time history or a specific window (`7D`, `30D`, `90D`). + */ + interval?: 'LIFETIME' | '7D' | '30D' | '90D'; + + /** + * The entity scope to evaluate the attribute against. + */ + scope?: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; + + /** + * The unit for impossible travel attributes. Required when `attribute` is + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + * + * For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + * + * For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + */ + unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; + } } } @@ -749,6 +1381,220 @@ export interface ConditionalBlockParameters { conditions: Array; } +export interface ConditionalCardTransactionUpdateActionParameters { + /** + * The action to take if the conditions are met. + */ + action: CardTransactionUpdateAction; + + conditions: Array; +} + +export namespace ConditionalCardTransactionUpdateActionParameters { + export interface Condition { + /** + * The attribute to target. + * + * The following attributes may be targeted: + * + * - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + * business by the types of goods or services it provides. + * - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + * ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + * Netherlands Antilles. + * - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + * the transaction. + * - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + * (merchant). + * - `DESCRIPTOR`: Short description of card acceptor. + * - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + * fee field in the settlement/cardholder billing currency. This is the amount + * the issuer should authorize against unless the issuer is paying the acquirer + * fee on behalf of the cardholder. Use an integer value. + * - `RISK_SCORE`: Network-provided score assessing risk level associated with a + * given authorization. Scores are on a range of 0-999, with 0 representing the + * lowest risk and 999 representing the highest risk. For Visa transactions, + * where the raw score has a range of 0-99, Lithic will normalize the score by + * multiplying the raw score by 10x. Use an integer value. + * - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + * `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + * `EXPIRED`. + * - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + * values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + * `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + * `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + * `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + * `RETURN_REVERSAL`. + * - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + * applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + * `TOKEN_AUTHENTICATED`. + * - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + * (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + * `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + * `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + * `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + * - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + * source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + * `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + * - `CARD_AGE`: The age of the card in seconds at the time of the transaction. Use + * an integer value. + * - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + * transaction. Use an integer value. For programs where Lithic does not manage + * or retain account holder data, this attribute does not evaluate. + * - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + * filters within the given period. Requires `parameters` with `scope`, `period`, + * and optional `filters`. Use an integer value. + * - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + * matching the specified filters within the given period. Requires `parameters` + * with `scope`, `period`, and optional `filters`. Use an integer value. + * - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + * entity's transaction history. Null if fewer than 30 approved transactions in + * the specified window. Requires `parameters.scope` and `parameters.interval`. + * Use a decimal value. + * - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + * entity over the specified window, in cents. Requires `parameters.scope` and + * `parameters.interval`. Use a decimal value. + * - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + * amounts for the entity over the specified window, in cents. Null if fewer than + * 30 approved transactions in the specified window. Requires `parameters.scope` + * and `parameters.interval`. Use a decimal value. + * - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + * in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + * Requires `parameters.scope`. + * - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + * transaction history. Valid values are `TRUE`, `FALSE`. Requires + * `parameters.scope`. + * - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + * Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + * - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + * the entity over the last 30 days (rolling). Requires `parameters.scope`. Use + * an integer value. + * - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + * transaction for the entity, rounded to the nearest whole day. Requires + * `parameters.scope`. Use an integer value. + * - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + * the entity's transaction history. Requires `parameters.scope`. Use an integer + * value. + * - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + * card's approved transaction history (capped at the 1000 most recently seen + * merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + * `parameters` required. + * - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + * a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + * Use a decimal value. + * - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + * between the postal code centers of the last card-present transaction and the + * current transaction, divided by the elapsed time. Null if there is no prior + * card-present transaction, if either postal code cannot be geocoded, or if + * elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + * decimal value. + * - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + * code centers of the last card-present transaction and the current transaction. + * Null if there is no prior card-present transaction or if either postal code + * cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + * Use a decimal value. + */ + attribute: + | 'MCC' + | 'COUNTRY' + | 'CURRENCY' + | 'MERCHANT_ID' + | 'DESCRIPTOR' + | 'TRANSACTION_AMOUNT' + | 'RISK_SCORE' + | 'TRANSACTION_STATUS' + | 'LAST_EVENT_TYPE' + | 'LIABILITY_SHIFT' + | 'PAN_ENTRY_MODE' + | 'WALLET_TYPE' + | 'CARD_AGE' + | 'ACCOUNT_AGE' + | 'SPEND_VELOCITY_COUNT' + | 'SPEND_VELOCITY_AMOUNT' + | 'AMOUNT_Z_SCORE' + | 'AVG_TRANSACTION_AMOUNT' + | 'STDEV_TRANSACTION_AMOUNT' + | 'IS_NEW_COUNTRY' + | 'IS_NEW_MCC' + | 'IS_FIRST_TRANSACTION' + | 'CONSECUTIVE_DECLINES' + | 'TIME_SINCE_LAST_TRANSACTION' + | 'DISTINCT_COUNTRY_COUNT' + | 'IS_NEW_MERCHANT' + | 'THREE_DS_SUCCESS_RATE' + | 'TRAVEL_SPEED' + | 'DISTANCE_FROM_LAST_TRANSACTION'; + + /** + * The operation to apply to the attribute + */ + operation: V2API.ConditionalOperation; + + /** + * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + */ + value: V2API.ConditionalValue; + + /** + * Additional parameters for certain attributes. Required when `attribute` is + * `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + * and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + * `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + * `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + * or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + * the statistical attributes); or `TRAVEL_SPEED` or + * `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + * attributes. + */ + parameters?: Condition.Parameters; + } + + export namespace Condition { + /** + * Additional parameters for certain attributes. Required when `attribute` is + * `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + * and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + * `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + * `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + * or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + * the statistical attributes); or `TRAVEL_SPEED` or + * `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + * attributes. + */ + export interface Parameters { + filters?: V2API.SpendVelocityFilters; + + /** + * The time window for statistical attributes (`AMOUNT_Z_SCORE`, + * `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + * all-time history or a specific window (`7D`, `30D`, `90D`). + */ + interval?: 'LIFETIME' | '7D' | '30D' | '90D'; + + /** + * The time period over which to calculate the spend velocity. + */ + period?: V2API.VelocityLimitPeriod; + + /** + * The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + * spend velocity attributes. + */ + scope?: 'CARD' | 'ACCOUNT' | 'GLOBAL'; + + /** + * The unit for impossible travel attributes. Required when `attribute` is + * `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + * + * For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + * + * For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + */ + unit?: 'MPH' | 'KPH' | 'MILES' | 'KILOMETERS'; + } + } +} + /** * The operation to apply to the attribute */ @@ -852,10 +1698,10 @@ export namespace ConditionalTokenizationActionParameters { * `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`. * - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet. * Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 - * = medium risk). + * = medium risk). Use an integer value. * - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet. * Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 - * = medium risk). + * = medium risk). Use an integer value. * - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet * provider. Valid values include APPROVE, DECLINE, * REQUIRE_ADDITIONAL_AUTHENTICATION. @@ -911,7 +1757,7 @@ export namespace ConditionalTokenizationActionParameters { /** * A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` */ -export type ConditionalValue = string | number | Array | (string & {}); +export type ConditionalValue = string | number | number | Array | (string & {}); /** * The event stream during which the rule will be evaluated. @@ -921,7 +1767,9 @@ export type EventStream = | 'THREE_DS_AUTHENTICATION' | 'TOKENIZATION' | 'ACH_CREDIT_RECEIPT' - | 'ACH_DEBIT_RECEIPT'; + | 'ACH_DEBIT_RECEIPT' + | 'CARD_TRANSACTION_UPDATE' + | 'ACH_PAYMENT_UPDATE'; export interface MerchantLockParameters { /** @@ -963,46 +1811,34 @@ export namespace MerchantLockParameters { export interface ReportStats { /** * A mapping of action types to the number of times that action was returned by - * this rule during the relevant period. Actions are the possible outcomes of a + * this version during the relevant period. Actions are the possible outcomes of a * rule evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule * didn't trigger any action, it's counted under NO_ACTION key. */ - action_counts?: { [key: string]: number }; + action_counts: { [key: string]: number }; /** - * @deprecated The total number of historical transactions approved by this rule - * during the relevant period, or the number of transactions that would have been - * approved if the rule was evaluated in shadow mode. + * Example events and their outcomes for this version. */ - approved?: number; + examples: Array; /** - * @deprecated The total number of historical transactions challenged by this rule - * during the relevant period, or the number of transactions that would have been - * challenged if the rule was evaluated in shadow mode. Currently applicable only - * for 3DS Auth Rules. + * The evaluation mode of this version during the reported period. */ - challenged?: number; + state: 'ACTIVE' | 'SHADOW' | 'INACTIVE'; /** - * @deprecated The total number of historical transactions declined by this rule - * during the relevant period, or the number of transactions that would have been - * declined if the rule was evaluated in shadow mode. + * The rule version number. */ - declined?: number; - - /** - * Example events and their outcomes. - */ - examples?: Array; + version: number; } export namespace ReportStats { export interface Example { /** - * The actions taken by the rule for this event. + * The actions taken by this version for this event. */ - actions?: Array< + actions: Array< | Example.DeclineActionAuthorization | Example.ChallengeActionAuthorization | Example.ResultAuthentication3DSAction @@ -1013,24 +1849,19 @@ export namespace ReportStats { >; /** - * @deprecated Whether the rule would have approved the request. - */ - approved?: boolean; - - /** - * @deprecated The decision made by the rule for this event. + * The event token. */ - decision?: 'APPROVED' | 'DECLINED' | 'CHALLENGED'; + event_token: string; /** - * The event token. + * The timestamp of the event. */ - event_token?: string; + timestamp: string; /** - * The timestamp of the event. + * The token of the transaction associated with the event */ - timestamp?: string; + transaction_token?: string | null; } export namespace Example { @@ -1245,14 +2076,378 @@ export namespace ReportStats { | 'R84' | 'R85'; - /** - * Return the ACH transaction - */ - type: 'RETURN'; - } + /** + * Return the ACH transaction + */ + type: 'RETURN'; + } + } +} + +/** + * A feature made available to the rule. The `name` field is the variable name used + * in the rule function signature. The `type` field determines which data the + * feature provides to the rule at evaluation time. + * + * - `AUTHORIZATION`: The authorization request being evaluated. Only available for + * AUTHORIZATION event stream rules. + * - `AUTHENTICATION`: The 3DS authentication request being evaluated. Only + * available for THREE_DS_AUTHENTICATION event stream rules. + * - `TOKENIZATION`: The tokenization request being evaluated. Only available for + * TOKENIZATION event stream rules. + * - `ACH_RECEIPT`: The ACH receipt being evaluated. Only available for + * ACH_CREDIT_RECEIPT and ACH_DEBIT_RECEIPT event stream rules. + * - `CARD_TRANSACTION`: The card transaction being evaluated. Only available for + * CARD_TRANSACTION_UPDATE event stream rules. + * - `ACH_PAYMENT`: The ACH payment being evaluated. Only available for + * ACH_PAYMENT_UPDATE event stream rules. + * - `EXTERNAL_BANK_ACCOUNT`: The external bank account tied to the ACH payment + * being evaluated. Only available for ACH_PAYMENT_UPDATE event stream rules. + * - `CARD`: The card associated with the event. Available for AUTHORIZATION, + * THREE_DS_AUTHENTICATION, and CARD_TRANSACTION_UPDATE event stream rules. + * - `ACCOUNT_HOLDER`: The account holder associated with the event. Available for + * AUTHORIZATION, THREE_DS_AUTHENTICATION, CARD_TRANSACTION_UPDATE, and + * ACH_PAYMENT_UPDATE event stream rules. + * - `IP_METADATA`: IP address metadata for the request. Available for + * THREE_DS_AUTHENTICATION event stream rules. + * - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires + * `scope`, `period`, and optionally `filters` to configure the velocity + * calculation. Available for AUTHORIZATION and CARD_TRANSACTION_UPDATE event + * stream rules. + * - `PAYMENT_VELOCITY`: ACH payment velocity data, aggregated over the given + * scope. Requires `scope`, `period`, and optionally `filters` to configure the + * velocity calculation. Available for ACH_PAYMENT_UPDATE event stream rules. + * - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions since + * the last approval for the card or account. Requires `scope`. Available for + * AUTHORIZATION and CARD_TRANSACTION_UPDATE event stream rules. + * - `ACH_PAYMENT_HISTORY`: Windowed settled-amount statistics derived from the + * financial account's ACH payment history. Requires `scope`. Available for + * ACH_PAYMENT_UPDATE event stream rules. + * - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the + * entity's transaction history. Requires `scope` to specify whether to load + * card, account, or business account history. Available for AUTHORIZATION and + * CARD_TRANSACTION_UPDATE event stream rules. + */ +export type RuleFeature = + | RuleFeature.AuthorizationFeature + | RuleFeature.AuthenticationFeature + | RuleFeature.TokenizationFeature + | RuleFeature.ACHReceiptFeature + | RuleFeature.CardTransactionFeature + | RuleFeature.ACHPaymentFeature + | RuleFeature.ExternalBankAccountFeature + | RuleFeature.CardFeature + | RuleFeature.AccountHolderFeature + | RuleFeature.IPMetadataFeature + | RuleFeature.SpendVelocityFeature + | RuleFeature.PaymentVelocityFeature + | RuleFeature.TransactionHistorySignalsFeature + | RuleFeature.ConsecutiveDeclinesFeature + | RuleFeature.ACHPaymentHistoryFeature; + +export namespace RuleFeature { + export interface AuthorizationFeature { + type: 'AUTHORIZATION'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface AuthenticationFeature { + type: 'AUTHENTICATION'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface TokenizationFeature { + type: 'TOKENIZATION'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface ACHReceiptFeature { + type: 'ACH_RECEIPT'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface CardTransactionFeature { + type: 'CARD_TRANSACTION'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface ACHPaymentFeature { + type: 'ACH_PAYMENT'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface ExternalBankAccountFeature { + type: 'EXTERNAL_BANK_ACCOUNT'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface CardFeature { + type: 'CARD'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface AccountHolderFeature { + type: 'ACCOUNT_HOLDER'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface IPMetadataFeature { + type: 'IP_METADATA'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface SpendVelocityFeature { + /** + * Velocity over the current day since 00:00 / 12 AM in Eastern Time + */ + period: V2API.VelocityLimitPeriod; + + /** + * The scope the velocity is calculated for + */ + scope: 'CARD' | 'ACCOUNT'; + + type: 'SPEND_VELOCITY'; + + filters?: V2API.VelocityLimitFilters; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface PaymentVelocityFeature { + /** + * Velocity over the current day since 00:00 / 12 AM in Eastern Time + */ + period: V2API.VelocityLimitPeriod; + + /** + * The scope over which the ACH payment velocity is aggregated. + */ + scope: 'FINANCIAL_ACCOUNT' | 'GLOBAL'; + + type: 'PAYMENT_VELOCITY'; + + /** + * Optional filters applied when aggregating ACH payment velocity. Payments not + * matching the provided filters are excluded from the calculated velocity. + */ + filters?: PaymentVelocityFeature.Filters; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export namespace PaymentVelocityFeature { + /** + * Optional filters applied when aggregating ACH payment velocity. Payments not + * matching the provided filters are excluded from the calculated velocity. + */ + export interface Filters { + /** + * Exclude payments matching any of the provided tag key-value pairs. + */ + exclude_tags?: { [key: string]: string } | null; + + /** + * Payment types to include in the velocity calculation. + */ + include_payment_types?: Array<'ORIGINATION' | 'RECEIPT'> | null; + + /** + * Payment polarities to include in the velocity calculation. + */ + include_polarities?: Array<'CREDIT' | 'DEBIT'> | null; + + /** + * Payment statuses to include in the velocity calculation. + */ + include_statuses?: Array< + 'PENDING' | 'SETTLED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED' + > | null; + + /** + * Only include payments matching all of the provided tag key-value pairs. + */ + include_tags?: { [key: string]: string } | null; + + /** + * Only include payments with the given result. + */ + result?: 'APPROVED' | 'DECLINED'; + } + } + + export interface TransactionHistorySignalsFeature { + /** + * The entity scope to load transaction history signals for. + */ + scope: 'CARD' | 'ACCOUNT' | 'BUSINESS_ACCOUNT'; + + type: 'TRANSACTION_HISTORY_SIGNALS'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface ConsecutiveDeclinesFeature { + /** + * The entity scope to count consecutive declines for. + */ + scope: 'CARD' | 'ACCOUNT'; + + type: 'CONSECUTIVE_DECLINES'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; + } + + export interface ACHPaymentHistoryFeature { + /** + * The entity scope to load ACH payment history for. + */ + scope: 'FINANCIAL_ACCOUNT'; + + type: 'ACH_PAYMENT_HISTORY'; + + /** + * The variable name for this feature in the rule function signature + */ + name?: string; } } +export interface SpendVelocityFilters extends VelocityLimitFilters { + /** + * Tag key-value pairs to exclude from the velocity calculation. Transactions + * matching all specified tag key-value pairs will be excluded from the calculated + * velocity. + */ + exclude_tags?: { [key: string]: string } | null; + + /** + * Tag key-value pairs to include in the velocity calculation. Only transactions + * matching all specified tag key-value pairs will be included in the calculated + * velocity. + */ + include_tags?: { [key: string]: string } | null; +} + +/** + * Parameters for defining a TypeScript code rule + */ +export interface TypescriptCodeParameters { + /** + * The TypeScript source code of the rule. Must define a `rule()` function that + * accepts the declared features as positional arguments (in the same order as the + * `features` array) and returns an array of actions. + */ + code: string; + + /** + * Features available to the TypeScript code at evaluation time + */ + features: Array; +} + +export interface VelocityLimitFilters { + /** + * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + * Transactions matching any of the provided will be excluded from the calculated + * velocity. + */ + exclude_countries?: Array | null; + + /** + * Merchant Category Codes to exclude from the velocity calculation. Transactions + * matching this MCC will be excluded from the calculated velocity. + */ + exclude_mccs?: Array | null; + + /** + * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + * Transactions not matching any of the provided will not be included in the + * calculated velocity. + */ + include_countries?: Array | null; + + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not + * matching this MCC will not be included in the calculated velocity. + */ + include_mccs?: Array | null; + + /** + * PAN entry modes to include in the velocity calculation. Transactions not + * matching any of the provided will not be included in the calculated velocity. + */ + include_pan_entry_modes?: Array< + | 'AUTO_ENTRY' + | 'BAR_CODE' + | 'CONTACTLESS' + | 'CREDENTIAL_ON_FILE' + | 'ECOMMERCE' + | 'ERROR_KEYED' + | 'ERROR_MAGNETIC_STRIPE' + | 'ICC' + | 'KEY_ENTERED' + | 'MAGNETIC_STRIPE' + | 'MANUAL' + | 'OCR' + | 'SECURE_CARDLESS' + | 'UNSPECIFIED' + | 'UNKNOWN' + > | null; +} + export interface VelocityLimitParams { /** * Velocity over the current day since 00:00 / 12 AM in Eastern Time @@ -1264,7 +2459,7 @@ export interface VelocityLimitParams { */ scope: 'CARD' | 'ACCOUNT'; - filters?: VelocityLimitParams.Filters; + filters?: VelocityLimitFilters; /** * The maximum amount of spend velocity allowed in the period in minor units (the @@ -1283,58 +2478,6 @@ export interface VelocityLimitParams { limit_count?: number | null; } -export namespace VelocityLimitParams { - export interface Filters { - /** - * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - * Transactions matching any of the provided will be excluded from the calculated - * velocity. - */ - exclude_countries?: Array | null; - - /** - * Merchant Category Codes to exclude from the velocity calculation. Transactions - * matching this MCC will be excluded from the calculated velocity. - */ - exclude_mccs?: Array | null; - - /** - * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - * Transactions not matching any of the provided will not be included in the - * calculated velocity. - */ - include_countries?: Array | null; - - /** - * Merchant Category Codes to include in the velocity calculation. Transactions not - * matching this MCC will not be included in the calculated velocity. - */ - include_mccs?: Array | null; - - /** - * PAN entry modes to include in the velocity calculation. Transactions not - * matching any of the provided will not be included in the calculated velocity. - */ - include_pan_entry_modes?: Array< - | 'AUTO_ENTRY' - | 'BAR_CODE' - | 'CONTACTLESS' - | 'CREDENTIAL_ON_FILE' - | 'ECOMMERCE' - | 'ERROR_KEYED' - | 'ERROR_MAGNETIC_STRIPE' - | 'ICC' - | 'KEY_ENTERED' - | 'MAGNETIC_STRIPE' - | 'MANUAL' - | 'OCR' - | 'SECURE_CARDLESS' - | 'UNSPECIFIED' - | 'UNKNOWN' - > | null; - } -} - /** * Velocity over the current day since 00:00 / 12 AM in Eastern Time */ @@ -1349,7 +2492,7 @@ export namespace VelocityLimitPeriod { export interface TrailingWindowObject { /** * The size of the trailing window to calculate Spend Velocity over in seconds. The - * minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + * minimum value is 10 seconds, and the maximum value is 7776000 seconds (90 days). */ duration: number; @@ -1422,7 +2565,9 @@ export type V2ListResultsResponse = | V2ListResultsResponse.AuthorizationResult | V2ListResultsResponse.Authentication3DSResult | V2ListResultsResponse.TokenizationResult - | V2ListResultsResponse.ACHResult; + | V2ListResultsResponse.ACHResult + | V2ListResultsResponse.CardTransactionUpdateResult + | V2ListResultsResponse.ACHPaymentUpdateResult; export namespace V2ListResultsResponse { export interface AuthorizationResult { @@ -1467,6 +2612,11 @@ export namespace V2ListResultsResponse { * Version of the rule that was evaluated */ rule_version: number; + + /** + * The token of the transaction that triggered the rule evaluation + */ + transaction_token: string | null; } export namespace AuthorizationResult { @@ -1591,6 +2741,11 @@ export namespace V2ListResultsResponse { * Version of the rule that was evaluated */ rule_version: number; + + /** + * The token of the transaction that triggered the rule evaluation + */ + transaction_token: string | null; } export namespace Authentication3DSResult { @@ -1644,6 +2799,11 @@ export namespace V2ListResultsResponse { * Version of the rule that was evaluated */ rule_version: number; + + /** + * The token of the transaction that triggered the rule evaluation + */ + transaction_token: string | null; } export namespace TokenizationResult { @@ -1750,6 +2910,11 @@ export namespace V2ListResultsResponse { * Version of the rule that was evaluated */ rule_version: number; + + /** + * The token of the transaction that triggered the rule evaluation + */ + transaction_token: string | null; } export namespace ACHResult { @@ -1854,6 +3019,196 @@ export namespace V2ListResultsResponse { explanation?: string; } } + + export interface CardTransactionUpdateResult { + /** + * Globally unique identifier for the evaluation + */ + token: string; + + /** + * Actions returned by the rule evaluation + */ + actions: Array; + + /** + * The Auth Rule token + */ + auth_rule_token: string; + + /** + * Timestamp of the rule evaluation + */ + evaluation_time: string; + + /** + * The event stream during which the rule was evaluated + */ + event_stream: 'CARD_TRANSACTION_UPDATE'; + + /** + * Token of the event that triggered the evaluation + */ + event_token: string; + + /** + * The state of the Auth Rule + */ + mode: 'ACTIVE' | 'INACTIVE'; + + /** + * Version of the rule that was evaluated + */ + rule_version: number; + + /** + * The token of the transaction that triggered the rule evaluation + */ + transaction_token: string | null; + } + + export namespace CardTransactionUpdateResult { + export interface TagAction { + /** + * The key of the tag to apply to the transaction + */ + key: string; + + /** + * Tag the transaction with key-value metadata + */ + type: 'TAG'; + + /** + * The value of the tag to apply to the transaction + */ + value: string; + + /** + * Optional explanation for why this action was taken + */ + explanation?: string; + } + + export interface CreateCaseAction { + /** + * The token of the queue to create the case in + */ + queue_token: string; + + /** + * The scope of the case to create + */ + scope: 'CARD' | 'ACCOUNT'; + + /** + * Create a case for the transaction + */ + type: 'CREATE_CASE'; + + /** + * Optional explanation for why this action was taken + */ + explanation?: string; + } + } + + export interface ACHPaymentUpdateResult { + /** + * Globally unique identifier for the evaluation + */ + token: string; + + /** + * Actions returned by the rule evaluation + */ + actions: Array; + + /** + * The Auth Rule token + */ + auth_rule_token: string; + + /** + * Timestamp of the rule evaluation + */ + evaluation_time: string; + + /** + * The event stream during which the rule was evaluated + */ + event_stream: 'ACH_PAYMENT_UPDATE'; + + /** + * Token of the event that triggered the evaluation + */ + event_token: string; + + /** + * The state of the Auth Rule + */ + mode: 'ACTIVE' | 'INACTIVE'; + + /** + * Version of the rule that was evaluated + */ + rule_version: number; + + /** + * The token of the transaction that triggered the rule evaluation + */ + transaction_token: string | null; + } + + export namespace ACHPaymentUpdateResult { + export interface TagAction { + /** + * The key of the tag to apply to the payment + */ + key: string; + + /** + * Tag the payment with key-value metadata + */ + type: 'TAG'; + + /** + * The value of the tag to apply to the payment + */ + value: string; + + /** + * Optional explanation for why this action was taken + */ + explanation?: string; + } + + export interface CreateCaseAction { + /** + * The token of the queue to create the case in + */ + queue_token: string; + + /** + * The scope of the case to create + */ + scope: 'FINANCIAL_ACCOUNT'; + + /** + * Create a case for the payment + */ + type: 'CREATE_CASE'; + + /** + * Optional explanation for why this action was taken + */ + explanation?: string; + } + } +} + +export interface V2ListVersionsResponse { + data: Array; } export interface V2RetrieveFeaturesResponse { @@ -1870,7 +3225,7 @@ export interface V2RetrieveFeaturesResponse { export namespace V2RetrieveFeaturesResponse { export interface Feature { - filters: Feature.Filters; + filters: V2API.VelocityLimitFilters; /** * Velocity over the current day since 00:00 / 12 AM in Eastern Time @@ -1886,56 +3241,6 @@ export namespace V2RetrieveFeaturesResponse { } export namespace Feature { - export interface Filters { - /** - * ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. - * Transactions matching any of the provided will be excluded from the calculated - * velocity. - */ - exclude_countries?: Array | null; - - /** - * Merchant Category Codes to exclude from the velocity calculation. Transactions - * matching this MCC will be excluded from the calculated velocity. - */ - exclude_mccs?: Array | null; - - /** - * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. - * Transactions not matching any of the provided will not be included in the - * calculated velocity. - */ - include_countries?: Array | null; - - /** - * Merchant Category Codes to include in the velocity calculation. Transactions not - * matching this MCC will not be included in the calculated velocity. - */ - include_mccs?: Array | null; - - /** - * PAN entry modes to include in the velocity calculation. Transactions not - * matching any of the provided will not be included in the calculated velocity. - */ - include_pan_entry_modes?: Array< - | 'AUTO_ENTRY' - | 'BAR_CODE' - | 'CONTACTLESS' - | 'CREDENTIAL_ON_FILE' - | 'ECOMMERCE' - | 'ERROR_KEYED' - | 'ERROR_MAGNETIC_STRIPE' - | 'ICC' - | 'KEY_ENTERED' - | 'MAGNETIC_STRIPE' - | 'MANUAL' - | 'OCR' - | 'SECURE_CARDLESS' - | 'UNSPECIFIED' - | 'UNKNOWN' - > | null; - } - export interface Value { /** * Amount (in cents) for the given Auth Rule that is used as input for calculating @@ -1977,20 +3282,16 @@ export interface V2RetrieveReportResponse { export namespace V2RetrieveReportResponse { export interface DailyStatistic { - /** - * Detailed statistics for the current version of the rule. - */ - current_version_statistics: V2API.ReportStats | null; - /** * The date (UTC) for which the statistics are reported. */ date: string; /** - * Detailed statistics for the draft version of the rule. + * Statistics for each version of the rule that was evaluated during the reported + * day. */ - draft_version_statistics: V2API.ReportStats | null; + versions: Array; } } @@ -2011,7 +3312,11 @@ export declare namespace V2CreateParams { | Conditional3DSActionParameters | ConditionalAuthorizationActionParameters | ConditionalACHActionParameters - | ConditionalTokenizationActionParameters; + | ConditionalTokenizationActionParameters + | ConditionalCardTransactionUpdateActionParameters + | ConditionalACHPaymentUpdateActionParameters + | TypescriptCodeParameters + | ConditionalAuthorizationAdjustmentParameters; /** * The type of Auth Rule. For certain rule types, this determines the event stream @@ -2024,9 +3329,13 @@ export declare namespace V2CreateParams { * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. + * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. */ - type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION'; + type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; /** * Account tokens to which the Auth Rule applies. @@ -2065,7 +3374,11 @@ export declare namespace V2CreateParams { | Conditional3DSActionParameters | ConditionalAuthorizationActionParameters | ConditionalACHActionParameters - | ConditionalTokenizationActionParameters; + | ConditionalTokenizationActionParameters + | ConditionalCardTransactionUpdateActionParameters + | ConditionalACHPaymentUpdateActionParameters + | TypescriptCodeParameters + | ConditionalAuthorizationAdjustmentParameters; /** * The type of Auth Rule. For certain rule types, this determines the event stream @@ -2078,9 +3391,13 @@ export declare namespace V2CreateParams { * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. + * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. */ - type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION'; + type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; /** * The event stream during which the rule will be evaluated. @@ -2104,7 +3421,11 @@ export declare namespace V2CreateParams { | Conditional3DSActionParameters | ConditionalAuthorizationActionParameters | ConditionalACHActionParameters - | ConditionalTokenizationActionParameters; + | ConditionalTokenizationActionParameters + | ConditionalCardTransactionUpdateActionParameters + | ConditionalACHPaymentUpdateActionParameters + | TypescriptCodeParameters + | ConditionalAuthorizationAdjustmentParameters; /** * Whether the Auth Rule applies to all authorizations on the card program. @@ -2122,15 +3443,29 @@ export declare namespace V2CreateParams { * - `VELOCITY_LIMIT`: AUTHORIZATION event stream. * - `MERCHANT_LOCK`: AUTHORIZATION event stream. * - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - * ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. + * - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + * ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + * ACH_PAYMENT_UPDATE event stream. */ - type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION'; + type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT' | 'MERCHANT_LOCK' | 'CONDITIONAL_ACTION' | 'TYPESCRIPT_CODE'; /** * The event stream during which the rule will be evaluated. */ event_stream?: EventStream; + /** + * Account tokens to which the Auth Rule does not apply. + */ + excluded_account_tokens?: Array; + + /** + * Business account tokens to which the Auth Rule does not apply. + */ + excluded_business_account_tokens?: Array; + /** * Card tokens to which the Auth Rule does not apply. */ @@ -2197,6 +3532,16 @@ export declare namespace V2UpdateParams { } export interface ProgramLevelRule { + /** + * Account tokens to which the Auth Rule does not apply. + */ + excluded_account_tokens?: Array; + + /** + * Business account tokens to which the Auth Rule does not apply. + */ + excluded_business_account_tokens?: Array; + /** * Card tokens to which the Auth Rule does not apply. */ @@ -2270,6 +3615,10 @@ export interface V2DraftParams { | ConditionalAuthorizationActionParameters | ConditionalACHActionParameters | ConditionalTokenizationActionParameters + | ConditionalCardTransactionUpdateActionParameters + | ConditionalACHPaymentUpdateActionParameters + | TypescriptCodeParameters + | ConditionalAuthorizationAdjustmentParameters | null; } @@ -2325,23 +3674,34 @@ V2.Backtests = Backtests; export declare namespace V2 { export { + type ACHPaymentUpdateAction as ACHPaymentUpdateAction, type AuthRule as AuthRule, type AuthRuleCondition as AuthRuleCondition, + type AuthRuleVersion as AuthRuleVersion, type BacktestStats as BacktestStats, + type CardTransactionUpdateAction as CardTransactionUpdateAction, type Conditional3DSActionParameters as Conditional3DSActionParameters, type ConditionalACHActionParameters as ConditionalACHActionParameters, + type ConditionalACHPaymentUpdateActionParameters as ConditionalACHPaymentUpdateActionParameters, type ConditionalAttribute as ConditionalAttribute, type ConditionalAuthorizationActionParameters as ConditionalAuthorizationActionParameters, + type ConditionalAuthorizationAdjustmentParameters as ConditionalAuthorizationAdjustmentParameters, type ConditionalBlockParameters as ConditionalBlockParameters, + type ConditionalCardTransactionUpdateActionParameters as ConditionalCardTransactionUpdateActionParameters, type ConditionalOperation as ConditionalOperation, type ConditionalTokenizationActionParameters as ConditionalTokenizationActionParameters, type ConditionalValue as ConditionalValue, type EventStream as EventStream, type MerchantLockParameters as MerchantLockParameters, type ReportStats as ReportStats, + type RuleFeature as RuleFeature, + type SpendVelocityFilters as SpendVelocityFilters, + type TypescriptCodeParameters as TypescriptCodeParameters, + type VelocityLimitFilters as VelocityLimitFilters, type VelocityLimitParams as VelocityLimitParams, type VelocityLimitPeriod as VelocityLimitPeriod, type V2ListResultsResponse as V2ListResultsResponse, + type V2ListVersionsResponse as V2ListVersionsResponse, type V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse, type V2RetrieveReportResponse as V2RetrieveReportResponse, type AuthRulesCursorPage as AuthRulesCursorPage, diff --git a/src/resources/balances.ts b/src/resources/balances.ts index 9bedb4fd..58d36513 100644 --- a/src/resources/balances.ts +++ b/src/resources/balances.ts @@ -45,19 +45,19 @@ export interface Balance { /** * Type of financial account. */ - financial_account_type: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; + financial_account_type: 'CARD' | 'ISSUING' | 'OPERATING' | 'PROGRAM_RECEIVABLES' | 'RESERVE' | 'SECURITY'; /** * Globally unique identifier for the last financial transaction event that * impacted this balance. */ - last_transaction_event_token: string; + last_transaction_event_token: string | null; /** * Globally unique identifier for the last financial transaction that impacted this * balance. */ - last_transaction_token: string; + last_transaction_token: string | null; /** * Funds not available for spend due to card authorizations or pending ACH release. diff --git a/src/resources/book-transfers.ts b/src/resources/book-transfers.ts index 79bad906..a9373e27 100644 --- a/src/resources/book-transfers.ts +++ b/src/resources/book-transfers.ts @@ -79,6 +79,7 @@ export interface BookTransferResponse { | 'INTERNAL' | 'REWARD' | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER' | 'TRANSFER'; /** @@ -220,6 +221,7 @@ export namespace BookTransferResponse { | 'INTEREST' | 'LATE_PAYMENT' | 'BILL_PAYMENT' + | 'PAYMENT_FEE' | 'CASH_BACK' | 'ACCOUNT_TO_ACCOUNT' | 'CARD_TO_CARD' @@ -234,7 +236,9 @@ export namespace BookTransferResponse { | 'DISPUTE_WON' | 'SERVICE' | 'TRANSFER' - | 'COLLECTION'; + | 'COLLECTION' + | 'LITHIC_PROGRAM_TRANSFER' + | 'BANK_PROGRAM_TRANSFER'; } /** @@ -265,6 +269,7 @@ export interface BookTransferCreateParams { | 'INTERNAL' | 'REWARD' | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER' | 'TRANSFER'; /** @@ -308,6 +313,7 @@ export interface BookTransferCreateParams { | 'INTEREST' | 'LATE_PAYMENT' | 'BILL_PAYMENT' + | 'PAYMENT_FEE' | 'CASH_BACK' | 'ACCOUNT_TO_ACCOUNT' | 'CARD_TO_CARD' @@ -322,7 +328,9 @@ export interface BookTransferCreateParams { | 'DISPUTE_WON' | 'SERVICE' | 'TRANSFER' - | 'COLLECTION'; + | 'COLLECTION' + | 'LITHIC_PROGRAM_TRANSFER' + | 'BANK_PROGRAM_TRANSFER'; /** * Customer-provided token that will serve as an idempotency token. This token will @@ -374,6 +382,7 @@ export interface BookTransferListParams extends CursorPageParams { | 'INTERNAL' | 'REWARD' | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER' | 'TRANSFER'; /** diff --git a/src/resources/card-authorizations.ts b/src/resources/card-authorizations.ts new file mode 100644 index 00000000..0d1ed7b1 --- /dev/null +++ b/src/resources/card-authorizations.ts @@ -0,0 +1,744 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import * as Shared from './shared'; +import * as TransactionsAPI from './transactions/transactions'; +import { APIPromise } from '../core/api-promise'; +import { RequestOptions } from '../internal/request-options'; +import { path } from '../internal/utils/path'; + +export class CardAuthorizations extends APIResource { + /** + * Card program's response to Authorization Challenge. Programs that have + * Authorization Challenges configured as Out of Band receive a + * [card_authorization.challenge](https://docs.lithic.com/reference/cardauthorizationchallengewebhook) + * webhook when an authorization attempt triggers a challenge. The card program + * should respond using this endpoint after the cardholder completes the challenge. + */ + challengeResponse( + eventToken: string, + body: CardAuthorizationChallengeResponseParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post(path`/v1/card_authorizations/${eventToken}/challenge_response`, { + body, + ...options, + }); + } +} + +/** + * Card Authorization + */ +export interface CardAuthorization { + /** + * The provisional transaction group uuid associated with the authorization + */ + token: string; + + /** + * Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + * zero if no fee is assessed. Rebates may be transmitted as a negative value to + * indicate credited fees. + */ + acquirer_fee: number; + + /** + * @deprecated Deprecated, use `amounts`. Authorization amount of the transaction + * (in cents), including any acquirer fees. The contents of this field are + * identical to `authorization_amount`. + */ + amount: number; + + /** + * Structured amounts for this authorization. The `cardholder` and `merchant` + * amounts reflect the original network authorization values. For programs with + * hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + * `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + * anticipated final transaction amounts such as tips or fuel fill-ups + */ + amounts: CardAuthorization.Amounts; + + /** + * @deprecated Deprecated, use `amounts`. The base transaction amount (in cents) + * plus the acquirer fee field. This is the amount the issuer should authorize + * against unless the issuer is paying the acquirer fee on behalf of the + * cardholder. + */ + authorization_amount: number; + + avs: CardAuthorization.Avs; + + /** + * Card object in ASA + */ + card: CardAuthorization.Card; + + /** + * @deprecated Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for + * cardholder's billing currency. + */ + cardholder_currency: string; + + /** + * The amount of cash requested by the cardholder, in the cardholder billing + * currency's smallest unit. For purchase-with-cashback transactions this is the + * cashback portion only; for ATM transactions this is the full amount. This amount + * includes all acquirer fees. + * + * If no cash was requested, the value of this field will be 0, and the field will + * always be present. + */ + cash_amount: number; + + /** + * Date and time when the transaction first occurred in UTC. + */ + created: string; + + /** + * Merchant information including full location details. + */ + merchant: CardAuthorization.Merchant; + + /** + * @deprecated Deprecated, use `amounts`. The amount that the merchant will + * receive, denominated in `merchant_currency` and in the smallest currency unit. + * Note the amount includes `acquirer_fee`, similar to `authorization_amount`. It + * will be different from `authorization_amount` if the merchant is taking payment + * in a different currency. + */ + merchant_amount: number; + + /** + * @deprecated 3-character alphabetic ISO 4217 code for the local currency of the + * transaction. + */ + merchant_currency: string; + + /** + * Network name validation data, present when the card network requested name + * validation for this transaction. Contains the cardholder name provided by the + * network and Lithic's computed match result against KYC data on file. + */ + name_validation: CardAuthorization.NameValidation | null; + + /** + * Where the cardholder received the service, when different from the card acceptor + * location. This is populated from network data elements such as Mastercard DE-122 + * SE1 SF9-14 and Visa F34 DS02. + */ + service_location: CardAuthorization.ServiceLocation | null; + + /** + * @deprecated Deprecated, use `amounts`. Amount (in cents) of the transaction that + * has been settled, including any acquirer fees. + */ + settled_amount: number; + + /** + * The type of authorization request that this request is for. Note that + * `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + * users with credit decisioning via ASA enabled. + */ + status: + | 'AUTHORIZATION' + | 'CREDIT_AUTHORIZATION' + | 'FINANCIAL_AUTHORIZATION' + | 'FINANCIAL_CREDIT_AUTHORIZATION' + | 'BALANCE_INQUIRY'; + + /** + * The entity that initiated the transaction. + */ + transaction_initiator: 'CARDHOLDER' | 'MERCHANT' | 'UNKNOWN'; + + account_type?: 'CHECKING' | 'SAVINGS'; + + cardholder_authentication?: TransactionsAPI.CardholderAuthentication; + + /** + * Deprecated, use `cash_amount`. + */ + cashback?: number; + + /** + * @deprecated Deprecated, use `amounts`. If the transaction was requested in a + * currency other than the settlement currency, this field will be populated to + * indicate the rate used to translate the merchant_amount to the amount (i.e., + * `merchant_amount` x `conversion_rate` = `amount`). Note that the + * `merchant_amount` is in the local currency and the amount is in the settlement + * currency. + */ + conversion_rate?: number; + + /** + * The event token associated with the authorization. This field is only set for + * programs enrolled into the beta. + */ + event_token?: string; + + /** + * Optional Object containing information if the Card is a part of a Fleet managed + * program + */ + fleet_info?: CardAuthorization.FleetInfo | null; + + /** + * The latest Authorization Challenge that was issued to the cardholder for this + * merchant. + */ + latest_challenge?: CardAuthorization.LatestChallenge; + + /** + * Card network of the authorization. + */ + network?: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; + + /** + * Network-provided score assessing risk level associated with a given + * authorization. Scores are on a range of 0-999, with 0 representing the lowest + * risk and 999 representing the highest risk. For Visa transactions, where the raw + * score has a range of 0-99, Lithic will normalize the score by multiplying the + * raw score by 10x. + */ + network_risk_score?: number | null; + + /** + * Contains raw data provided by the card network, including attributes that + * provide further context about the authorization. If populated by the network, + * data is organized by Lithic and passed through without further modification. + * Please consult the official network documentation for more details about these + * values and how to use them. This object is only available to certain programs- + * contact your Customer Success Manager to discuss enabling access. + */ + network_specific_data?: CardAuthorization.NetworkSpecificData | null; + + pos?: CardAuthorization.Pos; + + token_info?: TransactionsAPI.TokenInfo | null; + + /** + * Deprecated: approximate time-to-live for the authorization. + */ + ttl?: string; +} + +export namespace CardAuthorization { + /** + * Structured amounts for this authorization. The `cardholder` and `merchant` + * amounts reflect the original network authorization values. For programs with + * hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + * `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + * anticipated final transaction amounts such as tips or fuel fill-ups + */ + export interface Amounts { + cardholder: Amounts.Cardholder; + + hold: Amounts.Hold | null; + + merchant: Amounts.Merchant; + + settlement: Amounts.Settlement | null; + } + + export namespace Amounts { + export interface Cardholder { + /** + * Amount in the smallest unit of the applicable currency (e.g., cents) + */ + amount: number; + + /** + * Exchange rate used for currency conversion + */ + conversion_rate: string; + + /** + * 3-character alphabetic ISO 4217 currency + */ + currency: Shared.Currency; + } + + export interface Hold { + /** + * Amount in the smallest unit of the applicable currency (e.g., cents) + */ + amount: number; + + /** + * 3-character alphabetic ISO 4217 currency + */ + currency: Shared.Currency; + } + + export interface Merchant { + /** + * Amount in the smallest unit of the applicable currency (e.g., cents) + */ + amount: number; + + /** + * 3-character alphabetic ISO 4217 currency + */ + currency: Shared.Currency; + } + + export interface Settlement { + /** + * Amount in the smallest unit of the applicable currency (e.g., cents) + */ + amount: number; + + /** + * 3-character alphabetic ISO 4217 currency + */ + currency: Shared.Currency; + } + } + + export interface Avs { + /** + * Cardholder address + */ + address: string; + + /** + * Lithic's evaluation result comparing the transaction's address data with the + * cardholder KYC data if it exists. In the event Lithic does not have any + * Cardholder KYC data, or the transaction does not contain any address data, + * NOT_PRESENT will be returned + */ + address_on_file_match: 'MATCH' | 'MATCH_ADDRESS_ONLY' | 'MATCH_ZIP_ONLY' | 'MISMATCH' | 'NOT_PRESENT'; + + /** + * Cardholder ZIP code + */ + zipcode: string; + } + + /** + * Card object in ASA + */ + export interface Card { + /** + * Globally unique identifier for the card. + */ + token: string; + + /** + * Last four digits of the card number + */ + last_four: string; + + /** + * Customizable name to identify the card + */ + memo: string; + + /** + * Amount (in cents) to limit approved authorizations. Purchase requests above the + * spend limit will be declined (refunds and credits will be approved). + * + * Note that while spend limits are enforced based on authorized and settled volume + * on a card, they are not recommended to be used for balance or + * reconciliation-level accuracy. Spend limits also cannot block force posted + * charges (i.e., when a merchant sends a clearing message without a prior + * authorization). + */ + spend_limit: number; + + /** + * Note that to support recurring monthly payments, which can occur on different + * day every month, the time window we consider for MONTHLY velocity starts 6 days + * after the current calendar date one month prior. + */ + spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; + + state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; + + type: 'SINGLE_USE' | 'MERCHANT_LOCKED' | 'UNLOCKED' | 'PHYSICAL' | 'DIGITAL_WALLET' | 'VIRTUAL'; + } + + /** + * Merchant information including full location details. + */ + export interface Merchant extends Shared.Merchant { + /** + * Phone number of card acceptor. + */ + phone_number: string | null; + + /** + * Postal code of card acceptor. + */ + postal_code: string | null; + + /** + * Street address of card acceptor. + */ + street_address: string | null; + } + + /** + * Network name validation data, present when the card network requested name + * validation for this transaction. Contains the cardholder name provided by the + * network and Lithic's computed match result against KYC data on file. + */ + export interface NameValidation { + /** + * Cardholder name as provided by the card network. + */ + name: NameValidation.Name; + + /** + * Lithic's computed match result comparing the network-provided name to the name + * on file. + */ + name_on_file_match: NameValidation.NameOnFileMatch; + } + + export namespace NameValidation { + /** + * Cardholder name as provided by the card network. + */ + export interface Name { + /** + * First name + */ + first: string; + + /** + * Last name + */ + last: string; + + /** + * Middle name + */ + middle: string | null; + } + + /** + * Lithic's computed match result comparing the network-provided name to the name + * on file. + */ + export interface NameOnFileMatch { + /** + * Overall name match result. + */ + full_name: 'MATCH' | 'PARTIAL_MATCH' | 'NO_MATCH' | 'UNVERIFIED'; + } + } + + /** + * Where the cardholder received the service, when different from the card acceptor + * location. This is populated from network data elements such as Mastercard DE-122 + * SE1 SF9-14 and Visa F34 DS02. + */ + export interface ServiceLocation { + /** + * City of service location. + */ + city: string | null; + + /** + * Country code of service location, ISO 3166-1 alpha-3. + */ + country: string | null; + + /** + * Postal code of service location. + */ + postal_code: string | null; + + /** + * State/province code of service location, ISO 3166-2. + */ + state: string | null; + + /** + * Street address of service location. + */ + street_address: string | null; + } + + /** + * Optional Object containing information if the Card is a part of a Fleet managed + * program + */ + export interface FleetInfo { + /** + * Code indicating what the driver was prompted to enter at time of purchase. This + * is configured at a program level and is a static configuration, and does not + * change on a request to request basis + */ + fleet_prompt_code: 'NO_PROMPT' | 'VEHICLE_NUMBER' | 'DRIVER_NUMBER'; + + /** + * Code indicating which restrictions, if any, there are on purchase. This is + * configured at a program level and is a static configuration, and does not change + * on a request to request basis + */ + fleet_restriction_code: 'NO_RESTRICTIONS' | 'FUEL_ONLY'; + + /** + * Number representing the driver + */ + driver_number?: string | null; + + /** + * Number associated with the vehicle + */ + vehicle_number?: string | null; + } + + /** + * The latest Authorization Challenge that was issued to the cardholder for this + * merchant. + */ + export interface LatestChallenge { + /** + * The date and time when the Authorization Challenge was completed in UTC. Filled + * only if the challenge has been completed. + */ + completed_at: string | null; + + /** + * The date and time when the Authorization Challenge was created in UTC + */ + created: string; + + /** + * The method used to deliver the challenge to the cardholder + * + * - `SMS` - Challenge was delivered via SMS + * - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method + */ + method: 'SMS' | 'OUT_OF_BAND'; + + /** + * The phone number used for sending the Authorization Challenge. Present only when + * the challenge method is `SMS`. + */ + phone_number: string | null; + + /** + * The status of the Authorization Challenge + * + * - `COMPLETED` - Challenge was successfully completed by the cardholder + * - `DECLINED` - Challenge was declined by the cardholder + * - `PENDING` - Challenge is still open + * - `EXPIRED` - Challenge has expired without being completed + * - `ERROR` - There was an error processing the challenge + */ + status: 'COMPLETED' | 'DECLINED' | 'PENDING' | 'EXPIRED' | 'ERROR'; + } + + /** + * Contains raw data provided by the card network, including attributes that + * provide further context about the authorization. If populated by the network, + * data is organized by Lithic and passed through without further modification. + * Please consult the official network documentation for more details about these + * values and how to use them. This object is only available to certain programs- + * contact your Customer Success Manager to discuss enabling access. + */ + export interface NetworkSpecificData { + mastercard?: NetworkSpecificData.Mastercard | null; + + visa?: NetworkSpecificData.Visa | null; + } + + export namespace NetworkSpecificData { + export interface Mastercard { + /** + * Indicates the electronic commerce security level and UCAF collection. + */ + ecommerce_security_level_indicator?: string | null; + + /** + * The On-behalf Service performed on the transaction and the results. Contains all + * applicable, on-behalf service results that were performed on a given + * transaction. + */ + on_behalf_service_result?: Array | null; + + /** + * Indicates the type of additional transaction purpose. + */ + transaction_type_identifier?: string | null; + } + + export namespace Mastercard { + export interface OnBehalfServiceResult { + /** + * Indicates the results of the service processing. + */ + result_1: string; + + /** + * Identifies the results of the service processing. + */ + result_2: string; + + /** + * Indicates the service performed on the transaction. + */ + service: string; + } + } + + export interface Visa { + /** + * Identifies the purpose or category of a transaction, used to classify and + * process transactions according to Visa’s rules. + */ + business_application_identifier?: string | null; + } + } + + export interface Pos { + /** + * POS > Entry Mode object in ASA + */ + entry_mode?: Pos.EntryMode; + + terminal?: Pos.Terminal; + } + + export namespace Pos { + /** + * POS > Entry Mode object in ASA + */ + export interface EntryMode { + /** + * Card Presence Indicator + */ + card?: 'PRESENT' | 'NOT_PRESENT' | 'UNKNOWN'; + + /** + * Cardholder Presence Indicator + */ + cardholder?: + | 'DEFERRED_BILLING' + | 'ELECTRONIC_ORDER' + | 'INSTALLMENT' + | 'MAIL_ORDER' + | 'NOT_PRESENT' + | 'PRESENT' + | 'REOCCURRING' + | 'TELEPHONE_ORDER' + | 'UNKNOWN'; + + /** + * Method of entry for the PAN + */ + pan?: + | 'AUTO_ENTRY' + | 'BAR_CODE' + | 'CONTACTLESS' + | 'ECOMMERCE' + | 'ERROR_KEYED' + | 'ERROR_MAGNETIC_STRIPE' + | 'ICC' + | 'KEY_ENTERED' + | 'MAGNETIC_STRIPE' + | 'MANUAL' + | 'OCR' + | 'SECURE_CARDLESS' + | 'UNSPECIFIED' + | 'UNKNOWN' + | 'CREDENTIAL_ON_FILE'; + + /** + * Indicates whether the cardholder entered the PIN. True if the PIN was entered. + */ + pin_entered?: boolean; + } + + export interface Terminal { + /** + * True if a clerk is present at the sale. + */ + attended: boolean; + + /** + * True if the terminal is capable of retaining the card. + */ + card_retention_capable: boolean; + + /** + * True if the sale was made at the place of business (vs. mobile). + */ + on_premise: boolean; + + /** + * The person that is designated to swipe the card + */ + operator: 'ADMINISTRATIVE' | 'CARDHOLDER' | 'CARD_ACCEPTOR' | 'UNKNOWN'; + + /** + * True if the terminal is capable of partial approval. Partial approval is when + * part of a transaction is approved and another payment must be used for the + * remainder. Example scenario: A $40 transaction is attempted on a prepaid card + * with a $25 balance. If partial approval is enabled, $25 can be authorized, at + * which point the POS will prompt the user for an additional payment of $15. + */ + partial_approval_capable: boolean; + + /** + * Status of whether the POS is able to accept PINs + */ + pin_capability: 'CAPABLE' | 'INOPERATIVE' | 'NOT_CAPABLE' | 'UNSPECIFIED'; + + /** + * POS Type + */ + type: + | 'ADMINISTRATIVE' + | 'ATM' + | 'AUTHORIZATION' + | 'COUPON_MACHINE' + | 'DIAL_TERMINAL' + | 'ECOMMERCE' + | 'ECR' + | 'FUEL_MACHINE' + | 'HOME_TERMINAL' + | 'MICR' + | 'OFF_PREMISE' + | 'PAYMENT' + | 'PDA' + | 'PHONE' + | 'POINT' + | 'POS_TERMINAL' + | 'PUBLIC_UTILITY' + | 'SELF_SERVICE' + | 'TELEVISION' + | 'TELLER' + | 'TRAVELERS_CHECK_MACHINE' + | 'VENDING' + | 'VOICE' + | 'UNKNOWN'; + + /** + * Uniquely identifies a terminal at the card acceptor location of acquiring + * institutions or merchant POS Systems. Left justified with trailing spaces. + */ + acceptor_terminal_id?: string | null; + } + } +} + +export interface CardAuthorizationChallengeResponseParams { + /** + * Whether the cardholder has approved or declined the issued challenge + */ + response: 'APPROVE' | 'DECLINE'; +} + +export declare namespace CardAuthorizations { + export { + type CardAuthorization as CardAuthorization, + type CardAuthorizationChallengeResponseParams as CardAuthorizationChallengeResponseParams, + }; +} diff --git a/src/resources/card-bulk-orders.ts b/src/resources/card-bulk-orders.ts index 8d9ee205..c9f0a8b3 100644 --- a/src/resources/card-bulk-orders.ts +++ b/src/resources/card-bulk-orders.ts @@ -8,12 +8,11 @@ import { path } from '../internal/utils/path'; export class CardBulkOrders extends APIResource { /** - * Create a new bulk order for physical card shipments **[BETA]**. Cards can be - * added to the order via the POST /v1/cards endpoint by specifying the - * bulk_order_token. Lock the order via PATCH - * /v1/card_bulk_orders/{bulk_order_token} to prepare for shipment. Please work - * with your Customer Success Manager and card personalization bureau to ensure - * bulk shipping is supported for your program. + * Create a new bulk order for physical card shipments. Cards can be added to the + * order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock + * the order via PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for + * shipment. Please work with your Customer Success Manager and card + * personalization bureau to ensure bulk shipping is supported for your program. * * @example * ```ts @@ -37,7 +36,7 @@ export class CardBulkOrders extends APIResource { } /** - * Retrieve a specific bulk order by token **[BETA]** + * Retrieve a specific bulk order by token * * @example * ```ts @@ -51,8 +50,8 @@ export class CardBulkOrders extends APIResource { } /** - * Update a bulk order **[BETA]**. Primarily used to lock the order, preventing - * additional cards from being added + * Update a bulk order. Primarily used to lock the order, preventing additional + * cards from being added * * @example * ```ts @@ -71,7 +70,7 @@ export class CardBulkOrders extends APIResource { } /** - * List bulk orders for physical card shipments **[BETA]** + * List bulk orders for physical card shipments * * @example * ```ts @@ -122,9 +121,10 @@ export interface CardBulkOrder { shipping_address: unknown; /** - * Shipping method for all cards in this bulk order + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + * BULK_EXPRESS are only available with Perfect Plastic Printing */ - shipping_method: 'BULK_EXPEDITED'; + shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; /** * Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED @@ -151,9 +151,10 @@ export interface CardBulkOrderCreateParams { shipping_address: unknown; /** - * Shipping method for all cards in this bulk order + * Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + * BULK_EXPRESS are only available with Perfect Plastic Printing */ - shipping_method: 'BULK_EXPEDITED'; + shipping_method: 'BULK_EXPEDITED' | 'BULK_PRIORITY' | 'BULK_2_DAY' | 'BULK_EXPRESS'; } export interface CardBulkOrderUpdateParams { diff --git a/src/resources/card-programs.ts b/src/resources/card-programs.ts index bda3b794..cb182299 100644 --- a/src/resources/card-programs.ts +++ b/src/resources/card-programs.ts @@ -77,7 +77,7 @@ export interface CardProgram { /** * 3-character alphabetic ISO 4217 code for the currency of the cardholder. */ - cardholder_currency?: string; + cardholder_currency?: string | null; /** * List of 3-character alphabetic ISO 4217 codes for the currencies that the card diff --git a/src/resources/cards/cards.ts b/src/resources/cards/cards.ts index 40af39d8..5bb08e6b 100644 --- a/src/resources/cards/cards.ts +++ b/src/resources/cards/cards.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../core/resource'; import * as Shared from '../shared'; +import * as AuthRulesAPI from '../auth-rules/auth-rules'; import * as BalancesAPI from './balances'; import { BalanceListParams, Balances } from './balances'; import * as FinancialTransactionsAPI from './financial-transactions'; @@ -150,6 +151,9 @@ export class Cards extends APIResource { } /** + * **Deprecated.** Use the modern embedded card flow instead: create a session with + * `POST /v1/cards/{card_token}/embed` and render it via `GET /v1/embed`. + * * Handling full card PANs and CVV codes requires that you comply with the Payment * Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce * their compliance obligations by leveraging our embedded card UI solution @@ -178,13 +182,7 @@ export class Cards extends APIResource { * but **do not ever embed your API key into front end code, as doing so introduces * a serious security vulnerability**. * - * @example - * ```ts - * const response = await client.cards.embed({ - * embed_request: 'embed_request', - * hmac: 'hmac', - * }); - * ``` + * @deprecated */ embed(query: CardEmbedParams, options?: RequestOptions): APIPromise { return this._client.get('/v1/embed/card', { @@ -352,6 +350,25 @@ export class Cards extends APIResource { return this._client.post(path`/v1/cards/${cardToken}/renew`, { body, ...options }); } + /** + * Returns behavioral feature state derived from a card's transaction history. + * + * These signals expose the same data used by behavioral rule attributes (e.g. + * `AMOUNT_Z_SCORE` with `scope: CARD`, `IS_NEW_COUNTRY` with `scope: CARD`) and + * custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect + * feature values before writing rules and debug rule behavior. + * + * @example + * ```ts + * const signalsResponse = await client.cards.retrieveSignals( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` + */ + retrieveSignals(cardToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v1/cards/${cardToken}/signals`, options); + } + /** * Get a Card's available spend limit, which is based on the spend limit configured * on the Card and the amount already spent over the spend limit's duration. For @@ -373,8 +390,8 @@ export class Cards extends APIResource { /** * Get card configuration such as spend limit and state. Customers must be PCI * compliant to use this endpoint. Please contact - * [support@lithic.com](mailto:support@lithic.com) for questions. _Note: this is a - * `POST` endpoint because it is more secure to send sensitive data in a request + * [support.lithic.com](https://support.lithic.com/) for questions. _Note: this is + * a `POST` endpoint because it is more secure to send sensitive data in a request * body than in a URL._ * * @example @@ -427,7 +444,7 @@ export interface Card extends NonPCICard { /** * Primary Account Number (PAN) (i.e. the card number). Customers must be PCI * compliant to have PAN returned as a field in production. Please contact - * support@lithic.com for questions. + * https://support.lithic.com/ for questions. */ pan?: string; } @@ -524,9 +541,9 @@ export interface NonPCICard { created: string; /** - * Deprecated: Funding account for the card. + * Funding account for a card */ - funding: NonPCICard.Funding; + funding: NonPCICard.Funding | null; /** * Last four digits of the card number. @@ -611,7 +628,7 @@ export interface NonPCICard { * after tokenization. This artwork must be approved by Mastercard and configured * by Lithic to use. */ - digital_card_art_token?: string; + digital_card_art_token?: string | null; /** * Two digit (MM) expiry month. @@ -652,7 +669,7 @@ export interface NonPCICard { * before use. Specifies the configuration (i.e., physical card art) that the card * should be manufactured with. */ - product_id?: string; + product_id?: string | null; /** * If the card is a replacement for another card, the globally unique identifier @@ -693,12 +710,13 @@ export interface NonPCICard { | 'INTERNAL_REVIEW' | 'EXPIRED' | 'UNDELIVERABLE' - | 'OTHER'; + | 'OTHER' + | null; } export namespace NonPCICard { /** - * Deprecated: Funding account for the card. + * Funding account for a card */ export interface Funding { /** @@ -740,7 +758,7 @@ export namespace NonPCICard { /** * The nickname given to the `FundingAccount` or `null` if it has no nickname. */ - nickname?: string; + nickname?: string | null; } } @@ -917,13 +935,15 @@ export interface CardCreateParams { /** * Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` - * is provided, an expiration date will be generated. + * is provided, an expiration date five years in the future will be generated. Five + * years is the maximum expiration date. */ exp_month?: string; /** * Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` - * is provided, an expiration date will be generated. + * is provided, an expiration date five years in the future will be generated. Five + * years is the maximum expiration date. */ exp_year?: string; @@ -1031,11 +1051,12 @@ export interface CardCreateParams { * tracking * - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight * or similar international option, with tracking - * - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + * shipping method and timeline are inherited from the parent bulk order. */ shipping_method?: | '2_DAY' - | 'BULK_EXPEDITED' + | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' @@ -1263,11 +1284,12 @@ export interface CardConvertPhysicalParams { * tracking * - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight * or similar international option, with tracking - * - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + * shipping method and timeline are inherited from the parent bulk order. */ shipping_method?: | '2_DAY' - | 'BULK_EXPEDITED' + | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' @@ -1431,11 +1453,12 @@ export interface CardReissueParams { * tracking * - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight * or similar international option, with tracking - * - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + * shipping method and timeline are inherited from the parent bulk order. */ shipping_method?: | '2_DAY' - | 'BULK_EXPEDITED' + | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' @@ -1456,13 +1479,15 @@ export interface CardRenewParams { /** * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - * an expiration date six years in the future will be generated. + * an expiration date five years in the future will be generated. Five years is the + * maximum expiration date. */ exp_month?: string; /** * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - * provided, an expiration date six years in the future will be generated. + * provided, an expiration date five years in the future will be generated. Five + * years is the maximum expiration date. */ exp_year?: string; @@ -1488,11 +1513,12 @@ export interface CardRenewParams { * tracking * - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight * or similar international option, with tracking - * - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping + * - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + * shipping method and timeline are inherited from the parent bulk order. */ shipping_method?: | '2_DAY' - | 'BULK_EXPEDITED' + | 'BULK' | 'EXPEDITED' | 'EXPRESS' | 'PRIORITY' diff --git a/src/resources/disputes.ts b/src/resources/disputes.ts index 97c241a8..f07d9bdf 100644 --- a/src/resources/disputes.ts +++ b/src/resources/disputes.ts @@ -10,7 +10,7 @@ import { maybeMultipartFormRequestOptions } from '../internal/uploads'; export class Disputes extends APIResource { /** - * Initiate a dispute. + * Request a chargeback. * * @example * ```ts @@ -27,7 +27,7 @@ export class Disputes extends APIResource { } /** - * Get dispute. + * Get chargeback request. * * @example * ```ts @@ -41,7 +41,7 @@ export class Disputes extends APIResource { } /** - * Update dispute. Can only be modified if status is `NEW`. + * Update chargeback request. Can only be modified if status is `NEW`. * * @example * ```ts @@ -55,7 +55,7 @@ export class Disputes extends APIResource { } /** - * List disputes. + * List chargeback requests. * * @example * ```ts @@ -73,7 +73,7 @@ export class Disputes extends APIResource { } /** - * Withdraw dispute. + * Withdraw chargeback request. * * @example * ```ts @@ -87,8 +87,8 @@ export class Disputes extends APIResource { } /** - * Soft delete evidence for a dispute. Evidence will not be reviewed or submitted - * by Lithic after it is withdrawn. + * Soft delete evidence for a chargeback request. Evidence will not be reviewed or + * submitted by Lithic after it is withdrawn. * * @example * ```ts @@ -111,8 +111,8 @@ export class Disputes extends APIResource { } /** - * Use this endpoint to upload evidences for the dispute. It will return a URL to - * upload your documents to. The URL will expire in 30 minutes. + * Use this endpoint to upload evidence for a chargeback request. It will return a + * URL to upload your documents to. The URL will expire in 30 minutes. * * Uploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be * less than 5 GiB. @@ -134,7 +134,7 @@ export class Disputes extends APIResource { } /** - * List evidence metadata for a dispute. + * List evidence for a chargeback request. * * @example * ```ts @@ -159,7 +159,7 @@ export class Disputes extends APIResource { } /** - * Get a dispute's evidence metadata. + * Get evidence for a chargeback request. * * @example * ```ts @@ -437,12 +437,12 @@ export interface DisputeEvidence { export interface DisputeCreateParams { /** - * Amount to dispute + * Amount for chargeback */ amount: number; /** - * Reason for dispute + * Reason for chargeback */ reason: | 'ATM_CASH_MISDISPENSE' @@ -461,39 +461,39 @@ export interface DisputeCreateParams { | 'REFUND_NOT_PROCESSED'; /** - * Transaction to dispute + * Transaction for chargeback */ transaction_token: string; /** - * Date the customer filed the dispute + * Date the customer filed the chargeback request */ customer_filed_date?: string; /** - * Customer description of dispute + * Customer description */ customer_note?: string; } export interface DisputeUpdateParams { /** - * Amount to dispute + * Amount for chargeback */ amount?: number; /** - * Date the customer filed the dispute + * Date the customer filed the chargeback request */ customer_filed_date?: string; /** - * Customer description of dispute + * Customer description */ customer_note?: string; /** - * Reason for dispute + * Reason for chargeback */ reason?: | 'ATM_CASH_MISDISPENSE' @@ -526,7 +526,7 @@ export interface DisputeListParams extends CursorPageParams { end?: string; /** - * List disputes of a specific status. + * Filter by status. */ status?: | 'ARBITRATION' diff --git a/src/resources/events/events.ts b/src/resources/events/events.ts index 5185de75..d6d9567a 100644 --- a/src/resources/events/events.ts +++ b/src/resources/events/events.ts @@ -98,7 +98,7 @@ export interface Event { * The type of event that occurred. Possible values: * * - account_holder_document.updated: Occurs when an account holder's document - * upload status has been updated + * upload status has been updated. * - account_holder.created: Occurs when a new account_holder is created. * - account_holder.updated: Occurs when an account_holder is updated. * - account_holder.verification: Occurs when an asynchronous account_holder's @@ -109,6 +109,12 @@ export interface Event { * created. * - book_transfer_transaction.updated: Occurs when a book transfer transaction is * updated. + * - card_authorization.challenge: Occurs when an Out of Band challenge is issued + * during card authorization. The card program should issue its own challenge to + * the cardholder and then respond via + * [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + * - card_authorization.challenge_response: Occurs when a cardholder responds to a + * challenge during card authorization. * - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial * data is processed for a transaction event. * - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -121,9 +127,15 @@ export interface Event { * - card.renewed: Occurs when a card is renewed. * - card.shipped: Occurs when a card is shipped. * - card.updated: Occurs when a card is updated. - * - digital_wallet.tokenization_approval_request: Occurs when a tokenization - * approval request is made. This event will be deprecated in the future. We - * recommend using `tokenization.approval_request` instead. + * - claim_document.accepted: Occurs when a claim document passes validation and is + * accepted. + * - claim_document.rejected: Occurs when a claim document fails validation and is + * rejected. + * - claim_document.uploaded: Occurs when a claim document is uploaded and begins + * validation. + * - claim.created: Occurs when a dispute intake claim is created. + * - claim.updated: Occurs when a dispute intake claim is updated, such as a status + * change or a change to its outstanding requirements. * - digital_wallet.tokenization_result: Occurs when a tokenization request * succeeded or failed. * @@ -150,10 +162,25 @@ export interface Event { * This event will be deprecated in the future. We recommend using * `tokenization.updated` instead. * - * - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + * - dispute_evidence.upload_failed: Occurs when an evidence upload fails for a + * dispute filed through the Chargebacks API (`/v1/disputes`). + * + * This event is not emitted for Managed Disputes. + * * - dispute_transaction.created: Occurs when a new dispute transaction is created - * - dispute_transaction.updated: Occurs when a dispute transaction is updated - * - dispute.updated: Occurs when a dispute is updated. + * for a Managed Disputes case. + * - dispute_transaction.updated: Occurs when a dispute transaction for a Managed + * Disputes case is updated. + * - dispute.updated: Occurs when a dispute filed through the Chargebacks API + * (`/v1/disputes`) is created or updated. + * + * This event is not emitted for Managed Disputes. Use + * `dispute_transaction.created` and `dispute_transaction.updated` instead. + * + * - embed.session_generated: Occurs when a card embed session is successfully + * generated. + * - embed.viewed: Occurs when a card detail is successfully revealed through an + * embed. * - external_bank_account.created: Occurs when an external bank account is * created. * - external_bank_account.updated: Occurs when an external bank account is @@ -175,12 +202,12 @@ export interface Event { * - payment_transaction.updated: Occurs when a payment transaction is updated. * - settlement_report.updated: Occurs when a settlement report is created or * updated. - * - statements.created: Occurs when a statement has been created + * - statements.created: Occurs when a statement has been created. * - three_ds_authentication.challenge: The `three_ds_authentication.challenge` * event. Upon receiving this request, the Card Program should issue its own * challenge to the cardholder. After a cardholder challenge is successfully * completed, the Card Program needs to respond back to Lithic by call to - * [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + * [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/postthreedschallengeresponse). * Then the cardholder must navigate back to the merchant checkout flow to * complete the transaction. Some merchants will include an `app_requestor_url` * for app-based purchases; Lithic recommends triggering a redirect to that URL @@ -206,6 +233,8 @@ export interface Event { | 'balance.updated' | 'book_transfer_transaction.created' | 'book_transfer_transaction.updated' + | 'card_authorization.challenge' + | 'card_authorization.challenge_response' | 'card_transaction.enhanced_data.created' | 'card_transaction.enhanced_data.updated' | 'card_transaction.updated' @@ -215,7 +244,11 @@ export interface Event { | 'card.renewed' | 'card.shipped' | 'card.updated' - | 'digital_wallet.tokenization_approval_request' + | 'claim_document.accepted' + | 'claim_document.rejected' + | 'claim_document.uploaded' + | 'claim.created' + | 'claim.updated' | 'digital_wallet.tokenization_result' | 'digital_wallet.tokenization_two_factor_authentication_code' | 'digital_wallet.tokenization_two_factor_authentication_code_sent' @@ -224,6 +257,8 @@ export interface Event { | 'dispute_transaction.created' | 'dispute_transaction.updated' | 'dispute.updated' + | 'embed.session_generated' + | 'embed.viewed' | 'external_bank_account.created' | 'external_bank_account.updated' | 'external_payment.created' @@ -285,6 +320,8 @@ export interface EventSubscription { | 'balance.updated' | 'book_transfer_transaction.created' | 'book_transfer_transaction.updated' + | 'card_authorization.challenge' + | 'card_authorization.challenge_response' | 'card_transaction.enhanced_data.created' | 'card_transaction.enhanced_data.updated' | 'card_transaction.updated' @@ -294,7 +331,11 @@ export interface EventSubscription { | 'card.renewed' | 'card.shipped' | 'card.updated' - | 'digital_wallet.tokenization_approval_request' + | 'claim_document.accepted' + | 'claim_document.rejected' + | 'claim_document.uploaded' + | 'claim.created' + | 'claim.updated' | 'digital_wallet.tokenization_result' | 'digital_wallet.tokenization_two_factor_authentication_code' | 'digital_wallet.tokenization_two_factor_authentication_code_sent' @@ -303,6 +344,8 @@ export interface EventSubscription { | 'dispute_transaction.created' | 'dispute_transaction.updated' | 'dispute.updated' + | 'embed.session_generated' + | 'embed.viewed' | 'external_bank_account.created' | 'external_bank_account.updated' | 'external_payment.created' @@ -402,6 +445,8 @@ export interface EventListParams extends CursorPageParams { | 'balance.updated' | 'book_transfer_transaction.created' | 'book_transfer_transaction.updated' + | 'card_authorization.challenge' + | 'card_authorization.challenge_response' | 'card_transaction.enhanced_data.created' | 'card_transaction.enhanced_data.updated' | 'card_transaction.updated' @@ -411,7 +456,11 @@ export interface EventListParams extends CursorPageParams { | 'card.renewed' | 'card.shipped' | 'card.updated' - | 'digital_wallet.tokenization_approval_request' + | 'claim_document.accepted' + | 'claim_document.rejected' + | 'claim_document.uploaded' + | 'claim.created' + | 'claim.updated' | 'digital_wallet.tokenization_result' | 'digital_wallet.tokenization_two_factor_authentication_code' | 'digital_wallet.tokenization_two_factor_authentication_code_sent' @@ -420,6 +469,8 @@ export interface EventListParams extends CursorPageParams { | 'dispute_transaction.created' | 'dispute_transaction.updated' | 'dispute.updated' + | 'embed.session_generated' + | 'embed.viewed' | 'external_bank_account.created' | 'external_bank_account.updated' | 'external_payment.created' diff --git a/src/resources/events/subscriptions.ts b/src/resources/events/subscriptions.ts index 34599776..3cd8b991 100644 --- a/src/resources/events/subscriptions.ts +++ b/src/resources/events/subscriptions.ts @@ -175,6 +175,8 @@ export interface SubscriptionCreateParams { | 'balance.updated' | 'book_transfer_transaction.created' | 'book_transfer_transaction.updated' + | 'card_authorization.challenge' + | 'card_authorization.challenge_response' | 'card_transaction.enhanced_data.created' | 'card_transaction.enhanced_data.updated' | 'card_transaction.updated' @@ -184,7 +186,11 @@ export interface SubscriptionCreateParams { | 'card.renewed' | 'card.shipped' | 'card.updated' - | 'digital_wallet.tokenization_approval_request' + | 'claim_document.accepted' + | 'claim_document.rejected' + | 'claim_document.uploaded' + | 'claim.created' + | 'claim.updated' | 'digital_wallet.tokenization_result' | 'digital_wallet.tokenization_two_factor_authentication_code' | 'digital_wallet.tokenization_two_factor_authentication_code_sent' @@ -193,6 +199,8 @@ export interface SubscriptionCreateParams { | 'dispute_transaction.created' | 'dispute_transaction.updated' | 'dispute.updated' + | 'embed.session_generated' + | 'embed.viewed' | 'external_bank_account.created' | 'external_bank_account.updated' | 'external_payment.created' @@ -252,6 +260,8 @@ export interface SubscriptionUpdateParams { | 'balance.updated' | 'book_transfer_transaction.created' | 'book_transfer_transaction.updated' + | 'card_authorization.challenge' + | 'card_authorization.challenge_response' | 'card_transaction.enhanced_data.created' | 'card_transaction.enhanced_data.updated' | 'card_transaction.updated' @@ -261,7 +271,11 @@ export interface SubscriptionUpdateParams { | 'card.renewed' | 'card.shipped' | 'card.updated' - | 'digital_wallet.tokenization_approval_request' + | 'claim_document.accepted' + | 'claim_document.rejected' + | 'claim_document.uploaded' + | 'claim.created' + | 'claim.updated' | 'digital_wallet.tokenization_result' | 'digital_wallet.tokenization_two_factor_authentication_code' | 'digital_wallet.tokenization_two_factor_authentication_code_sent' @@ -270,6 +284,8 @@ export interface SubscriptionUpdateParams { | 'dispute_transaction.created' | 'dispute_transaction.updated' | 'dispute.updated' + | 'embed.session_generated' + | 'embed.viewed' | 'external_bank_account.created' | 'external_bank_account.updated' | 'external_payment.created' @@ -359,6 +375,8 @@ export interface SubscriptionSendSimulatedExampleParams { | 'balance.updated' | 'book_transfer_transaction.created' | 'book_transfer_transaction.updated' + | 'card_authorization.challenge' + | 'card_authorization.challenge_response' | 'card_transaction.enhanced_data.created' | 'card_transaction.enhanced_data.updated' | 'card_transaction.updated' @@ -368,7 +386,11 @@ export interface SubscriptionSendSimulatedExampleParams { | 'card.renewed' | 'card.shipped' | 'card.updated' - | 'digital_wallet.tokenization_approval_request' + | 'claim_document.accepted' + | 'claim_document.rejected' + | 'claim_document.uploaded' + | 'claim.created' + | 'claim.updated' | 'digital_wallet.tokenization_result' | 'digital_wallet.tokenization_two_factor_authentication_code' | 'digital_wallet.tokenization_two_factor_authentication_code_sent' @@ -377,6 +399,8 @@ export interface SubscriptionSendSimulatedExampleParams { | 'dispute_transaction.created' | 'dispute_transaction.updated' | 'dispute.updated' + | 'embed.session_generated' + | 'embed.viewed' | 'external_bank_account.created' | 'external_bank_account.updated' | 'external_payment.created' diff --git a/src/resources/external-bank-accounts/external-bank-accounts.ts b/src/resources/external-bank-accounts/external-bank-accounts.ts index 08f5efd9..1e46437c 100644 --- a/src/resources/external-bank-accounts/external-bank-accounts.ts +++ b/src/resources/external-bank-accounts/external-bank-accounts.ts @@ -108,6 +108,21 @@ export class ExternalBankAccounts extends APIResource { ); } + /** + * Pause an external bank account + * + * @example + * ```ts + * const externalBankAccount = + * await client.externalBankAccounts.pause( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` + */ + pause(externalBankAccountToken: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/v1/external_bank_accounts/${externalBankAccountToken}/pause`, options); + } + /** * Retry external bank account micro deposit verification. * @@ -152,6 +167,30 @@ export class ExternalBankAccounts extends APIResource { }); } + /** + * Update the verification method for an external bank account. Verification method + * can only be updated if the `verification_state` is `PENDING`. + * + * @example + * ```ts + * const externalBankAccount = + * await client.externalBankAccounts.setVerificationMethod( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { verification_method: 'MICRO_DEPOSIT' }, + * ); + * ``` + */ + setVerificationMethod( + externalBankAccountToken: string, + body: ExternalBankAccountSetVerificationMethodParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post( + path`/v1/external_bank_accounts/${externalBankAccountToken}/set_verification_method`, + { body, ...options }, + ); + } + /** * Unpause an external bank account * @@ -1255,6 +1294,19 @@ export interface ExternalBankAccountRetryPrenoteParams { financial_account_token?: string; } +export interface ExternalBankAccountSetVerificationMethodParams { + /** + * The verification method to set for the external bank account + */ + verification_method: 'MICRO_DEPOSIT' | 'PRENOTE' | 'EXTERNALLY_VERIFIED'; + + /** + * The financial account token of the operating account to fund the micro deposits. + * Required when verification_method is MICRO_DEPOSIT or PRENOTE. + */ + financial_account_token?: string; +} + ExternalBankAccounts.MicroDeposits = MicroDeposits; export declare namespace ExternalBankAccounts { @@ -1274,6 +1326,7 @@ export declare namespace ExternalBankAccounts { type ExternalBankAccountListParams as ExternalBankAccountListParams, type ExternalBankAccountRetryMicroDepositsParams as ExternalBankAccountRetryMicroDepositsParams, type ExternalBankAccountRetryPrenoteParams as ExternalBankAccountRetryPrenoteParams, + type ExternalBankAccountSetVerificationMethodParams as ExternalBankAccountSetVerificationMethodParams, }; export { diff --git a/src/resources/external-bank-accounts/index.ts b/src/resources/external-bank-accounts/index.ts index f48376c6..804cc8aa 100644 --- a/src/resources/external-bank-accounts/index.ts +++ b/src/resources/external-bank-accounts/index.ts @@ -16,6 +16,7 @@ export { type ExternalBankAccountListParams, type ExternalBankAccountRetryMicroDepositsParams, type ExternalBankAccountRetryPrenoteParams, + type ExternalBankAccountSetVerificationMethodParams, type ExternalBankAccountListResponsesCursorPage, } from './external-bank-accounts'; export { diff --git a/src/resources/external-payments.ts b/src/resources/external-payments.ts index c51ffd83..0abeca89 100644 --- a/src/resources/external-payments.ts +++ b/src/resources/external-payments.ts @@ -234,7 +234,7 @@ export interface ExternalPaymentListParams extends CursorPageParams { business_account_token?: string; /** - * External Payment category to be returned. + * The external rail the funds moved on */ category?: | 'EXTERNAL_WIRE' diff --git a/src/resources/financial-accounts/balances.ts b/src/resources/financial-accounts/balances.ts index d5635c58..80412459 100644 --- a/src/resources/financial-accounts/balances.ts +++ b/src/resources/financial-accounts/balances.ts @@ -41,9 +41,10 @@ export interface BalanceListParams { balance_date?: string; /** - * Balance after a given financial event occured. For example, passing the - * event_token of a $5 CARD_CLEARING financial event will return a balance - * decreased by $5 + * Balance after a given financial event occured. Note: if an account receives + * multiple events around the same time whose financial impacts cancel out, a + * balance lookup by one of those event tokens may return 404, since their combined + * impact on the account is zero. */ last_transaction_event_token?: string; } diff --git a/src/resources/financial-accounts/financial-accounts.ts b/src/resources/financial-accounts/financial-accounts.ts index e6b0249d..c8a2c508 100644 --- a/src/resources/financial-accounts/financial-accounts.ts +++ b/src/resources/financial-accounts/financial-accounts.ts @@ -180,7 +180,7 @@ export class FinancialAccounts extends APIResource { * const financialAccount = * await client.financialAccounts.updateStatus( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { status: 'OPEN', substatus: 'CHARGED_OFF_FRAUD' }, + * { status: 'CLOSED', substatus: 'END_USER_REQUEST' }, * ); * ``` */ @@ -256,7 +256,9 @@ export interface FinancialAccount { | 'SECURITY' | 'PROGRAM_RECEIVABLES' | 'COLLECTION' - | 'PROGRAM_BANK_ACCOUNTS_PAYABLE'; + | 'PROGRAM_BANK_ACCOUNTS_PAYABLE' + | 'EARLY_DIRECT_DEPOSIT_FLOAT' + | 'PROVISIONAL_CREDIT_ACCOUNT'; updated: string; @@ -482,17 +484,17 @@ export interface StatementTotals { /** * Breakdown of credits */ - credit_details?: unknown; + credit_details?: unknown | null; /** * Breakdown of debits */ - debit_details?: unknown; + debit_details?: unknown | null; /** * Breakdown of payments */ - payment_details?: unknown; + payment_details?: unknown | null; } export interface FinancialAccountCreateParams { @@ -540,7 +542,7 @@ export interface FinancialAccountListParams { /** * List financial accounts of a given type */ - type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY'; + type?: 'ISSUING' | 'OPERATING' | 'RESERVE' | 'SECURITY' | 'EARLY_DIRECT_DEPOSIT_FLOAT'; } export interface FinancialAccountRegisterAccountNumberParams { @@ -562,6 +564,7 @@ export interface FinancialAccountUpdateStatusParams { | 'BANK_REQUEST' | 'CHARGED_OFF_DELINQUENT' | 'INTEREST_AND_FEES_PAUSED' + | 'DELINQUENT' | null; /** diff --git a/src/resources/financial-accounts/interest-tier-schedule.ts b/src/resources/financial-accounts/interest-tier-schedule.ts index 7d5a4b21..5e6ed433 100644 --- a/src/resources/financial-accounts/interest-tier-schedule.ts +++ b/src/resources/financial-accounts/interest-tier-schedule.ts @@ -194,6 +194,11 @@ export interface InterestTierSchedule { */ effective_date: string; + /** + * Custom rates per category for penalties + */ + penalty_rates?: unknown; + /** * Name of a tier contained in the credit product. Mutually exclusive with * tier_rates @@ -217,6 +222,11 @@ export interface InterestTierScheduleCreateParams { */ effective_date: string; + /** + * Custom rates per category for penalties + */ + penalty_rates?: unknown; + /** * Name of a tier contained in the credit product. Mutually exclusive with * tier_rates @@ -242,6 +252,11 @@ export interface InterestTierScheduleUpdateParams { */ financial_account_token: string; + /** + * Body param: Custom rates per category for penalties + */ + penalty_rates?: unknown; + /** * Body param: Name of a tier contained in the credit product. Mutually exclusive * with tier_rates diff --git a/src/resources/financial-accounts/loan-tapes.ts b/src/resources/financial-accounts/loan-tapes.ts index e94fa7bf..e8d81663 100644 --- a/src/resources/financial-accounts/loan-tapes.ts +++ b/src/resources/financial-accounts/loan-tapes.ts @@ -155,6 +155,11 @@ export interface LoanTape { ytd_totals: FinancialAccountsAPI.StatementTotals; + /** + * Day of the billing period that this loan tape covers, starting at 1 + */ + day_of_period?: number | null; + /** * Interest tier to which this account belongs to */ diff --git a/src/resources/financial-accounts/statements/line-items.ts b/src/resources/financial-accounts/statements/line-items.ts index 4ed54677..92535325 100644 --- a/src/resources/financial-accounts/statements/line-items.ts +++ b/src/resources/financial-accounts/statements/line-items.ts @@ -59,8 +59,15 @@ export namespace StatementLineItems { */ amount: number; + /** + * Note: Inbound wire transfers are coming soon (availability varies by partner + * bank). The WIRE category is a preview. To learn more, contact your customer + * success manager. + */ category: | 'ACH' + | 'WIRE' + | 'STABLECOIN' | 'BALANCE_OR_FUNDING' | 'FEE' | 'REWARD' @@ -79,7 +86,9 @@ export namespace StatementLineItems { | 'MANAGEMENT_FEE' | 'MANAGEMENT_REWARD' | 'MANAGEMENT_DISBURSEMENT' - | 'PROGRAM_FUNDING'; + | 'HOLD' + | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER'; /** * Timestamp of when the line item was generated @@ -179,12 +188,18 @@ export namespace StatementLineItems { | 'RETURNED_PAYMENT' | 'RETURNED_PAYMENT_REVERSAL' | 'LITHIC_NETWORK_PAYMENT' + | 'LITHIC_PROGRAM_TRANSFER' + | 'BANK_PROGRAM_TRANSFER' | 'ANNUAL' | 'ANNUAL_REVERSAL' | 'QUARTERLY' | 'QUARTERLY_REVERSAL' | 'MONTHLY' - | 'MONTHLY_REVERSAL'; + | 'MONTHLY_REVERSAL' + | 'ACCOUNT_TO_ACCOUNT' + | 'STABLECOIN_RECEIVED' + | 'STABLECOIN_REVIEWED' + | 'STABLECOIN_SETTLED'; /** * Globally unique identifier for a financial account @@ -204,9 +219,19 @@ export namespace StatementLineItems { /** * Globally unique identifier for a card */ - card_token?: string; + card_token?: string | null; descriptor?: string; + + /** + * Subtype of the event that generated the line items + */ + event_subtype?: string | null; + + /** + * Date of the loan tape that generated this line item + */ + loan_tape_date?: string | null; } } diff --git a/src/resources/financial-accounts/statements/statements.ts b/src/resources/financial-accounts/statements/statements.ts index 7ed7769d..827bdc8e 100644 --- a/src/resources/financial-accounts/statements/statements.ts +++ b/src/resources/financial-accounts/statements/statements.ts @@ -102,7 +102,7 @@ export interface Statement { /** * Globally unique identifier for a credit product */ - credit_product_token: string; + credit_product_token: string | null; /** * Number of days in the billing cycle @@ -161,17 +161,19 @@ export interface Statement { /** * Date when the next payment is due */ - next_payment_due_date?: string; + next_payment_due_date?: string | null; /** * Date when the next billing period will end */ - next_statement_end_date?: string; + next_statement_end_date?: string | null; /** * Details on number and size of payments to pay off balance */ payoff_details?: Statement.PayoffDetails | null; + + statement_totals?: FinancialAccountsAPI.StatementTotals; } export namespace Statement { diff --git a/src/resources/fraud/transactions.ts b/src/resources/fraud/transactions.ts index 978107c8..040ecbdb 100644 --- a/src/resources/fraud/transactions.ts +++ b/src/resources/fraud/transactions.ts @@ -71,12 +71,12 @@ export interface TransactionRetrieveResponse { /** * Provides additional context or details about the fraud report. */ - comment?: string; + comment?: string | null; /** * Timestamp representing when the fraud report was created. */ - created_at?: string; + created_at?: string | null; /** * Specifies the type or category of fraud that the transaction is suspected or @@ -106,12 +106,13 @@ export interface TransactionRetrieveResponse { | 'ACCOUNT_TAKEOVER' | 'CARD_COMPROMISED' | 'IDENTITY_THEFT' - | 'CARDHOLDER_MANIPULATION'; + | 'CARDHOLDER_MANIPULATION' + | null; /** * Timestamp representing the last update to the fraud report. */ - updated_at?: string; + updated_at?: string | null; } export interface TransactionReportResponse { @@ -142,12 +143,12 @@ export interface TransactionReportResponse { /** * Provides additional context or details about the fraud report. */ - comment?: string; + comment?: string | null; /** * Timestamp representing when the fraud report was created. */ - created_at?: string; + created_at?: string | null; /** * Specifies the type or category of fraud that the transaction is suspected or @@ -177,12 +178,13 @@ export interface TransactionReportResponse { | 'ACCOUNT_TAKEOVER' | 'CARD_COMPROMISED' | 'IDENTITY_THEFT' - | 'CARDHOLDER_MANIPULATION'; + | 'CARDHOLDER_MANIPULATION' + | null; /** * Timestamp representing the last update to the fraud report. */ - updated_at?: string; + updated_at?: string | null; } export interface TransactionReportParams { diff --git a/src/resources/holds.ts b/src/resources/holds.ts new file mode 100644 index 00000000..a251f0d9 --- /dev/null +++ b/src/resources/holds.ts @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import { APIPromise } from '../core/api-promise'; +import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination'; +import { RequestOptions } from '../internal/request-options'; +import { path } from '../internal/utils/path'; + +export class Holds extends APIResource { + /** + * Create a hold on a financial account. Holds reserve funds by moving them from + * available to pending balance. They can be resolved via settlement (linked to a + * payment or book transfer), voiding, or expiration. + */ + create(financialAccountToken: string, body: HoldCreateParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/v1/financial_accounts/${financialAccountToken}/holds`, { + body, + ...options, + }); + } + + /** + * Get hold by token. + */ + retrieve(holdToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v1/holds/${holdToken}`, options); + } + + /** + * List holds for a financial account. + */ + list( + financialAccountToken: string, + query: HoldListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + path`/v1/financial_accounts/${financialAccountToken}/holds`, + CursorPage, + { query, ...options }, + ); + } + + /** + * Void an active hold. This returns the held funds from pending back to available + * balance. Only holds in PENDING status can be voided. + */ + void(holdToken: string, body: HoldVoidParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/v1/holds/${holdToken}/void`, { body, ...options }); + } +} + +export type HoldsCursorPage = CursorPage; + +/** + * A hold transaction representing reserved funds on a financial account. Holds + * move funds from available to pending balance in anticipation of future payments. + * They can be resolved via settlement (linked to payment), manual release, or + * expiration. + */ +export interface Hold { + /** + * Unique identifier for the transaction + */ + token: string; + + /** + * ISO 8601 timestamp of when the transaction was created + */ + created: string; + + /** + * Status of a hold transaction + */ + status: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED' | 'DECLINED' | 'REVERSED' | 'CANCELED' | 'RETURNED'; + + /** + * ISO 8601 timestamp of when the transaction was last updated + */ + updated: string; + + currency?: string; + + events?: Array; + + /** + * When the hold will auto-expire if not resolved + */ + expiration_datetime?: string | null; + + /** + * HOLD - Hold Transaction + */ + family?: 'HOLD'; + + financial_account_token?: string; + + /** + * Current pending amount (0 when resolved) + */ + pending_amount?: number; + + result?: 'APPROVED' | 'DECLINED'; + + user_defined_id?: string | null; +} + +/** + * Event representing a lifecycle change to a hold + */ +export interface HoldEvent { + token: string; + + /** + * Amount in cents + */ + amount: number; + + created: string; + + detailed_results: Array<'APPROVED' | 'INSUFFICIENT_FUNDS'>; + + memo: string | null; + + result: 'APPROVED' | 'DECLINED'; + + /** + * Transaction token of the payment that settled this hold (only populated for + * HOLD_SETTLED events) + */ + settling_transaction_token: string | null; + + /** + * Type of hold lifecycle event + */ + type: 'HOLD_INITIATED' | 'HOLD_VOIDED' | 'HOLD_EXPIRED' | 'HOLD_SETTLED'; +} + +export interface HoldCreateParams { + /** + * Amount to hold in cents + */ + amount: number; + + /** + * Customer-provided token for idempotency. Becomes the hold token. + */ + token?: string; + + /** + * When the hold should auto-expire + */ + expiration_datetime?: string; + + /** + * Reason for the hold + */ + memo?: string | null; + + /** + * User-provided identifier for the hold + */ + user_defined_id?: string; +} + +export interface HoldListParams extends CursorPageParams { + /** + * Date string in RFC 3339 format. Only entries created after the specified time + * will be included. UTC time zone. + */ + begin?: string; + + /** + * Date string in RFC 3339 format. Only entries created before the specified time + * will be included. UTC time zone. + */ + end?: string; + + /** + * Hold status to filter by. + */ + status?: 'PENDING' | 'SETTLED' | 'EXPIRED' | 'VOIDED'; +} + +export interface HoldVoidParams { + /** + * Reason for voiding the hold + */ + memo?: string | null; +} + +export declare namespace Holds { + export { + type Hold as Hold, + type HoldEvent as HoldEvent, + type HoldsCursorPage as HoldsCursorPage, + type HoldCreateParams as HoldCreateParams, + type HoldListParams as HoldListParams, + type HoldVoidParams as HoldVoidParams, + }; +} diff --git a/src/resources/index.ts b/src/resources/index.ts index 190f5182..b4b412fe 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -39,7 +39,7 @@ export { type AccountListParams, type AccountsCursorPage, } from './accounts'; -export { AuthRules } from './auth-rules/auth-rules'; +export { AuthRules, type SignalsResponse } from './auth-rules/auth-rules'; export { AuthStreamEnrollment, type AuthStreamSecret } from './auth-stream-enrollment'; export { Balances, type Balance, type BalanceListParams, type BalancesSinglePage } from './balances'; export { @@ -51,6 +51,11 @@ export { type BookTransferReverseParams, type BookTransferResponsesCursorPage, } from './book-transfers'; +export { + CardAuthorizations, + type CardAuthorization, + type CardAuthorizationChallengeResponseParams, +} from './card-authorizations'; export { CardBulkOrders, type CardBulkOrder, @@ -141,6 +146,7 @@ export { type ExternalBankAccountListParams, type ExternalBankAccountRetryMicroDepositsParams, type ExternalBankAccountRetryPrenoteParams, + type ExternalBankAccountSetVerificationMethodParams, type ExternalBankAccountListResponsesCursorPage, } from './external-bank-accounts/external-bank-accounts'; export { @@ -178,6 +184,15 @@ export { type FundingEventListParams, type FundingEventsCursorPage, } from './funding-events'; +export { + Holds, + type Hold, + type HoldEvent, + type HoldCreateParams, + type HoldListParams, + type HoldVoidParams, + type HoldsCursorPage, +} from './holds'; export { InternalTransactionResource, type InternalTransaction } from './internal-transaction'; export { ManagementOperations, @@ -251,6 +266,7 @@ export { type TokenizationUpdateDigitalCardArtParams, type TokenizationsCursorPage, } from './tokenizations'; +export { TransactionMonitoring } from './transaction-monitoring/transaction-monitoring'; export { Transactions, type CardholderAuthentication, @@ -265,6 +281,7 @@ export { type TransactionSimulateReturnReversalResponse, type TransactionSimulateVoidResponse, type TransactionListParams, + type TransactionRouteParams, type TransactionSimulateAuthorizationParams, type TransactionSimulateAuthorizationAdviceParams, type TransactionSimulateClearingParams, @@ -289,7 +306,8 @@ export { type AccountHolderVerificationWebhookEvent, type AccountHolderDocumentUpdatedWebhookEvent, type CardAuthorizationApprovalRequestWebhookEvent, - type TokenizationDecisioningRequestWebhookEvent, + type CardAuthorizationChallengeWebhookEvent, + type CardAuthorizationChallengeResponseWebhookEvent, type AuthRulesBacktestReportCreatedWebhookEvent, type BalanceUpdatedWebhookEvent, type BookTransferTransactionCreatedWebhookEvent, @@ -303,6 +321,11 @@ export { type CardTransactionUpdatedWebhookEvent, type CardTransactionEnhancedDataCreatedWebhookEvent, type CardTransactionEnhancedDataUpdatedWebhookEvent, + type ClaimCreatedWebhookEvent, + type ClaimUpdatedWebhookEvent, + type ClaimDocumentUploadedWebhookEvent, + type ClaimDocumentAcceptedWebhookEvent, + type ClaimDocumentRejectedWebhookEvent, type DigitalWalletTokenizationApprovalRequestWebhookEvent, type DigitalWalletTokenizationResultWebhookEvent, type DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, @@ -310,6 +333,8 @@ export { type DigitalWalletTokenizationUpdatedWebhookEvent, type DisputeUpdatedWebhookEvent, type DisputeEvidenceUploadFailedWebhookEvent, + type EmbedSessionGeneratedWebhookEvent, + type EmbedViewedWebhookEvent, type ExternalBankAccountCreatedWebhookEvent, type ExternalBankAccountUpdatedWebhookEvent, type ExternalPaymentCreatedWebhookEvent, diff --git a/src/resources/payments.ts b/src/resources/payments.ts index 36f60559..873ea6c8 100644 --- a/src/resources/payments.ts +++ b/src/resources/payments.ts @@ -199,6 +199,8 @@ export interface Payment { */ category: | 'ACH' + | 'WIRE' + | 'STABLECOIN' | 'BALANCE_OR_FUNDING' | 'FEE' | 'REWARD' @@ -217,7 +219,9 @@ export interface Payment { | 'MANAGEMENT_FEE' | 'MANAGEMENT_REWARD' | 'MANAGEMENT_DISBURSEMENT' - | 'PROGRAM_FUNDING'; + | 'HOLD' + | 'PROGRAM_FUNDING' + | 'PROGRAM_TRANSFER'; /** * ISO 8601 timestamp of when the transaction was created @@ -309,6 +313,12 @@ export interface Payment { */ external_bank_account_token?: string | null; + /** + * Key-value pairs for tagging resources. Tags allow you to associate arbitrary + * metadata with a resource for your own purposes. + */ + tags?: { [key: string]: string }; + type?: | 'ORIGINATION_CREDIT' | 'ORIGINATION_DEBIT' @@ -328,6 +338,10 @@ export interface Payment { export namespace Payment { /** + * Note: Inbound wire transfers are coming soon (availability varies by partner + * bank). Wire-related fields below are a preview. To learn more, contact your + * customer success manager. + * * Payment Event */ export interface Event { @@ -354,8 +368,14 @@ export namespace Payment { result: 'APPROVED' | 'DECLINED'; /** + * Note: Inbound wire transfers are coming soon (availability varies by partner + * bank). Wire-related event types below are a preview. To learn more, contact your + * customer success manager. + * * Event types: * + * ACH events: + * * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending * approval/release from an ACH hold. * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. @@ -371,6 +391,8 @@ export namespace Payment { * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available * balance. + * - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + * available balance. * - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. * - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository * Financial Institution. @@ -378,6 +400,33 @@ export namespace Payment { * Financial Institution. * - `ACH_RETURN_REJECTED` - ACH return was rejected by the Receiving Depository * Financial Institution. + * + * Wire transfer events: + * + * - `WIRE_TRANSFER_INBOUND_RECEIVED` - Inbound wire transfer received from the + * Federal Reserve and pending release to available balance. + * - `WIRE_TRANSFER_INBOUND_SETTLED` - Inbound wire transfer funds released from + * pending to available balance. + * - `WIRE_TRANSFER_INBOUND_BLOCKED` - Inbound wire transfer blocked and funds + * frozen for regulatory review. + * + * Wire return events: + * + * - `WIRE_RETURN_OUTBOUND_INITIATED` - Outbound wire return initiated to return + * funds from an inbound wire transfer. + * - `WIRE_RETURN_OUTBOUND_SENT` - Outbound wire return sent to the Federal Reserve + * and pending acceptance. + * - `WIRE_RETURN_OUTBOUND_SETTLED` - Outbound wire return accepted by the Federal + * Reserve and funds returned to sender. + * - `WIRE_RETURN_OUTBOUND_REJECTED` - Outbound wire return rejected by the Federal + * Reserve. + * + * Stablecoin events: + * + * - `STABLECOIN_RECEIVED` - Stablecoin pay-in received on-chain and pending + * release to available balance. + * - `STABLECOIN_REVIEWED` - Stablecoin pay-in has completed the review process. + * - `STABLECOIN_SETTLED` - Stablecoin pay-in funds released to available balance. */ type: | 'ACH_ORIGINATION_CANCELLED' @@ -389,11 +438,22 @@ export namespace Payment { | 'ACH_ORIGINATION_SETTLED' | 'ACH_RECEIPT_PROCESSED' | 'ACH_RECEIPT_RELEASED' + | 'ACH_RECEIPT_RELEASED_EARLY' | 'ACH_RECEIPT_SETTLED' | 'ACH_RETURN_INITIATED' | 'ACH_RETURN_PROCESSED' | 'ACH_RETURN_REJECTED' - | 'ACH_RETURN_SETTLED'; + | 'ACH_RETURN_SETTLED' + | 'WIRE_TRANSFER_INBOUND_RECEIVED' + | 'WIRE_TRANSFER_INBOUND_SETTLED' + | 'WIRE_TRANSFER_INBOUND_BLOCKED' + | 'WIRE_RETURN_OUTBOUND_INITIATED' + | 'WIRE_RETURN_OUTBOUND_SENT' + | 'WIRE_RETURN_OUTBOUND_SETTLED' + | 'WIRE_RETURN_OUTBOUND_REJECTED' + | 'STABLECOIN_RECEIVED' + | 'STABLECOIN_REVIEWED' + | 'STABLECOIN_SETTLED'; /** * More detailed reasons for the event @@ -409,7 +469,9 @@ export namespace Payment { >; /** - * Payment event external ID, for example, ACH trace number. + * Payment event external ID. For ACH transactions, this is the ACH trace number. + * For inbound wire transfers, this is the IMAD (Input Message Accountability + * Data). */ external_id?: string | null; } @@ -435,11 +497,22 @@ export namespace Payment { */ company_id?: string | null; + /** + * Value to override the configured company name with. Can only be used if allowed + * to override + */ + override_company_name?: string | null; + /** * Receipt routing number */ receipt_routing_number?: string | null; + /** + * Name of the recipient on ACH receipts. Reflects the originating bank's record + */ + recipient_name?: string | null; + /** * Number of retries attempted */ @@ -626,6 +699,12 @@ export namespace PaymentCreateParams { ach_hold_period?: number; addenda?: string | null; + + /** + * Value to override the configured company name with. Can only be used if allowed + * to override + */ + override_company_name?: string | null; } /** @@ -662,7 +741,7 @@ export interface PaymentListParams extends CursorPageParams { result?: 'APPROVED' | 'DECLINED'; - status?: 'DECLINED' | 'PENDING' | 'RETURNED' | 'SETTLED'; + status?: 'DECLINED' | 'PENDING' | 'RETURNED' | 'REVERSED' | 'SETTLED'; } export interface PaymentReturnParams { @@ -708,6 +787,7 @@ export interface PaymentSimulateActionParams { | 'ACH_ORIGINATION_SETTLED' | 'ACH_RECEIPT_SETTLED' | 'ACH_RECEIPT_RELEASED' + | 'ACH_RECEIPT_RELEASED_EARLY' | 'ACH_RETURN_INITIATED' | 'ACH_RETURN_PROCESSED' | 'ACH_RETURN_SETTLED'; diff --git a/src/resources/reports/reports.ts b/src/resources/reports/reports.ts index fb2a51d5..18dc2e6e 100644 --- a/src/resources/reports/reports.ts +++ b/src/resources/reports/reports.ts @@ -113,19 +113,19 @@ export interface SettlementDetail { * Globally unique identifier denoting the account that the associated transaction * occurred on. */ - account_token: string; + account_token: string | null; /** * Globally unique identifier denoting the card program that the associated * transaction occurred on. */ - card_program_token: string; + card_program_token: string | null; /** * Globally unique identifier denoting the card that the associated transaction * occurred on. */ - card_token: string; + card_token: string | null; /** * Date and time when the transaction first occurred. UTC time zone. @@ -143,7 +143,8 @@ export interface SettlementDetail { disputes_gross_amount: number; /** - * Globally unique identifiers denoting the Events associated with this settlement. + * Array of globally unique identifiers for the financial events that comprise this + * settlement. Use these tokens to access detailed event-level information. */ event_tokens: Array; @@ -166,7 +167,7 @@ export interface SettlementDetail { /** * Card network where the transaction took place. */ - network: 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; + network: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; /** * The total gross amount of other fees by type. @@ -191,9 +192,14 @@ export interface SettlementDetail { settlement_date: string; /** - * Globally unique identifier denoting the associated Transaction object. + * Globally unique identifier denoting the associated transaction. For settlement + * records with type `CLEARING`, `FINANCIAL`, or `NON_FINANCIAL`, this references a + * card transaction token. For settlement records with type `CHARGEBACK`, + * `REPRESENTMENT`, `PREARBITRATION`, `ARBITRATION`, or `COLLABORATION`, this + * references the dispute transaction token. May be null for certain settlement + * types. */ - transaction_token: string; + transaction_token: string | null; /** * The total amount of settlement impacting transactions (excluding interchange, @@ -212,7 +218,7 @@ export interface SettlementDetail { | 'COLLABORATION' | 'FEE' | 'FINANCIAL' - | 'NON-FINANCIAL' + | 'NON_FINANCIAL' | 'PREARBITRATION' | 'REPRESENTMENT'; @@ -332,7 +338,7 @@ export interface SettlementSummaryDetails { /** * Card network where the transaction took place */ - network?: 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; + network?: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; /** * Total amount of gross other fees outside of interchange. diff --git a/src/resources/reports/settlement/network-totals.ts b/src/resources/reports/settlement/network-totals.ts index 9b684c9c..6736b388 100644 --- a/src/resources/reports/settlement/network-totals.ts +++ b/src/resources/reports/settlement/network-totals.ts @@ -68,7 +68,7 @@ export interface NetworkTotalListParams extends CursorPageParams { /** * Network to filter on. */ - network?: 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; + network?: 'AMEX' | 'VISA' | 'MASTERCARD' | 'MAESTRO' | 'INTERLINK'; /** * Singular report date to filter on (YYYY-MM-DD). Cannot be populated in diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 63e5d681..54fd0d96 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -44,7 +44,9 @@ export interface Address { export interface Carrier { /** - * QR code url to display on the card carrier + * QR code URL to display on the card carrier. The `qr_code_url` field requires + * your domain to be allowlisted by Lithic before use. Contact Support to configure + * your QR code domain */ qr_code_url?: string; } @@ -282,12 +284,18 @@ export interface FinancialEvent { | 'RETURNED_PAYMENT' | 'RETURNED_PAYMENT_REVERSAL' | 'LITHIC_NETWORK_PAYMENT' + | 'LITHIC_PROGRAM_TRANSFER' + | 'BANK_PROGRAM_TRANSFER' | 'ANNUAL' | 'ANNUAL_REVERSAL' | 'QUARTERLY' | 'QUARTERLY_REVERSAL' | 'MONTHLY' - | 'MONTHLY_REVERSAL'; + | 'MONTHLY_REVERSAL' + | 'ACCOUNT_TO_ACCOUNT' + | 'STABLECOIN_RECEIVED' + | 'STABLECOIN_REVIEWED' + | 'STABLECOIN_SETTLED'; } /** @@ -303,7 +311,9 @@ export type InstanceFinancialAccountType = | 'SECURITY' | 'PROGRAM_RECEIVABLES' | 'COLLECTION' - | 'PROGRAM_BANK_ACCOUNTS_PAYABLE'; + | 'PROGRAM_BANK_ACCOUNTS_PAYABLE' + | 'EARLY_DIRECT_DEPOSIT_FLOAT' + | 'PROVISIONAL_CREDIT_ACCOUNT'; export interface Merchant { /** diff --git a/src/resources/three-ds/decisioning.ts b/src/resources/three-ds/decisioning.ts index 67c68d4e..02d10af1 100644 --- a/src/resources/three-ds/decisioning.ts +++ b/src/resources/three-ds/decisioning.ts @@ -8,7 +8,7 @@ export class Decisioning extends APIResource { /** * Card program's response to a 3DS Challenge Request. Challenge Request is emitted * as a webhook - * [three_ds_authentication.challenge](https://docs.lithic.com/reference/post_three-ds-authentication-challenge) + * [three_ds_authentication.challenge](https://docs.lithic.com/reference/threedsauthenticationchallengewebhook) * and your Card Program needs to be configured with Out of Band (OOB) Challenges * in order to receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for * more information). diff --git a/src/resources/tokenizations.ts b/src/resources/tokenizations.ts index a69f22be..93afe60b 100644 --- a/src/resources/tokenizations.ts +++ b/src/resources/tokenizations.ts @@ -475,7 +475,8 @@ export type TokenizationDeclineReason = | 'INVALID_CUSTOMER_RESPONSE' | 'NETWORK_FAILURE' | 'GENERIC_DECLINE' - | 'DIGITAL_CARD_ART_REQUIRED'; + | 'DIGITAL_CARD_ART_REQUIRED' + | 'INVALID_PAN'; export interface TokenizationRuleResult { /** diff --git a/src/resources/transaction-monitoring.ts b/src/resources/transaction-monitoring.ts new file mode 100644 index 00000000..9f669e0d --- /dev/null +++ b/src/resources/transaction-monitoring.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './transaction-monitoring/index'; diff --git a/src/resources/transaction-monitoring/cases.ts b/src/resources/transaction-monitoring/cases.ts new file mode 100644 index 00000000..51ef6d32 --- /dev/null +++ b/src/resources/transaction-monitoring/cases.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './cases/index'; diff --git a/src/resources/transaction-monitoring/cases/cases.ts b/src/resources/transaction-monitoring/cases/cases.ts new file mode 100644 index 00000000..e2bf3310 --- /dev/null +++ b/src/resources/transaction-monitoring/cases/cases.ts @@ -0,0 +1,588 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import * as CommentsAPI from './comments'; +import { CommentCreateParams, CommentDeleteParams, CommentUpdateParams, Comments } from './comments'; +import * as FilesAPI from './files'; +import { + CaseFile, + CaseFilesCursorPage, + FileCreateParams, + FileDeleteParams, + FileListParams, + FileRetrieveParams, + FileStatus, + Files, + UploadConstraints, +} from './files'; +import { APIPromise } from '../../../core/api-promise'; +import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +export class Cases extends APIResource { + comments: CommentsAPI.Comments = new CommentsAPI.Comments(this._client); + files: FilesAPI.Files = new FilesAPI.Files(this._client); + + /** + * Retrieves a single transaction monitoring case. + */ + retrieve(caseToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v1/transaction_monitoring/cases/${caseToken}`, options); + } + + /** + * Updates a transaction monitoring case. + */ + update(caseToken: string, body: CaseUpdateParams, options?: RequestOptions): APIPromise { + return this._client.patch(path`/v1/transaction_monitoring/cases/${caseToken}`, { body, ...options }); + } + + /** + * Lists transaction monitoring cases, optionally filtered. + */ + list( + query: CaseListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList('/v1/transaction_monitoring/cases', CursorPage, { + query, + ...options, + }); + } + + /** + * Lists the activity feed for a case. + */ + listActivity( + caseToken: string, + query: CaseListActivityParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + path`/v1/transaction_monitoring/cases/${caseToken}/activity`, + CursorPage, + { query, ...options }, + ); + } + + /** + * Lists the transactions associated with a case. + */ + listTransactions( + caseToken: string, + query: CaseListTransactionsParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + path`/v1/transaction_monitoring/cases/${caseToken}/transactions`, + CursorPage, + { query, ...options }, + ); + } + + /** + * Lists the cards involved in a case, with per-card transaction counts. + */ + retrieveCards(caseToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v1/transaction_monitoring/cases/${caseToken}/cards`, options); + } +} + +export type MonitoringCasesCursorPage = CursorPage; + +export type CaseActivityEntriesCursorPage = CursorPage; + +export type CaseTransactionsCursorPage = CursorPage; + +/** + * A single entry in a case's activity feed + */ +export interface CaseActivityEntry { + /** + * Globally unique identifier for the activity entry + */ + token: string; + + /** + * Identifier of the actor that produced the activity entry + */ + actor_token: string | null; + + /** + * Date and time at which the activity entry was created + */ + created: string; + + /** + * The case field that changed, or the action that was taken, in an activity entry: + * + * - `STATUS` - The case status changed + * - `TITLE` - The case title changed + * - `ASSIGNED_TO` - The case assignee changed + * - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + * - `RESOLUTION_NOTES` - The resolution notes were set or changed + * - `TAGS` - The case tags changed + * - `PRIORITY` - The case priority changed + * - `COMMENT` - A comment was added or edited + * - `FILE` - A file was attached to the case + */ + entry_type: CaseActivityType; + + /** + * New value of the changed field, when applicable + */ + new_value: string | null; + + /** + * Previous value of the changed field, when applicable + */ + previous_value: string | null; +} + +/** + * The case field that changed, or the action that was taken, in an activity entry: + * + * - `STATUS` - The case status changed + * - `TITLE` - The case title changed + * - `ASSIGNED_TO` - The case assignee changed + * - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + * - `RESOLUTION_NOTES` - The resolution notes were set or changed + * - `TAGS` - The case tags changed + * - `PRIORITY` - The case priority changed + * - `COMMENT` - A comment was added or edited + * - `FILE` - A file was attached to the case + */ +export type CaseActivityType = + | 'STATUS' + | 'TITLE' + | 'ASSIGNED_TO' + | 'RESOLUTION_OUTCOME' + | 'RESOLUTION_NOTES' + | 'TAGS' + | 'PRIORITY' + | 'COMMENT' + | 'FILE'; + +/** + * Summary of a card's involvement in a case, aggregated across the case's + * transactions + */ +export interface CaseCard { + /** + * Token of the account the card belongs to + */ + account_token: string; + + /** + * Token of the card + */ + card_token: string; + + /** + * Number of the card's transactions associated with the case + */ + transaction_count: number; +} + +/** + * The entity a case is associated with + */ +export interface CaseEntity { + /** + * Globally unique identifier for the associated entity + */ + entity_token: string; + + /** + * The type of entity a case is associated with: + * + * - `CARD` - The case is associated with a card + * - `ACCOUNT` - The case is associated with an account + */ + entity_type: 'CARD' | 'ACCOUNT'; +} + +/** + * Priority level of a case, controlling queue ordering and SLA urgency + */ +export type CasePriority = 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; + +/** + * Sort order for listing cases. Defaults to `CREATED_DESC` (newest first): + * + * - `CREATED_ASC` - Oldest first + * - `CREATED_DESC` - Newest first + * - `PRIORITY_DESC` - Highest priority first + * - `PRIORITY_ASC` - Lowest priority first + * - `STATUS_DESC` - Furthest workflow stage first + * - `STATUS_ASC` - Earliest workflow stage first + */ +export type CaseSortOrder = + | 'CREATED_ASC' + | 'CREATED_DESC' + | 'PRIORITY_DESC' + | 'PRIORITY_ASC' + | 'STATUS_DESC' + | 'STATUS_ASC'; + +/** + * Status of a case as it progresses through the review workflow: + * + * - `OPEN` - The case has been created and is still collecting matching + * transactions + * - `ASSIGNED` - An analyst has been assigned and transaction collection has + * stopped + * - `IN_REVIEW` - The case is actively being investigated + * - `ESCALATED` - The case has been reviewed and requires additional oversight + * - `RESOLVED` - A determination has been made and a resolution recorded + * - `CLOSED` - The case is finalized + */ +export type CaseStatus = 'OPEN' | 'ASSIGNED' | 'IN_REVIEW' | 'ESCALATED' | 'RESOLVED' | 'CLOSED'; + +/** + * A single transaction associated with a case. The `category` field identifies + * whether this is a card transaction or a payment transaction. + */ +export type CaseTransaction = CaseTransaction.CardCaseTransaction | CaseTransaction.PaymentCaseTransaction; + +export namespace CaseTransaction { + /** + * A card transaction associated with a case + */ + export interface CardCaseTransaction { + /** + * Globally unique identifier for the card transaction + */ + token: string; + + /** + * Token of the account the transaction belongs to + */ + account_token: string; + + /** + * Date and time at which the transaction was added to the case + */ + added_at: string; + + /** + * Token of the card the transaction was made on + */ + card_token: string; + + category: 'CARD'; + + /** + * Date and time at which the transaction was created + */ + transaction_created_at: string; + } + + /** + * A payment (ACH) transaction associated with a case + */ + export interface PaymentCaseTransaction { + /** + * Globally unique identifier for the payment transaction + */ + token: string; + + /** + * Date and time at which the transaction was added to the case + */ + added_at: string; + + category: 'PAYMENT'; + + /** + * Token of the financial account the payment belongs to + */ + financial_account_token: string; + + /** + * Date and time at which the transaction was created + */ + transaction_created_at: string; + + /** + * Token of the account the payment belongs to, if applicable + */ + account_token?: string; + } +} + +/** + * The type of entity associated with an account holder + */ +export type EntityType = 'BENEFICIAL_OWNER_INDIVIDUAL' | 'CONTROL_PERSON'; + +/** + * A transaction monitoring case + */ +export interface MonitoringCase { + /** + * Globally unique identifier for the case + */ + token: string; + + /** + * Identifier of the user the case is currently assigned to + */ + assignee: string | null; + + /** + * Date and time at which transaction collection stopped for the case + */ + collection_stopped: string | null; + + /** + * Date and time at which the case was created + */ + created: string; + + /** + * The entity a case is associated with + */ + entity: CaseEntity | null; + + /** + * Whether the case still has transaction scopes pending resolution + */ + pending_transactions: boolean; + + /** + * Priority level of a case, controlling queue ordering and SLA urgency + */ + priority: CasePriority; + + /** + * Token of the queue the case belongs to + */ + queue_token: string; + + /** + * Outcome recorded when the case was resolved, from the `allowed_resolutions` + * configured on the case's queue + */ + resolution: string | null; + + /** + * Free-form notes describing the resolution + */ + resolution_notes: string | null; + + /** + * Date and time at which the case was resolved + */ + resolved: string | null; + + /** + * Token of the transaction monitoring rule that triggered the case + */ + rule_token: string | null; + + /** + * Deadline by which the case is expected to be resolved + */ + sla_deadline: string | null; + + /** + * Status of a case as it progresses through the review workflow: + * + * - `OPEN` - The case has been created and is still collecting matching + * transactions + * - `ASSIGNED` - An analyst has been assigned and transaction collection has + * stopped + * - `IN_REVIEW` - The case is actively being investigated + * - `ESCALATED` - The case has been reviewed and requires additional oversight + * - `RESOLVED` - A determination has been made and a resolution recorded + * - `CLOSED` - The case is finalized + */ + status: CaseStatus; + + /** + * Arbitrary key-value metadata associated with the case + */ + tags: { [key: string]: string }; + + /** + * Short, human-readable summary of the case + */ + title: string | null; + + /** + * Date and time at which the case was last updated + */ + updated: string; +} + +export type CaseRetrieveCardsResponse = Array; + +export interface CaseUpdateParams { + /** + * Optional client-provided identifier for the actor performing this action, + * recorded on the resulting activity entry. This value is supplied by the client + * (for example, your own internal user ID) and is not authenticated by Lithic + */ + actor_token?: string; + + /** + * New assignee for the case, or `null` to unassign + */ + assignee?: string | null; + + /** + * Priority level of a case, controlling queue ordering and SLA urgency + */ + priority?: CasePriority; + + /** + * Resolution to record on the case. Must be one of the `allowed_resolutions` + * configured on the case's queue, otherwise the request is rejected with a `400` + */ + resolution?: string; + + /** + * Notes describing the resolution + */ + resolution_notes?: string; + + /** + * New SLA deadline for the case, or `null` to clear it + */ + sla_deadline?: string | null; + + /** + * Status of a case as it progresses through the review workflow: + * + * - `OPEN` - The case has been created and is still collecting matching + * transactions + * - `ASSIGNED` - An analyst has been assigned and transaction collection has + * stopped + * - `IN_REVIEW` - The case is actively being investigated + * - `ESCALATED` - The case has been reviewed and requires additional oversight + * - `RESOLVED` - A determination has been made and a resolution recorded + * - `CLOSED` - The case is finalized + */ + status?: CaseStatus; + + /** + * Arbitrary key-value metadata to set on the case + */ + tags?: { [key: string]: string }; + + /** + * New title for the case, or `null` to clear it + */ + title?: string | null; +} + +export interface CaseListParams extends CursorPageParams { + /** + * Only return cases that include transactions on the provided account. + */ + account_token?: string; + + /** + * Only return cases assigned to the provided value. Pass an empty string to return + * only unassigned cases. + */ + assignee?: string; + + /** + * Date string in RFC 3339 format. Only entries created after the specified time + * will be included. UTC time zone. + */ + begin?: string; + + /** + * Only return cases that include transactions on the provided card. + */ + card_token?: string; + + /** + * Date string in RFC 3339 format. Only entries created before the specified time + * will be included. UTC time zone. + */ + end?: string; + + /** + * Only return cases associated with the provided entity. + */ + entity_token?: string; + + /** + * Only return cases belonging to the provided queue. + */ + queue_token?: string; + + /** + * Only return cases triggered by the provided transaction monitoring rule. + */ + rule_token?: string; + + /** + * Sort order for the returned cases. + */ + sort_by?: CaseSortOrder; + + /** + * Only return cases with the provided status. + */ + status?: CaseStatus; + + /** + * Only return cases that include the provided transaction. + */ + transaction_token?: string; +} + +export interface CaseListActivityParams extends CursorPageParams {} + +export interface CaseListTransactionsParams extends CursorPageParams {} + +Cases.Comments = Comments; +Cases.Files = Files; + +export declare namespace Cases { + export { + type CaseActivityEntry as CaseActivityEntry, + type CaseActivityType as CaseActivityType, + type CaseCard as CaseCard, + type CaseEntity as CaseEntity, + type CasePriority as CasePriority, + type CaseSortOrder as CaseSortOrder, + type CaseStatus as CaseStatus, + type CaseTransaction as CaseTransaction, + type EntityType as EntityType, + type MonitoringCase as MonitoringCase, + type CaseRetrieveCardsResponse as CaseRetrieveCardsResponse, + type MonitoringCasesCursorPage as MonitoringCasesCursorPage, + type CaseActivityEntriesCursorPage as CaseActivityEntriesCursorPage, + type CaseTransactionsCursorPage as CaseTransactionsCursorPage, + type CaseUpdateParams as CaseUpdateParams, + type CaseListParams as CaseListParams, + type CaseListActivityParams as CaseListActivityParams, + type CaseListTransactionsParams as CaseListTransactionsParams, + }; + + export { + Comments as Comments, + type CommentCreateParams as CommentCreateParams, + type CommentUpdateParams as CommentUpdateParams, + type CommentDeleteParams as CommentDeleteParams, + }; + + export { + Files as Files, + type CaseFile as CaseFile, + type FileStatus as FileStatus, + type UploadConstraints as UploadConstraints, + type CaseFilesCursorPage as CaseFilesCursorPage, + type FileCreateParams as FileCreateParams, + type FileRetrieveParams as FileRetrieveParams, + type FileListParams as FileListParams, + type FileDeleteParams as FileDeleteParams, + }; +} diff --git a/src/resources/transaction-monitoring/cases/comments.ts b/src/resources/transaction-monitoring/cases/comments.ts new file mode 100644 index 00000000..9c85d179 --- /dev/null +++ b/src/resources/transaction-monitoring/cases/comments.ts @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import * as CasesAPI from './cases'; +import { APIPromise } from '../../../core/api-promise'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +export class Comments extends APIResource { + /** + * Adds a comment to a case. + */ + create( + caseToken: string, + body: CommentCreateParams, + options?: RequestOptions, + ): APIPromise { + return this._client.post(path`/v1/transaction_monitoring/cases/${caseToken}/comments`, { + body, + ...options, + }); + } + + /** + * Edits an existing comment on a case. + */ + update( + commentToken: string, + params: CommentUpdateParams, + options?: RequestOptions, + ): APIPromise { + const { case_token, ...body } = params; + return this._client.patch(path`/v1/transaction_monitoring/cases/${case_token}/comments/${commentToken}`, { + body, + ...options, + }); + } + + /** + * Deletes a comment from a case. + */ + delete(commentToken: string, params: CommentDeleteParams, options?: RequestOptions): APIPromise { + const { case_token } = params; + return this._client.delete( + path`/v1/transaction_monitoring/cases/${case_token}/comments/${commentToken}`, + options, + ); + } +} + +export interface CommentCreateParams { + /** + * Text of the comment + */ + comment: string; + + /** + * Optional client-provided identifier for the actor performing this action, + * recorded on the resulting activity entry. This value is supplied by the client + * (for example, your own internal user ID) and is not authenticated by Lithic + */ + actor_token?: string; +} + +export interface CommentUpdateParams { + /** + * Path param: Globally unique identifier for the case. + */ + case_token: string; + + /** + * Body param: New text of the comment + */ + comment: string; + + /** + * Body param: Optional client-provided identifier for the actor performing this + * action, recorded on the resulting activity entry. This value is supplied by the + * client (for example, your own internal user ID) and is not authenticated by + * Lithic + */ + actor_token?: string; +} + +export interface CommentDeleteParams { + /** + * Globally unique identifier for the case. + */ + case_token: string; +} + +export declare namespace Comments { + export { + type CommentCreateParams as CommentCreateParams, + type CommentUpdateParams as CommentUpdateParams, + type CommentDeleteParams as CommentDeleteParams, + }; +} diff --git a/src/resources/transaction-monitoring/cases/files.ts b/src/resources/transaction-monitoring/cases/files.ts new file mode 100644 index 00000000..38065abd --- /dev/null +++ b/src/resources/transaction-monitoring/cases/files.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import { APIPromise } from '../../../core/api-promise'; +import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +export class Files extends APIResource { + /** + * Creates a file record and returns a presigned URL for uploading the file to the + * case. + */ + create(caseToken: string, body: FileCreateParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/v1/transaction_monitoring/cases/${caseToken}/files`, { body, ...options }); + } + + /** + * Retrieves a single file attached to a case, including a presigned download URL + * when the file is ready. + */ + retrieve(fileToken: string, params: FileRetrieveParams, options?: RequestOptions): APIPromise { + const { case_token } = params; + return this._client.get(path`/v1/transaction_monitoring/cases/${case_token}/files/${fileToken}`, options); + } + + /** + * Lists the files attached to a case. + */ + list( + caseToken: string, + query: FileListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList( + path`/v1/transaction_monitoring/cases/${caseToken}/files`, + CursorPage, + { query, ...options }, + ); + } + + /** + * Deletes a file from a case. + */ + delete(fileToken: string, params: FileDeleteParams, options?: RequestOptions): APIPromise { + const { case_token } = params; + return this._client.delete( + path`/v1/transaction_monitoring/cases/${case_token}/files/${fileToken}`, + options, + ); + } +} + +export type CaseFilesCursorPage = CursorPage; + +/** + * A file attached to a case. Status-dependent fields are always present but may be + * `null`: + * + * - `upload_url`, `upload_url_expires`, and `upload_constraints` are populated + * when `status` is `PENDING` or `REJECTED` + * - `download_url` and `download_url_expires` are populated when `status` is + * `READY` + * - `failure_reason` is populated when `status` is `REJECTED` + */ +export interface CaseFile { + /** + * Globally unique identifier for the file + */ + token: string; + + /** + * Date and time at which the file record was created + */ + created: string; + + /** + * Presigned URL the client uses to download the file + */ + download_url: string | null; + + /** + * Date and time at which the download URL expires + */ + download_url_expires: string | null; + + /** + * Reason the file was rejected, when applicable + */ + failure_reason: string | null; + + /** + * MIME type of the file, available once the file is ready + */ + mime_type: string | null; + + /** + * Name of the file + */ + name: string; + + /** + * Size of the file in bytes, available once the file is ready + */ + size_bytes: number | null; + + /** + * Lifecycle status of a case file: + * + * - `PENDING` - An upload URL has been issued and the file is awaiting upload + * - `READY` - The file has been uploaded and validated; a download URL is + * available + * - `REJECTED` - File validation failed; see `failure_reason` for details + */ + status: FileStatus; + + /** + * Date and time at which the file record was last updated + */ + updated: string; + + /** + * Constraints applied to a file upload, returned alongside the upload URL so + * clients can validate before uploading + */ + upload_constraints: UploadConstraints | null; + + /** + * Presigned URL the client uses to upload the file + */ + upload_url: string | null; + + /** + * Date and time at which the upload URL expires + */ + upload_url_expires: string | null; +} + +/** + * Lifecycle status of a case file: + * + * - `PENDING` - An upload URL has been issued and the file is awaiting upload + * - `READY` - The file has been uploaded and validated; a download URL is + * available + * - `REJECTED` - File validation failed; see `failure_reason` for details + */ +export type FileStatus = 'PENDING' | 'READY' | 'REJECTED'; + +/** + * Constraints applied to a file upload, returned alongside the upload URL so + * clients can validate before uploading + */ +export interface UploadConstraints { + /** + * MIME types accepted for the upload + */ + accepted_mime_types: Array; + + /** + * Maximum accepted file size, in bytes + */ + max_size_bytes: number; +} + +export interface FileCreateParams { + /** + * Name of the file to upload + */ + name: string; +} + +export interface FileRetrieveParams { + /** + * Globally unique identifier for the case. + */ + case_token: string; +} + +export interface FileListParams extends CursorPageParams {} + +export interface FileDeleteParams { + /** + * Globally unique identifier for the case. + */ + case_token: string; +} + +export declare namespace Files { + export { + type CaseFile as CaseFile, + type FileStatus as FileStatus, + type UploadConstraints as UploadConstraints, + type CaseFilesCursorPage as CaseFilesCursorPage, + type FileCreateParams as FileCreateParams, + type FileRetrieveParams as FileRetrieveParams, + type FileListParams as FileListParams, + type FileDeleteParams as FileDeleteParams, + }; +} diff --git a/src/resources/transaction-monitoring/cases/index.ts b/src/resources/transaction-monitoring/cases/index.ts new file mode 100644 index 00000000..25eae735 --- /dev/null +++ b/src/resources/transaction-monitoring/cases/index.ts @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Cases, + type CaseActivityEntry, + type CaseActivityType, + type CaseCard, + type CaseEntity, + type CasePriority, + type CaseSortOrder, + type CaseStatus, + type CaseTransaction, + type EntityType, + type MonitoringCase, + type CaseRetrieveCardsResponse, + type CaseUpdateParams, + type CaseListParams, + type CaseListActivityParams, + type CaseListTransactionsParams, + type MonitoringCasesCursorPage, + type CaseActivityEntriesCursorPage, + type CaseTransactionsCursorPage, +} from './cases'; +export { + Comments, + type CommentCreateParams, + type CommentUpdateParams, + type CommentDeleteParams, +} from './comments'; +export { + Files, + type CaseFile, + type FileStatus, + type UploadConstraints, + type FileCreateParams, + type FileRetrieveParams, + type FileListParams, + type FileDeleteParams, + type CaseFilesCursorPage, +} from './files'; diff --git a/src/resources/transaction-monitoring/index.ts b/src/resources/transaction-monitoring/index.ts new file mode 100644 index 00000000..ec2b4412 --- /dev/null +++ b/src/resources/transaction-monitoring/index.ts @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Cases, + type CaseActivityEntry, + type CaseActivityType, + type CaseCard, + type CaseEntity, + type CasePriority, + type CaseSortOrder, + type CaseStatus, + type CaseTransaction, + type EntityType, + type MonitoringCase, + type CaseRetrieveCardsResponse, + type CaseUpdateParams, + type CaseListParams, + type CaseListActivityParams, + type CaseListTransactionsParams, + type MonitoringCasesCursorPage, + type CaseActivityEntriesCursorPage, + type CaseTransactionsCursorPage, +} from './cases/index'; +export { + Queues, + type Queue, + type QueueCreateParams, + type QueueUpdateParams, + type QueueListParams, + type QueuesCursorPage, +} from './queues'; +export { TransactionMonitoring } from './transaction-monitoring'; diff --git a/src/resources/transaction-monitoring/queues.ts b/src/resources/transaction-monitoring/queues.ts new file mode 100644 index 00000000..b276b761 --- /dev/null +++ b/src/resources/transaction-monitoring/queues.ts @@ -0,0 +1,183 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +export class Queues extends APIResource { + /** + * Creates a new queue for grouping transaction monitoring cases. + */ + create(body: QueueCreateParams, options?: RequestOptions): APIPromise { + return this._client.post('/v1/transaction_monitoring/queues', { body, ...options }); + } + + /** + * Retrieves a single transaction monitoring queue. + */ + retrieve(queueToken: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/v1/transaction_monitoring/queues/${queueToken}`, options); + } + + /** + * Updates a transaction monitoring queue. + */ + update(queueToken: string, body: QueueUpdateParams, options?: RequestOptions): APIPromise { + return this._client.patch(path`/v1/transaction_monitoring/queues/${queueToken}`, { body, ...options }); + } + + /** + * Lists transaction monitoring queues. + */ + list( + query: QueueListParams | null | undefined = {}, + options?: RequestOptions, + ): PagePromise { + return this._client.getAPIList('/v1/transaction_monitoring/queues', CursorPage, { + query, + ...options, + }); + } + + /** + * Deletes a transaction monitoring queue. + */ + delete(queueToken: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/v1/transaction_monitoring/queues/${queueToken}`, options); + } +} + +export type QueuesCursorPage = CursorPage; + +/** + * A queue that groups transaction monitoring cases for review + */ +export interface Queue { + /** + * Globally unique identifier for the queue + */ + token: string; + + /** + * Resolutions that can be recorded on cases in this queue. Always the effective + * list: the queue's own values when it defines them, otherwise the default list + */ + allowed_resolutions: Array; + + /** + * Number of cases in the queue, broken down by status. A status is omitted when + * the queue has no cases in that status + */ + case_counts: Queue.CaseCounts; + + /** + * Date and time at which the queue was created + */ + created: string; + + /** + * Optional description of the queue + */ + description: string | null; + + /** + * Human-readable name of the queue + */ + name: string; + + /** + * Date and time at which the queue was last updated + */ + updated: string; +} + +export namespace Queue { + /** + * Number of cases in the queue, broken down by status. A status is omitted when + * the queue has no cases in that status + */ + export interface CaseCounts { + /** + * Number of cases in the queue with status `ASSIGNED` + */ + ASSIGNED?: number; + + /** + * Number of cases in the queue with status `CLOSED` + */ + CLOSED?: number; + + /** + * Number of cases in the queue with status `ESCALATED` + */ + ESCALATED?: number; + + /** + * Number of cases in the queue with status `IN_REVIEW` + */ + IN_REVIEW?: number; + + /** + * Number of cases in the queue with status `OPEN` + */ + OPEN?: number; + + /** + * Number of cases in the queue with status `RESOLVED` + */ + RESOLVED?: number; + } +} + +export interface QueueCreateParams { + /** + * Human-readable name of the queue + */ + name: string; + + /** + * Resolutions that can be recorded on cases in this queue. Omit or send `null` to + * use the default list. Values are free-form labels and must be non-empty and + * unique + */ + allowed_resolutions?: Array | null; + + /** + * Optional description of the queue + */ + description?: string | null; +} + +export interface QueueUpdateParams { + /** + * New list of resolutions that can be recorded on cases in this queue, or `null` + * to revert to the default list. Values are free-form labels and must be non-empty + * and unique. Changing the list only affects what is selectable going forward; the + * `resolution` already stored on a case is preserved as-is + */ + allowed_resolutions?: Array | null; + + /** + * New description for the queue, or `null` to clear it + */ + description?: string | null; + + /** + * New name for the queue + */ + name?: string; +} + +export interface QueueListParams extends CursorPageParams {} + +export declare namespace Queues { + export { + type Queue as Queue, + type QueuesCursorPage as QueuesCursorPage, + type QueueCreateParams as QueueCreateParams, + type QueueUpdateParams as QueueUpdateParams, + type QueueListParams as QueueListParams, + }; +} diff --git a/src/resources/transaction-monitoring/transaction-monitoring.ts b/src/resources/transaction-monitoring/transaction-monitoring.ts new file mode 100644 index 00000000..73870fd5 --- /dev/null +++ b/src/resources/transaction-monitoring/transaction-monitoring.ts @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as QueuesAPI from './queues'; +import { + Queue, + QueueCreateParams, + QueueListParams, + QueueUpdateParams, + Queues, + QueuesCursorPage, +} from './queues'; +import * as CasesAPI from './cases/cases'; +import { + CaseActivityEntriesCursorPage, + CaseActivityEntry, + CaseActivityType, + CaseCard, + CaseEntity, + CaseListActivityParams, + CaseListParams, + CaseListTransactionsParams, + CasePriority, + CaseRetrieveCardsResponse, + CaseSortOrder, + CaseStatus, + CaseTransaction, + CaseTransactionsCursorPage, + CaseUpdateParams, + Cases, + EntityType, + MonitoringCase, + MonitoringCasesCursorPage, +} from './cases/cases'; + +export class TransactionMonitoring extends APIResource { + cases: CasesAPI.Cases = new CasesAPI.Cases(this._client); + queues: QueuesAPI.Queues = new QueuesAPI.Queues(this._client); +} + +TransactionMonitoring.Cases = Cases; +TransactionMonitoring.Queues = Queues; + +export declare namespace TransactionMonitoring { + export { + Cases as Cases, + type CaseActivityEntry as CaseActivityEntry, + type CaseActivityType as CaseActivityType, + type CaseCard as CaseCard, + type CaseEntity as CaseEntity, + type CasePriority as CasePriority, + type CaseSortOrder as CaseSortOrder, + type CaseStatus as CaseStatus, + type CaseTransaction as CaseTransaction, + type EntityType as EntityType, + type MonitoringCase as MonitoringCase, + type CaseRetrieveCardsResponse as CaseRetrieveCardsResponse, + type MonitoringCasesCursorPage as MonitoringCasesCursorPage, + type CaseActivityEntriesCursorPage as CaseActivityEntriesCursorPage, + type CaseTransactionsCursorPage as CaseTransactionsCursorPage, + type CaseUpdateParams as CaseUpdateParams, + type CaseListParams as CaseListParams, + type CaseListActivityParams as CaseListActivityParams, + type CaseListTransactionsParams as CaseListTransactionsParams, + }; + + export { + Queues as Queues, + type Queue as Queue, + type QueuesCursorPage as QueuesCursorPage, + type QueueCreateParams as QueueCreateParams, + type QueueUpdateParams as QueueUpdateParams, + type QueueListParams as QueueListParams, + }; +} diff --git a/src/resources/transactions/index.ts b/src/resources/transactions/index.ts index f8c618a3..c62a205f 100644 --- a/src/resources/transactions/index.ts +++ b/src/resources/transactions/index.ts @@ -19,6 +19,7 @@ export { type TransactionSimulateReturnReversalResponse, type TransactionSimulateVoidResponse, type TransactionListParams, + type TransactionRouteParams, type TransactionSimulateAuthorizationParams, type TransactionSimulateAuthorizationAdviceParams, type TransactionSimulateClearingParams, diff --git a/src/resources/transactions/transactions.ts b/src/resources/transactions/transactions.ts index c5746ae2..5e559aec 100644 --- a/src/resources/transactions/transactions.ts +++ b/src/resources/transactions/transactions.ts @@ -64,6 +64,25 @@ export class Transactions extends APIResource { return this._client.post(path`/v1/transactions/${transactionToken}/expire_authorization`, options); } + /** + * Route a card transaction to a financial account. Only available for select use + * cases and programs. + * + * @example + * ```ts + * await client.transactions.route( + * '00000000-0000-0000-0000-000000000000', + * { + * financial_account_token: + * '00000000-0000-0000-0000-000000000000', + * }, + * ); + * ``` + */ + route(transactionToken: string, body: TransactionRouteParams, options?: RequestOptions): APIPromise { + return this._client.post(path`/v1/transactions/${transactionToken}/route`, { body, ...options }); + } + /** * Simulates an authorization request from the card network as if it came from a * merchant acquirer. If you are configured for ASA, simulating authorizations @@ -119,9 +138,10 @@ export class Transactions extends APIResource { * Clears an existing authorization, either debit or credit. After this event, the * transaction transitions from `PENDING` to `SETTLED` status. * - * If `amount` is not set, the full amount of the transaction will be cleared. - * Transactions that have already cleared, either partially or fully, cannot be - * cleared again using this endpoint. + * If `amount` is not set, the full amount of the transaction will be cleared. This + * endpoint may be called multiple times against the same authorization to simulate + * a multiple-completion scenario, with each call creating a separate clearing + * event. * * @example * ```ts @@ -362,7 +382,10 @@ export interface Transaction { financial_account_token: string | null; - merchant: Shared.Merchant; + /** + * Merchant information including full location details. + */ + merchant: Transaction.Merchant; /** * @deprecated Analogous to the 'amount', but in the merchant currency. @@ -425,6 +448,13 @@ export interface Transaction { | 'UNKNOWN_HOST_TIMEOUT' | 'USER_TRANSACTION_LIMIT'; + /** + * Where the cardholder received the service, when different from the card acceptor + * location. This is populated from network data elements such as Mastercard DE-122 + * SE1 SF9-14 and Visa F34 DS02. + */ + service_location: Transaction.ServiceLocation | null; + /** * @deprecated The settled amount of the transaction in the settlement currency. */ @@ -531,6 +561,26 @@ export namespace Transaction { zipcode: string; } + /** + * Merchant information including full location details. + */ + export interface Merchant extends Shared.Merchant { + /** + * Phone number of card acceptor. + */ + phone_number: string | null; + + /** + * Postal code of card acceptor. + */ + postal_code: string | null; + + /** + * Street address of card acceptor. + */ + street_address: string | null; + } + export interface Pos { entry_mode: Pos.EntryMode; @@ -657,6 +707,38 @@ export namespace Transaction { } } + /** + * Where the cardholder received the service, when different from the card acceptor + * location. This is populated from network data elements such as Mastercard DE-122 + * SE1 SF9-14 and Visa F34 DS02. + */ + export interface ServiceLocation { + /** + * City of service location. + */ + city: string | null; + + /** + * Country code of service location, ISO 3166-1 alpha-3. + */ + country: string | null; + + /** + * Postal code of service location. + */ + postal_code: string | null; + + /** + * State/province code of service location, ISO 3166-2. + */ + state: string | null; + + /** + * Street address of service location. + */ + street_address: string | null; + } + export interface Event { /** * Transaction event identifier. @@ -803,7 +885,7 @@ export namespace Transaction { account_type?: 'CHECKING' | 'SAVINGS'; - network_specific_data?: Event.NetworkSpecificData; + network_specific_data?: Event.NetworkSpecificData | null; } export namespace Event { @@ -1229,6 +1311,13 @@ export interface TransactionListParams extends CursorPageParams { status?: 'PENDING' | 'VOIDED' | 'SETTLED' | 'DECLINED' | 'EXPIRED'; } +export interface TransactionRouteParams { + /** + * The token of the financial account to route the transaction to. + */ + financial_account_token: string; +} + export interface TransactionSimulateAuthorizationParams { /** * Amount (in cents) to authorize. For credit authorizations and financial credit @@ -1352,9 +1441,10 @@ export interface TransactionSimulateClearingParams { * example, entering 100 in this field will result in a -100 amount in the * transaction, if the original authorization is a credit authorization. * - * If `amount` is not set, the full amount of the transaction will be cleared. - * Transactions that have already cleared, either partially or fully, cannot be - * cleared again using this endpoint. + * If `amount` is not set, the full amount of the transaction will be cleared. This + * endpoint may be called multiple times against the same authorization to simulate + * a multiple-completion scenario, with each call creating a separate clearing + * event. */ amount?: number; } @@ -1516,6 +1606,7 @@ export declare namespace Transactions { type TransactionSimulateVoidResponse as TransactionSimulateVoidResponse, type TransactionsCursorPage as TransactionsCursorPage, type TransactionListParams as TransactionListParams, + type TransactionRouteParams as TransactionRouteParams, type TransactionSimulateAuthorizationParams as TransactionSimulateAuthorizationParams, type TransactionSimulateAuthorizationAdviceParams as TransactionSimulateAuthorizationAdviceParams, type TransactionSimulateClearingParams as TransactionSimulateClearingParams, diff --git a/src/resources/transfer-limits.ts b/src/resources/transfer-limits.ts index 0dc70708..eae0b7e9 100644 --- a/src/resources/transfer-limits.ts +++ b/src/resources/transfer-limits.ts @@ -95,7 +95,7 @@ export namespace TransferLimitsResponse { /** * Amount originated towards limit */ - amount_originated?: number; + amount_originated?: number | null; } /** @@ -110,7 +110,7 @@ export namespace TransferLimitsResponse { /** * Amount originated towards limit */ - amount_originated?: number; + amount_originated?: number | null; } } @@ -142,7 +142,7 @@ export namespace TransferLimitsResponse { /** * Amount originated towards limit */ - amount_originated?: number; + amount_originated?: number | null; } /** @@ -157,7 +157,7 @@ export namespace TransferLimitsResponse { /** * Amount originated towards limit */ - amount_originated?: number; + amount_originated?: number | null; } } @@ -189,7 +189,7 @@ export namespace TransferLimitsResponse { /** * Amount originated towards limit */ - amount_originated?: number; + amount_originated?: number | null; } /** @@ -204,7 +204,7 @@ export namespace TransferLimitsResponse { /** * Amount originated towards limit */ - amount_originated?: number; + amount_originated?: number | null; } } } diff --git a/src/resources/webhooks.ts b/src/resources/webhooks.ts index e92629db..0bd104ef 100644 --- a/src/resources/webhooks.ts +++ b/src/resources/webhooks.ts @@ -4,6 +4,7 @@ import { getRequiredHeader, HeadersLike } from '../internal/headers'; import { APIResource } from '../core/resource'; import { Webhook } from 'standardwebhooks'; import * as BookTransfersAPI from './book-transfers'; +import * as CardAuthorizationsAPI from './card-authorizations'; import * as DisputesAPI from './disputes'; import * as DisputesV2API from './disputes-v2'; import * as ExternalPaymentsAPI from './external-payments'; @@ -11,7 +12,6 @@ import * as FundingEventsAPI from './funding-events'; import * as InternalTransactionAPI from './internal-transaction'; import * as ManagementOperationsAPI from './management-operations'; import * as PaymentsAPI from './payments'; -import * as Shared from './shared'; import * as TokenizationsAPI from './tokenizations'; import * as AccountHoldersAPI from './account-holders/account-holders'; import * as ExternalBankAccountsAPI from './external-bank-accounts/external-bank-accounts'; @@ -160,7 +160,8 @@ export namespace AccountHolderUpdatedWebhookEvent { /** * Short description of the company's line of business (i.e., what does the company - * do?). + * do?). Values longer than 255 characters will be truncated before KYB + * verification */ nature_of_business?: string; @@ -666,830 +667,760 @@ export namespace AccountHolderDocumentUpdatedWebhookEvent { } } -export interface CardAuthorizationApprovalRequestWebhookEvent { - /** - * The provisional transaction group uuid associated with the authorization - */ - token: string; +/** + * The Auth Stream Access request payload that was sent to the ASA responder. + */ +export interface CardAuthorizationApprovalRequestWebhookEvent + extends CardAuthorizationsAPI.CardAuthorization { + event_type: 'card_authorization.approval_request'; +} +export interface CardAuthorizationChallengeWebhookEvent { /** - * Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be - * zero if no fee is assessed. Rebates may be transmitted as a negative value to - * indicate credited fees. + * The authorization that triggered the challenge */ - acquirer_fee: number; + authorization: CardAuthorizationsAPI.CardAuthorization; /** - * @deprecated Deprecated, use `amounts`. Authorization amount of the transaction - * (in cents), including any acquirer fees. The contents of this field are - * identical to `authorization_amount`. + * Details of the Authorization Challenge issued during card authorization */ - amount: number; + challenge: CardAuthorizationChallengeWebhookEvent.Challenge; /** - * Structured amounts for this authorization. The `cardholder` and `merchant` - * amounts reflect the original network authorization values. For programs with - * hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the - * `hold` amount may exceed the `cardholder` and `merchant` amounts to account for - * anticipated final transaction amounts such as tips or fuel fill-ups + * The type of event that occurred. */ - amounts: CardAuthorizationApprovalRequestWebhookEvent.Amounts; + event_type: 'card_authorization.challenge'; +} +export namespace CardAuthorizationChallengeWebhookEvent { /** - * @deprecated Deprecated, use `amounts`. The base transaction amount (in cents) - * plus the acquirer fee field. This is the amount the issuer should authorize - * against unless the issuer is paying the acquirer fee on behalf of the - * cardholder. + * Details of the Authorization Challenge issued during card authorization */ - authorization_amount: number; + export interface Challenge { + /** + * Globally unique identifier for the event that triggered the challenge. Use this + * token when calling the challenge response endpoint + */ + event_token: string; - avs: CardAuthorizationApprovalRequestWebhookEvent.Avs; + /** + * ISO-8601 time at which the challenge expires + */ + expiry_time: string; + /** + * ISO-8601 time at which the challenge was issued + */ + start_time: string; + } +} + +export interface CardAuthorizationChallengeResponseWebhookEvent { /** - * Card object in ASA + * The token of the card associated with the challenge */ - card: CardAuthorizationApprovalRequestWebhookEvent.Card; + card_token: string | null; /** - * @deprecated Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for - * cardholder's billing currency. + * The method used to deliver the challenge to the cardholder */ - cardholder_currency: string; + challenge_method: 'SMS' | 'OUT_OF_BAND'; /** - * The portion of the transaction requested as cash back by the cardholder, and - * does not include any acquirer fees. The amount field includes the purchase - * amount, the requested cash back amount, and any acquirer fees. - * - * If no cash back was requested, the value of this field will be 0, and the field - * will always be present. + * The timestamp of when the challenge was completed */ - cash_amount: number; + completed: string | null; /** - * Date and time when the transaction first occurred in UTC. + * The timestamp of when the challenge was created */ created: string; - event_type: 'card_authorization.approval_request'; - - merchant: Shared.Merchant; - /** - * @deprecated Deprecated, use `amounts`. The amount that the merchant will - * receive, denominated in `merchant_currency` and in the smallest currency unit. - * Note the amount includes `acquirer_fee`, similar to `authorization_amount`. It - * will be different from `authorization_amount` if the merchant is taking payment - * in a different currency. + * Globally unique identifier for the event */ - merchant_amount: number; + event_token: string; /** - * @deprecated 3-character alphabetic ISO 4217 code for the local currency of the - * transaction. + * Event type */ - merchant_currency: string; + event_type: 'card_authorization.challenge_response'; /** - * @deprecated Deprecated, use `amounts`. Amount (in cents) of the transaction that - * has been settled, including any acquirer fees. + * The cardholder's response to the challenge */ - settled_amount: number; + response: 'APPROVE' | 'DECLINE'; /** - * The type of authorization request that this request is for. Note that - * `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to - * users with credit decisioning via ASA enabled. + * The token of the transaction associated with the authorization event being + * challenged */ - status: - | 'AUTHORIZATION' - | 'CREDIT_AUTHORIZATION' - | 'FINANCIAL_AUTHORIZATION' - | 'FINANCIAL_CREDIT_AUTHORIZATION' - | 'BALANCE_INQUIRY'; + transaction_token: string | null; +} +export interface AuthRulesBacktestReportCreatedWebhookEvent extends BacktestsAPI.BacktestResults { /** - * The entity that initiated the transaction. + * The type of event that occurred. */ - transaction_initiator: 'CARDHOLDER' | 'MERCHANT' | 'UNKNOWN'; - - account_type?: 'CHECKING' | 'SAVINGS'; + event_type: 'auth_rules.backtest_report.created'; +} - cardholder_authentication?: TransactionsAPI.CardholderAuthentication; +export interface BalanceUpdatedWebhookEvent { + data: Array; /** - * Deprecated, use `cash_amount`. + * The type of event that occurred. */ - cashback?: number; + event_type: 'balance.updated'; +} +/** + * Book transfer transaction + */ +export interface BookTransferTransactionCreatedWebhookEvent extends BookTransfersAPI.BookTransferResponse { /** - * @deprecated Deprecated, use `amounts`. If the transaction was requested in a - * currency other than the settlement currency, this field will be populated to - * indicate the rate used to translate the merchant_amount to the amount (i.e., - * `merchant_amount` x `conversion_rate` = `amount`). Note that the - * `merchant_amount` is in the local currency and the amount is in the settlement - * currency. + * The type of event that occurred. */ - conversion_rate?: number; + event_type: 'book_transfer_transaction.created'; +} +/** + * Book transfer transaction + */ +export interface BookTransferTransactionUpdatedWebhookEvent extends BookTransfersAPI.BookTransferResponse { /** - * The event token associated with the authorization. This field is only set for - * programs enrolled into the beta. + * The type of event that occurred. */ - event_token?: string; + event_type: 'book_transfer_transaction.updated'; +} +export interface CardCreatedWebhookEvent { /** - * Optional Object containing information if the Card is a part of a Fleet managed - * program + * The token of the card that was created. */ - fleet_info?: CardAuthorizationApprovalRequestWebhookEvent.FleetInfo | null; + card_token: string; /** - * The latest Authorization Challenge that was issued to the cardholder for this - * merchant. + * The type of event that occurred. */ - latest_challenge?: CardAuthorizationApprovalRequestWebhookEvent.LatestChallenge; + event_type: 'card.created'; /** - * Card network of the authorization. + * The token of the card that was replaced, if the new card is a replacement card. */ - network?: 'AMEX' | 'INTERLINK' | 'MAESTRO' | 'MASTERCARD' | 'UNKNOWN' | 'VISA'; + replacement_for?: string | null; +} +export interface CardConvertedWebhookEvent { /** - * Network-provided score assessing risk level associated with a given - * authorization. Scores are on a range of 0-999, with 0 representing the lowest - * risk and 999 representing the highest risk. For Visa transactions, where the raw - * score has a range of 0-99, Lithic will normalize the score by multiplying the - * raw score by 10x. + * The token of the card that was created. */ - network_risk_score?: number | null; + card_token: string; /** - * Contains raw data provided by the card network, including attributes that - * provide further context about the authorization. If populated by the network, - * data is organized by Lithic and passed through without further modification. - * Please consult the official network documentation for more details about these - * values and how to use them. This object is only available to certain programs- - * contact your Customer Success Manager to discuss enabling access. + * The type of event that occurred. */ - network_specific_data?: CardAuthorizationApprovalRequestWebhookEvent.NetworkSpecificData | null; + event_type: 'card.converted'; +} - pos?: CardAuthorizationApprovalRequestWebhookEvent.Pos; +export interface CardRenewedWebhookEvent { + /** + * The type of event that occurred. + */ + event_type: 'card.renewed'; - token_info?: TransactionsAPI.TokenInfo | null; + /** + * The token of the card that was renewed. + */ + card_token?: string; /** - * Deprecated: approximate time-to-live for the authorization. + * The new expiration month of the card. */ - ttl?: string; -} + exp_month?: string; -export namespace CardAuthorizationApprovalRequestWebhookEvent { /** - * Structured amounts for this authorization. The `cardholder` and `merchant` - * amounts reflect the original network authorization values. For programs with - * hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the - * `hold` amount may exceed the `cardholder` and `merchant` amounts to account for - * anticipated final transaction amounts such as tips or fuel fill-ups + * The new expiration year of the card. */ - export interface Amounts { - cardholder: Amounts.Cardholder; + exp_year?: string; - hold: Amounts.Hold | null; + /** + * The previous expiration month of the card. + */ + previous_exp_month?: string; - merchant: Amounts.Merchant; + /** + * The previous expiration year of the card. + */ + previous_exp_year?: string; +} - settlement: Amounts.Settlement | null; - } +export interface CardReissuedWebhookEvent { + /** + * The type of event that occurred. + */ + event_type: 'card.reissued'; - export namespace Amounts { - export interface Cardholder { - /** - * Amount in the smallest unit of the applicable currency (e.g., cents) - */ - amount: number; + /** + * The token of the card that was reissued. + */ + card_token?: string; +} - /** - * Exchange rate used for currency conversion - */ - conversion_rate: string; +export interface CardShippedWebhookEvent { + /** + * The token of the bulk order associated with this card shipment, if applicable. + */ + bulk_order_token: string | null; - /** - * 3-character alphabetic ISO 4217 currency - */ - currency: Shared.Currency; - } + /** + * The token of the card that was shipped. + */ + card_token: string; - export interface Hold { - /** - * Amount in the smallest unit of the applicable currency (e.g., cents) - */ - amount: number; + /** + * The type of event that occurred. + */ + event_type: 'card.shipped'; - /** - * 3-character alphabetic ISO 4217 currency - */ - currency: Shared.Currency; - } + /** + * The specific shipping method used to ship the card. + */ + shipping_method: + | 'Ex-US expedited with tracking' + | 'Ex-US standard with tracking' + | 'Ex-US standard without tracking' + | 'FedEx 2 days' + | 'FedEx express' + | 'FedEx overnight' + | 'USPS priority' + | 'USPS with tracking' + | 'USPS without tracking envelope' + | 'USPS without tracking envelope non-machine' + | 'USPS without tracking flat'; - export interface Merchant { - /** - * Amount in the smallest unit of the applicable currency (e.g., cents) - */ - amount: number; + /** + * The tracking number of the shipment. + */ + tracking_number: string | null; +} - /** - * 3-character alphabetic ISO 4217 currency - */ - currency: Shared.Currency; - } +export interface CardUpdatedWebhookEvent { + /** + * The token of the card that was updated. + */ + card_token: string; - export interface Settlement { - /** - * Amount in the smallest unit of the applicable currency (e.g., cents) - */ - amount: number; + /** + * The type of event that occurred. + */ + event_type: 'card.updated'; - /** - * 3-character alphabetic ISO 4217 currency - */ - currency: Shared.Currency; - } - } + /** + * The previous values of the fields that were updated. + */ + previous_fields: unknown; - export interface Avs { - /** - * Cardholder address - */ - address: string; + /** + * The current state of the card. + */ + state: string; +} - /** - * Lithic's evaluation result comparing the transaction's address data with the - * cardholder KYC data if it exists. In the event Lithic does not have any - * Cardholder KYC data, or the transaction does not contain any address data, - * NOT_PRESENT will be returned - */ - address_on_file_match: 'MATCH' | 'MATCH_ADDRESS_ONLY' | 'MATCH_ZIP_ONLY' | 'MISMATCH' | 'NOT_PRESENT'; +export interface CardTransactionUpdatedWebhookEvent extends TransactionsAPI.Transaction { + /** + * The type of event that occurred. + */ + event_type: 'card_transaction.updated'; +} - /** - * Cardholder ZIP code - */ - zipcode: string; - } +export interface CardTransactionEnhancedDataCreatedWebhookEvent + extends EnhancedCommercialDataAPI.EnhancedData { + /** + * The type of event that occurred. + */ + event_type: 'card_transaction.enhanced_data.created'; +} +export interface CardTransactionEnhancedDataUpdatedWebhookEvent + extends EnhancedCommercialDataAPI.EnhancedData { /** - * Card object in ASA + * The type of event that occurred. */ - export interface Card { - /** - * Globally unique identifier for the card. - */ - token?: string; + event_type: 'card_transaction.enhanced_data.updated'; +} - /** - * Hostname of card’s locked merchant (will be empty if not applicable) - */ - hostname?: string; +export interface ClaimCreatedWebhookEvent { + /** + * Unique identifier for the claim, in UUID format + */ + token: string; - /** - * Last four digits of the card number - */ - last_four?: string; + /** + * Token for the account holder that filed the claim + */ + account_holder_token: string | null; - /** - * Customizable name to identify the card. We recommend against using this field to - * store JSON data as it can cause unexpected behavior. - */ - memo?: string; + /** + * Token for the account associated with the claim + */ + account_token: string | null; - /** - * Amount (in cents) to limit approved authorizations. Purchase requests above the - * spend limit will be declined (refunds and credits will be approved). - * - * Note that while spend limits are enforced based on authorized and settled volume - * on a card, they are not recommended to be used for balance or - * reconciliation-level accuracy. Spend limits also cannot block force posted - * charges (i.e., when a merchant sends a clearing message without a prior - * authorization). - */ - spend_limit?: number; + /** + * Tokens for the cards associated with the disputed transactions + */ + card_tokens: Array; - /** - * Note that to support recurring monthly payments, which can occur on different - * day every month, the time window we consider for MONTHLY velocity starts 6 days - * after the current calendar date one month prior. - */ - spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION'; + /** + * When the claim was created + */ + created: string; - state?: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT'; + /** + * Transactions included in this claim + */ + disputed_transactions: Array; - type?: 'SINGLE_USE' | 'MERCHANT_LOCKED' | 'UNLOCKED' | 'PHYSICAL' | 'DIGITAL_WALLET' | 'VIRTUAL'; - } + /** + * The type of event that occurred. + */ + event_type: 'claim.created'; /** - * Optional Object containing information if the Card is a part of a Fleet managed - * program + * Requirements that must be fulfilled before the claim can be submitted */ - export interface FleetInfo { - /** - * Code indicating what the driver was prompted to enter at time of purchase. This - * is configured at a program level and is a static configuration, and does not - * change on a request to request basis - */ - fleet_prompt_code: 'NO_PROMPT' | 'VEHICLE_NUMBER' | 'DRIVER_NUMBER'; + outstanding_requirements: Array<'QUESTIONNAIRE' | 'DOCUMENTS'>; - /** - * Code indicating which restrictions, if any, there are on purchase. This is - * configured at a program level and is a static configuration, and does not change - * on a request to request basis - */ - fleet_restriction_code: 'NO_RESTRICTIONS' | 'FUEL_ONLY'; + /** + * Dispute reason code provided when creating the claim + */ + reason: + | 'CARD_NOT_PRESENT' + | 'CARD_LOST' + | 'CARD_STOLEN' + | 'CARD_NEVER_RECEIVED' + | 'COUNTERFEIT' + | 'ACCOUNT_TAKEOVER' + | 'PRODUCT_NOT_RECEIVED' + | 'NOT_AS_DESCRIBED' + | 'CREDIT_NOT_PROCESSED' + | 'CANCELLED_RECURRING' + | 'PAID_BY_OTHER_MEANS' + | 'DUPLICATE_CHARGE' + | 'LATE_PRESENTMENT' + | 'INCORRECT_TRANSACTION_CODE' + | 'NO_AUTHORIZATION' + | 'DECLINED' + | 'INCORRECT_AMOUNT' + | 'ATM_CASH_NOT_DISPENSED' + | 'ATM_DEPOSIT_WRONG_AMOUNT' + | 'ATM_DEPOSIT_MISSING'; - /** - * Number representing the driver - */ - driver_number?: string | null; + /** + * Current lifecycle status of the claim + */ + status: 'INITIALIZING' | 'AWAITING_INFO' | 'SUBMITTED' | 'RESOLVED' | 'ABANDONED'; - /** - * Number associated with the vehicle - */ - vehicle_number?: string | null; - } + /** + * When the claim was submitted. Null until the claim reaches `SUBMITTED` status + */ + submitted: string | null; /** - * The latest Authorization Challenge that was issued to the cardholder for this - * merchant. + * When the claim was last updated */ - export interface LatestChallenge { - /** - * The phone number used for sending Authorization Challenge SMS. - */ - phone_number: string; + updated: string; +} +export namespace ClaimCreatedWebhookEvent { + /** + * A transaction included in a claim, along with the specific events being + * disputed. + */ + export interface DisputedTransaction { /** - * The status of the Authorization Challenge - * - * - `COMPLETED` - Challenge was successfully completed by the cardholder - * - `PENDING` - Challenge is still open - * - `EXPIRED` - Challenge has expired without being completed - * - `ERROR` - There was an error processing the challenge + * Tokens for the specific events within the transaction being disputed. Lithic + * creates one dispute per event token */ - status: 'COMPLETED' | 'PENDING' | 'EXPIRED' | 'ERROR'; + event_tokens: Array; /** - * The date and time when the Authorization Challenge was completed in UTC. Present - * only if the status is `COMPLETED`. + * Token for the transaction being disputed, in UUID format */ - completed_at?: string; + transaction_token: string; } +} +export interface ClaimUpdatedWebhookEvent { /** - * Contains raw data provided by the card network, including attributes that - * provide further context about the authorization. If populated by the network, - * data is organized by Lithic and passed through without further modification. - * Please consult the official network documentation for more details about these - * values and how to use them. This object is only available to certain programs- - * contact your Customer Success Manager to discuss enabling access. + * Unique identifier for the claim, in UUID format */ - export interface NetworkSpecificData { - mastercard?: NetworkSpecificData.Mastercard | null; - - visa?: NetworkSpecificData.Visa | null; - } - - export namespace NetworkSpecificData { - export interface Mastercard { - /** - * Indicates the electronic commerce security level and UCAF collection. - */ - ecommerce_security_level_indicator?: string | null; - - /** - * The On-behalf Service performed on the transaction and the results. Contains all - * applicable, on-behalf service results that were performed on a given - * transaction. - */ - on_behalf_service_result?: Array | null; - - /** - * Indicates the type of additional transaction purpose. - */ - transaction_type_identifier?: string | null; - } - - export namespace Mastercard { - export interface OnBehalfServiceResult { - /** - * Indicates the results of the service processing. - */ - result_1: string; - - /** - * Identifies the results of the service processing. - */ - result_2: string; - - /** - * Indicates the service performed on the transaction. - */ - service: string; - } - } - - export interface Visa { - /** - * Identifies the purpose or category of a transaction, used to classify and - * process transactions according to Visa’s rules. - */ - business_application_identifier?: string | null; - } - } - - export interface Pos { - /** - * POS > Entry Mode object in ASA - */ - entry_mode?: Pos.EntryMode; - - terminal?: Pos.Terminal; - } - - export namespace Pos { - /** - * POS > Entry Mode object in ASA - */ - export interface EntryMode { - /** - * Card Presence Indicator - */ - card?: 'PRESENT' | 'NOT_PRESENT' | 'UNKNOWN'; - - /** - * Cardholder Presence Indicator - */ - cardholder?: - | 'DEFERRED_BILLING' - | 'ELECTRONIC_ORDER' - | 'INSTALLMENT' - | 'MAIL_ORDER' - | 'NOT_PRESENT' - | 'PRESENT' - | 'REOCCURRING' - | 'TELEPHONE_ORDER' - | 'UNKNOWN'; + token: string; - /** - * Method of entry for the PAN - */ - pan?: - | 'AUTO_ENTRY' - | 'BAR_CODE' - | 'CONTACTLESS' - | 'ECOMMERCE' - | 'ERROR_KEYED' - | 'ERROR_MAGNETIC_STRIPE' - | 'ICC' - | 'KEY_ENTERED' - | 'MAGNETIC_STRIPE' - | 'MANUAL' - | 'OCR' - | 'SECURE_CARDLESS' - | 'UNSPECIFIED' - | 'UNKNOWN' - | 'CREDENTIAL_ON_FILE'; + /** + * Token for the account holder that filed the claim + */ + account_holder_token: string | null; - /** - * Indicates whether the cardholder entered the PIN. True if the PIN was entered. - */ - pin_entered?: boolean; - } + /** + * Token for the account associated with the claim + */ + account_token: string | null; - export interface Terminal { - /** - * True if a clerk is present at the sale. - */ - attended: boolean; + /** + * Tokens for the cards associated with the disputed transactions + */ + card_tokens: Array; - /** - * True if the terminal is capable of retaining the card. - */ - card_retention_capable: boolean; + /** + * When the claim was created + */ + created: string; - /** - * True if the sale was made at the place of business (vs. mobile). - */ - on_premise: boolean; + /** + * Transactions included in this claim + */ + disputed_transactions: Array; - /** - * The person that is designated to swipe the card - */ - operator: 'ADMINISTRATIVE' | 'CARDHOLDER' | 'CARD_ACCEPTOR' | 'UNKNOWN'; + /** + * The type of event that occurred. + */ + event_type: 'claim.updated'; - /** - * True if the terminal is capable of partial approval. Partial approval is when - * part of a transaction is approved and another payment must be used for the - * remainder. Example scenario: A $40 transaction is attempted on a prepaid card - * with a $25 balance. If partial approval is enabled, $25 can be authorized, at - * which point the POS will prompt the user for an additional payment of $15. - */ - partial_approval_capable: boolean; + /** + * Requirements that must be fulfilled before the claim can be submitted + */ + outstanding_requirements: Array<'QUESTIONNAIRE' | 'DOCUMENTS'>; - /** - * Status of whether the POS is able to accept PINs - */ - pin_capability: 'CAPABLE' | 'INOPERATIVE' | 'NOT_CAPABLE' | 'UNSPECIFIED'; + /** + * Dispute reason code provided when creating the claim + */ + reason: + | 'CARD_NOT_PRESENT' + | 'CARD_LOST' + | 'CARD_STOLEN' + | 'CARD_NEVER_RECEIVED' + | 'COUNTERFEIT' + | 'ACCOUNT_TAKEOVER' + | 'PRODUCT_NOT_RECEIVED' + | 'NOT_AS_DESCRIBED' + | 'CREDIT_NOT_PROCESSED' + | 'CANCELLED_RECURRING' + | 'PAID_BY_OTHER_MEANS' + | 'DUPLICATE_CHARGE' + | 'LATE_PRESENTMENT' + | 'INCORRECT_TRANSACTION_CODE' + | 'NO_AUTHORIZATION' + | 'DECLINED' + | 'INCORRECT_AMOUNT' + | 'ATM_CASH_NOT_DISPENSED' + | 'ATM_DEPOSIT_WRONG_AMOUNT' + | 'ATM_DEPOSIT_MISSING'; - /** - * POS Type - */ - type: - | 'ADMINISTRATIVE' - | 'ATM' - | 'AUTHORIZATION' - | 'COUPON_MACHINE' - | 'DIAL_TERMINAL' - | 'ECOMMERCE' - | 'ECR' - | 'FUEL_MACHINE' - | 'HOME_TERMINAL' - | 'MICR' - | 'OFF_PREMISE' - | 'PAYMENT' - | 'PDA' - | 'PHONE' - | 'POINT' - | 'POS_TERMINAL' - | 'PUBLIC_UTILITY' - | 'SELF_SERVICE' - | 'TELEVISION' - | 'TELLER' - | 'TRAVELERS_CHECK_MACHINE' - | 'VENDING' - | 'VOICE' - | 'UNKNOWN'; + /** + * Current lifecycle status of the claim + */ + status: 'INITIALIZING' | 'AWAITING_INFO' | 'SUBMITTED' | 'RESOLVED' | 'ABANDONED'; - /** - * Uniquely identifies a terminal at the card acceptor location of acquiring - * institutions or merchant POS Systems. Left justified with trailing spaces. - */ - acceptor_terminal_id?: string | null; - } - } + /** + * When the claim was submitted. Null until the claim reaches `SUBMITTED` status + */ + submitted: string | null; + + /** + * When the claim was last updated + */ + updated: string; } -/** - * A webhook for tokenization decisioning sent to the customer's responder endpoint - */ -export interface TokenizationDecisioningRequestWebhookEvent { +export namespace ClaimUpdatedWebhookEvent { /** - * Unique identifier for the user tokenizing a card + * A transaction included in a claim, along with the specific events being + * disputed. */ - account_token: string; + export interface DisputedTransaction { + /** + * Tokens for the specific events within the transaction being disputed. Lithic + * creates one dispute per event token + */ + event_tokens: Array; + + /** + * Token for the transaction being disputed, in UUID format + */ + transaction_token: string; + } +} +export interface ClaimDocumentUploadedWebhookEvent { /** - * Unique identifier for the card being tokenized + * Unique identifier for the document, in UUID format */ - card_token: string; + token: string; /** - * Indicate when the request was received from Mastercard or Visa + * When the document was created */ created: string; /** - * Contains the metadata for the digital wallet being tokenized. + * Presigned URL for downloading the uploaded document. Available once the document + * is being validated or has been accepted (`VALIDATING` or `ACCEPTED`) */ - digital_wallet_token_metadata: TokenizationsAPI.TokenMetadata; + download_url: string | null; /** - * The name of this event + * When the download URL expires */ - event_type: 'digital_wallet.tokenization_approval_request'; + download_url_expires_at: string | null; /** - * Whether Lithic decisioned on the token, and if so, what the decision was. - * APPROVED/VERIFICATION_REQUIRED/DENIED. + * The type of event that occurred. */ - issuer_decision: 'APPROVED' | 'DENIED' | 'VERIFICATION_REQUIRED'; + event_type: 'claim_document.uploaded'; /** - * The channel through which the tokenization was made. + * Reason the document failed validation. Null unless `status` is `REJECTED` */ - tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT'; + failure_reason: 'INVALID_MIME_TYPE' | 'FILE_TOO_LARGE' | 'FILE_EMPTY' | 'CORRUPT_FILE' | 'OTHER' | null; /** - * Unique identifier for the digital wallet token attempt + * Name provided when the upload intent was created */ - tokenization_token: string; + name: string; - wallet_decisioning_info: TokenizationsAPI.WalletDecisioningInfo; + /** + * Identifier of the document requirement this document satisfies. Null for + * supplemental documents not tied to a specific requirement + */ + requirement_id: string | null; - device?: TokenizationsAPI.Device; + /** + * Current validation status of the document + */ + status: 'PENDING' | 'VALIDATING' | 'ACCEPTED' | 'REJECTED'; /** - * The source of the tokenization. + * When the document was last updated */ - tokenization_source?: - | 'ACCOUNT_ON_FILE' - | 'CONTACTLESS_TAP' - | 'MANUAL_PROVISION' - | 'PUSH_PROVISION' - | 'TOKEN' - | 'UNKNOWN'; -} + updated: string; -export interface AuthRulesBacktestReportCreatedWebhookEvent extends BacktestsAPI.BacktestResults { /** - * The type of event that occurred. + * Constraints that an uploaded file must satisfy. */ - event_type: 'auth_rules.backtest_report.created'; -} + upload_constraints: ClaimDocumentUploadedWebhookEvent.UploadConstraints | null; -export interface BalanceUpdatedWebhookEvent { - data: Array; + /** + * Presigned URL for uploading the file via HTTP PUT. Null after the upload window + * expires or after the document has been validated + */ + upload_url: string | null; /** - * The type of event that occurred. + * When the upload URL expires */ - event_type: 'balance.updated'; + upload_url_expires_at: string | null; } -/** - * Book transfer transaction - */ -export interface BookTransferTransactionCreatedWebhookEvent extends BookTransfersAPI.BookTransferResponse { +export namespace ClaimDocumentUploadedWebhookEvent { /** - * The type of event that occurred. + * Constraints that an uploaded file must satisfy. */ - event_type: 'book_transfer_transaction.created'; + export interface UploadConstraints { + /** + * MIME types accepted for upload + */ + accepted_mime_types: Array; + + /** + * Maximum file size in bytes. Null if there is no enforced size limit + */ + max_size_bytes: number | null; + } } -/** - * Book transfer transaction - */ -export interface BookTransferTransactionUpdatedWebhookEvent extends BookTransfersAPI.BookTransferResponse { +export interface ClaimDocumentAcceptedWebhookEvent { /** - * The type of event that occurred. + * Unique identifier for the document, in UUID format */ - event_type: 'book_transfer_transaction.updated'; -} + token: string; -export interface CardCreatedWebhookEvent { /** - * The token of the card that was created. + * When the document was created */ - card_token: string; + created: string; + + /** + * Presigned URL for downloading the uploaded document. Available once the document + * is being validated or has been accepted (`VALIDATING` or `ACCEPTED`) + */ + download_url: string | null; + + /** + * When the download URL expires + */ + download_url_expires_at: string | null; /** * The type of event that occurred. */ - event_type: 'card.created'; + event_type: 'claim_document.accepted'; /** - * The token of the card that was replaced, if the new card is a replacement card. + * Reason the document failed validation. Null unless `status` is `REJECTED` */ - replacement_for?: string | null; -} + failure_reason: 'INVALID_MIME_TYPE' | 'FILE_TOO_LARGE' | 'FILE_EMPTY' | 'CORRUPT_FILE' | 'OTHER' | null; -export interface CardConvertedWebhookEvent { /** - * The token of the card that was created. + * Name provided when the upload intent was created */ - card_token: string; + name: string; /** - * The type of event that occurred. + * Identifier of the document requirement this document satisfies. Null for + * supplemental documents not tied to a specific requirement */ - event_type: 'card.converted'; -} + requirement_id: string | null; -export interface CardRenewedWebhookEvent { /** - * The type of event that occurred. + * Current validation status of the document */ - event_type: 'card.renewed'; + status: 'PENDING' | 'VALIDATING' | 'ACCEPTED' | 'REJECTED'; /** - * The token of the card that was renewed. + * When the document was last updated */ - card_token?: string; + updated: string; /** - * The new expiration month of the card. + * Constraints that an uploaded file must satisfy. */ - exp_month?: string; + upload_constraints: ClaimDocumentAcceptedWebhookEvent.UploadConstraints | null; /** - * The new expiration year of the card. + * Presigned URL for uploading the file via HTTP PUT. Null after the upload window + * expires or after the document has been validated */ - exp_year?: string; + upload_url: string | null; /** - * The previous expiration month of the card. + * When the upload URL expires */ - previous_exp_month?: string; + upload_url_expires_at: string | null; +} +export namespace ClaimDocumentAcceptedWebhookEvent { /** - * The previous expiration year of the card. + * Constraints that an uploaded file must satisfy. */ - previous_exp_year?: string; + export interface UploadConstraints { + /** + * MIME types accepted for upload + */ + accepted_mime_types: Array; + + /** + * Maximum file size in bytes. Null if there is no enforced size limit + */ + max_size_bytes: number | null; + } } -export interface CardReissuedWebhookEvent { +export interface ClaimDocumentRejectedWebhookEvent { /** - * The type of event that occurred. + * Unique identifier for the document, in UUID format */ - event_type: 'card.reissued'; + token: string; /** - * The token of the card that was reissued. + * When the document was created */ - card_token?: string; -} + created: string; -export interface CardShippedWebhookEvent { /** - * The token of the bulk order associated with this card shipment, if applicable. + * Presigned URL for downloading the uploaded document. Available once the document + * is being validated or has been accepted (`VALIDATING` or `ACCEPTED`) */ - bulk_order_token: string | null; + download_url: string | null; /** - * The token of the card that was shipped. + * When the download URL expires */ - card_token: string; + download_url_expires_at: string | null; /** * The type of event that occurred. */ - event_type: 'card.shipped'; + event_type: 'claim_document.rejected'; /** - * The specific shipping method used to ship the card. + * Reason the document failed validation. Null unless `status` is `REJECTED` */ - shipping_method: - | 'Ex-US expedited with tracking' - | 'Ex-US standard with tracking' - | 'Ex-US standard without tracking' - | 'FedEx 2 days' - | 'FedEx express' - | 'FedEx overnight' - | 'USPS priority' - | 'USPS with tracking' - | 'USPS without tracking envelope' - | 'USPS without tracking envelope non-machine' - | 'USPS without tracking flat'; + failure_reason: 'INVALID_MIME_TYPE' | 'FILE_TOO_LARGE' | 'FILE_EMPTY' | 'CORRUPT_FILE' | 'OTHER' | null; /** - * The tracking number of the shipment. + * Name provided when the upload intent was created */ - tracking_number: string | null; -} + name: string; -export interface CardUpdatedWebhookEvent { /** - * The token of the card that was updated. + * Identifier of the document requirement this document satisfies. Null for + * supplemental documents not tied to a specific requirement */ - card_token: string; + requirement_id: string | null; /** - * The type of event that occurred. + * Current validation status of the document */ - event_type: 'card.updated'; + status: 'PENDING' | 'VALIDATING' | 'ACCEPTED' | 'REJECTED'; /** - * The previous values of the fields that were updated. + * When the document was last updated */ - previous_fields: unknown; + updated: string; /** - * The current state of the card. + * Constraints that an uploaded file must satisfy. */ - state: string; -} + upload_constraints: ClaimDocumentRejectedWebhookEvent.UploadConstraints | null; -export interface CardTransactionUpdatedWebhookEvent extends TransactionsAPI.Transaction { /** - * The type of event that occurred. + * Presigned URL for uploading the file via HTTP PUT. Null after the upload window + * expires or after the document has been validated */ - event_type: 'card_transaction.updated'; -} + upload_url: string | null; -export interface CardTransactionEnhancedDataCreatedWebhookEvent - extends EnhancedCommercialDataAPI.EnhancedData { /** - * The type of event that occurred. + * When the upload URL expires */ - event_type: 'card_transaction.enhanced_data.created'; + upload_url_expires_at: string | null; } -export interface CardTransactionEnhancedDataUpdatedWebhookEvent - extends EnhancedCommercialDataAPI.EnhancedData { +export namespace ClaimDocumentRejectedWebhookEvent { /** - * The type of event that occurred. + * Constraints that an uploaded file must satisfy. */ - event_type: 'card_transaction.enhanced_data.updated'; + export interface UploadConstraints { + /** + * MIME types accepted for upload + */ + accepted_mime_types: Array; + + /** + * Maximum file size in bytes. Null if there is no enforced size limit + */ + max_size_bytes: number | null; + } } +/** + * Payload for digital wallet tokenization approval requests. Used for both the + * decisioning responder request (sent to the customer's endpoint for a real-time + * decision) and the subsequent webhook event (sent after the decision is made). + * Fields like customer_tokenization_decision, tokenization_decline_reasons, + * tokenization_tfa_reasons, and rule_results are only populated in the webhook + * event, not in the initial decisioning request. + */ export interface DigitalWalletTokenizationApprovalRequestWebhookEvent { /** * Unique identifier for the user tokenizing a card @@ -1506,11 +1437,6 @@ export interface DigitalWalletTokenizationApprovalRequestWebhookEvent { */ created: string; - /** - * Contains the metadata for the customer tokenization decision. - */ - customer_tokenization_decision: DigitalWalletTokenizationApprovalRequestWebhookEvent.CustomerTokenizationDecision | null; - /** * Contains the metadata for the digital wallet being tokenized. */ @@ -1539,15 +1465,22 @@ export interface DigitalWalletTokenizationApprovalRequestWebhookEvent { wallet_decisioning_info: TokenizationsAPI.WalletDecisioningInfo; + /** + * Contains the metadata for the customer tokenization decision. + */ + customer_tokenization_decision?: DigitalWalletTokenizationApprovalRequestWebhookEvent.CustomerTokenizationDecision | null; + device?: TokenizationsAPI.Device; /** - * Results from rules that were evaluated for this tokenization + * Results from rules that were evaluated for this tokenization. Only populated in + * webhook events, not in the initial decisioning request */ rule_results?: Array; /** - * List of reasons why the tokenization was declined + * List of reasons why the tokenization was declined. Only populated in webhook + * events, not in the initial decisioning request */ tokenization_decline_reasons?: Array; @@ -1563,7 +1496,8 @@ export interface DigitalWalletTokenizationApprovalRequestWebhookEvent { | 'UNKNOWN'; /** - * List of reasons why two-factor authentication was required + * List of reasons why two-factor authentication was required. Only populated in + * webhook events, not in the initial decisioning request */ tokenization_tfa_reasons?: Array; } @@ -1831,6 +1765,94 @@ export interface DisputeEvidenceUploadFailedWebhookEvent extends DisputesAPI.Dis event_type: 'dispute_evidence.upload_failed'; } +export interface EmbedSessionGeneratedWebhookEvent { + /** + * The token of the account associated with the card + */ + account_token: string; + + /** + * The token of the card associated with the embed session + */ + card_token: string; + + /** + * Details about the request that generated the embed session + */ + device_details: EmbedSessionGeneratedWebhookEvent.DeviceDetails; + + /** + * The type of event + */ + event_type: 'embed.session_generated'; + + /** + * The identifier shared by webhook events for the same embed session. + */ + session_id: string; + + /** + * The type of embed session that was generated + */ + session_type: 'CARD_EMBED' | 'PIN_SETTING_EMBED'; +} + +export namespace EmbedSessionGeneratedWebhookEvent { + /** + * Details about the request that generated the embed session + */ + export interface DeviceDetails { + /** + * The IP address recorded for the request that generated the event + */ + ip_address: string; + } +} + +export interface EmbedViewedWebhookEvent { + /** + * The token of the account associated with the card + */ + account_token: string; + + /** + * The token of the card whose details were revealed + */ + card_token: string; + + /** + * Details about the request that revealed the card detail + */ + device_details: EmbedViewedWebhookEvent.DeviceDetails; + + /** + * The type of card detail that was revealed + */ + embed_type: 'PAN' | 'CVV' | 'EXP_MONTH' | 'EXP_YEAR'; + + /** + * The type of event + */ + event_type: 'embed.viewed'; + + /** + * The identifier shared by webhook events for the same embed session. + */ + session_id: string; +} + +export namespace EmbedViewedWebhookEvent { + /** + * Details about the request that revealed the card detail + */ + export interface DeviceDetails { + /** + * The IP address recorded for the request that generated the event + */ + ip_address: string; + } +} + export interface ExternalBankAccountCreatedWebhookEvent extends ExternalBankAccountsAPI.ExternalBankAccount { /** * The type of event that occurred. @@ -2395,7 +2417,8 @@ export type ParsedWebhookEvent = | AccountHolderVerificationWebhookEvent | AccountHolderDocumentUpdatedWebhookEvent | CardAuthorizationApprovalRequestWebhookEvent - | TokenizationDecisioningRequestWebhookEvent + | CardAuthorizationChallengeWebhookEvent + | CardAuthorizationChallengeResponseWebhookEvent | AuthRulesBacktestReportCreatedWebhookEvent | BalanceUpdatedWebhookEvent | BookTransferTransactionCreatedWebhookEvent @@ -2409,6 +2432,11 @@ export type ParsedWebhookEvent = | CardTransactionUpdatedWebhookEvent | CardTransactionEnhancedDataCreatedWebhookEvent | CardTransactionEnhancedDataUpdatedWebhookEvent + | ClaimCreatedWebhookEvent + | ClaimUpdatedWebhookEvent + | ClaimDocumentUploadedWebhookEvent + | ClaimDocumentAcceptedWebhookEvent + | ClaimDocumentRejectedWebhookEvent | DigitalWalletTokenizationApprovalRequestWebhookEvent | DigitalWalletTokenizationResultWebhookEvent | DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent @@ -2416,6 +2444,8 @@ export type ParsedWebhookEvent = | DigitalWalletTokenizationUpdatedWebhookEvent | DisputeUpdatedWebhookEvent | DisputeEvidenceUploadFailedWebhookEvent + | EmbedSessionGeneratedWebhookEvent + | EmbedViewedWebhookEvent | ExternalBankAccountCreatedWebhookEvent | ExternalBankAccountUpdatedWebhookEvent | ExternalPaymentCreatedWebhookEvent @@ -2481,7 +2511,8 @@ export namespace ParsedWebhookEvent { /** * Short description of the company's line of business (i.e., what does the company - * do?). + * do?). Values longer than 255 characters will be truncated before KYB + * verification */ nature_of_business?: string; @@ -2874,7 +2905,8 @@ export declare namespace Webhooks { type AccountHolderVerificationWebhookEvent as AccountHolderVerificationWebhookEvent, type AccountHolderDocumentUpdatedWebhookEvent as AccountHolderDocumentUpdatedWebhookEvent, type CardAuthorizationApprovalRequestWebhookEvent as CardAuthorizationApprovalRequestWebhookEvent, - type TokenizationDecisioningRequestWebhookEvent as TokenizationDecisioningRequestWebhookEvent, + type CardAuthorizationChallengeWebhookEvent as CardAuthorizationChallengeWebhookEvent, + type CardAuthorizationChallengeResponseWebhookEvent as CardAuthorizationChallengeResponseWebhookEvent, type AuthRulesBacktestReportCreatedWebhookEvent as AuthRulesBacktestReportCreatedWebhookEvent, type BalanceUpdatedWebhookEvent as BalanceUpdatedWebhookEvent, type BookTransferTransactionCreatedWebhookEvent as BookTransferTransactionCreatedWebhookEvent, @@ -2888,6 +2920,11 @@ export declare namespace Webhooks { type CardTransactionUpdatedWebhookEvent as CardTransactionUpdatedWebhookEvent, type CardTransactionEnhancedDataCreatedWebhookEvent as CardTransactionEnhancedDataCreatedWebhookEvent, type CardTransactionEnhancedDataUpdatedWebhookEvent as CardTransactionEnhancedDataUpdatedWebhookEvent, + type ClaimCreatedWebhookEvent as ClaimCreatedWebhookEvent, + type ClaimUpdatedWebhookEvent as ClaimUpdatedWebhookEvent, + type ClaimDocumentUploadedWebhookEvent as ClaimDocumentUploadedWebhookEvent, + type ClaimDocumentAcceptedWebhookEvent as ClaimDocumentAcceptedWebhookEvent, + type ClaimDocumentRejectedWebhookEvent as ClaimDocumentRejectedWebhookEvent, type DigitalWalletTokenizationApprovalRequestWebhookEvent as DigitalWalletTokenizationApprovalRequestWebhookEvent, type DigitalWalletTokenizationResultWebhookEvent as DigitalWalletTokenizationResultWebhookEvent, type DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent as DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, @@ -2895,6 +2932,8 @@ export declare namespace Webhooks { type DigitalWalletTokenizationUpdatedWebhookEvent as DigitalWalletTokenizationUpdatedWebhookEvent, type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent, type DisputeEvidenceUploadFailedWebhookEvent as DisputeEvidenceUploadFailedWebhookEvent, + type EmbedSessionGeneratedWebhookEvent as EmbedSessionGeneratedWebhookEvent, + type EmbedViewedWebhookEvent as EmbedViewedWebhookEvent, type ExternalBankAccountCreatedWebhookEvent as ExternalBankAccountCreatedWebhookEvent, type ExternalBankAccountUpdatedWebhookEvent as ExternalBankAccountUpdatedWebhookEvent, type ExternalPaymentCreatedWebhookEvent as ExternalPaymentCreatedWebhookEvent, diff --git a/src/version.ts b/src/version.ts index 63a530b5..cce58f68 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.131.0'; // x-release-please-version +export const VERSION = '0.145.0'; // x-release-please-version diff --git a/tests/api-resources/accounts.test.ts b/tests/api-resources/accounts.test.ts index d18a4b41..1b94b7d6 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -58,6 +58,17 @@ describe('resource accounts', () => { ).rejects.toThrow(Lithic.NotFoundError); }); + test('retrieveSignals', async () => { + const responsePromise = client.accounts.retrieveSignals('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + test('retrieveSpendLimits', async () => { const responsePromise = client.accounts.retrieveSpendLimits('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/auth-rules/v2/v2.test.ts b/tests/api-resources/auth-rules/v2/v2.test.ts index 488f6402..1d5700a4 100644 --- a/tests/api-resources/auth-rules/v2/v2.test.ts +++ b/tests/api-resources/auth-rules/v2/v2.test.ts @@ -154,6 +154,17 @@ describe('resource v2', () => { ).rejects.toThrow(Lithic.NotFoundError); }); + test('listVersions', async () => { + const responsePromise = client.authRules.v2.listVersions('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + test('promote', async () => { const responsePromise = client.authRules.v2.promote('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/card-authorizations.test.ts b/tests/api-resources/card-authorizations.test.ts new file mode 100644 index 00000000..47cc8d57 --- /dev/null +++ b/tests/api-resources/card-authorizations.test.ts @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Lithic from 'lithic'; + +const client = new Lithic({ + apiKey: 'My Lithic API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource cardAuthorizations', () => { + test('challengeResponse: only required params', async () => { + const responsePromise = client.cardAuthorizations.challengeResponse( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { response: 'APPROVE' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('challengeResponse: required and optional params', async () => { + const response = await client.cardAuthorizations.challengeResponse( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { response: 'APPROVE' }, + ); + }); +}); diff --git a/tests/api-resources/cards/cards.test.ts b/tests/api-resources/cards/cards.test.ts index 737dae32..73d52bd8 100644 --- a/tests/api-resources/cards/cards.test.ts +++ b/tests/api-resources/cards/cards.test.ts @@ -242,6 +242,17 @@ describe('resource cards', () => { }); }); + test('retrieveSignals', async () => { + const responsePromise = client.cards.retrieveSignals('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + test('retrieveSpendLimits', async () => { const responsePromise = client.cards.retrieveSpendLimits('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/external-bank-accounts/external-bank-accounts.test.ts b/tests/api-resources/external-bank-accounts/external-bank-accounts.test.ts index eb647c27..d9c8a051 100644 --- a/tests/api-resources/external-bank-accounts/external-bank-accounts.test.ts +++ b/tests/api-resources/external-bank-accounts/external-bank-accounts.test.ts @@ -111,6 +111,17 @@ describe('resource externalBankAccounts', () => { ).rejects.toThrow(Lithic.NotFoundError); }); + test('pause', async () => { + const responsePromise = client.externalBankAccounts.pause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + test('retryMicroDeposits', async () => { const responsePromise = client.externalBankAccounts.retryMicroDeposits( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -157,6 +168,30 @@ describe('resource externalBankAccounts', () => { ).rejects.toThrow(Lithic.NotFoundError); }); + test('setVerificationMethod: only required params', async () => { + const responsePromise = client.externalBankAccounts.setVerificationMethod( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { verification_method: 'MICRO_DEPOSIT' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('setVerificationMethod: required and optional params', async () => { + const response = await client.externalBankAccounts.setVerificationMethod( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + verification_method: 'MICRO_DEPOSIT', + financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + ); + }); + test('unpause', async () => { const responsePromise = client.externalBankAccounts.unpause('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/financial-accounts/financial-accounts.test.ts b/tests/api-resources/financial-accounts/financial-accounts.test.ts index 9cb19138..daa46ad8 100644 --- a/tests/api-resources/financial-accounts/financial-accounts.test.ts +++ b/tests/api-resources/financial-accounts/financial-accounts.test.ts @@ -110,8 +110,8 @@ describe('resource financialAccounts', () => { test('updateStatus: only required params', async () => { const responsePromise = client.financialAccounts.updateStatus('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { - status: 'OPEN', - substatus: 'CHARGED_OFF_FRAUD', + status: 'CLOSED', + substatus: 'END_USER_REQUEST', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -124,8 +124,8 @@ describe('resource financialAccounts', () => { test('updateStatus: required and optional params', async () => { const response = await client.financialAccounts.updateStatus('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { - status: 'OPEN', - substatus: 'CHARGED_OFF_FRAUD', + status: 'CLOSED', + substatus: 'END_USER_REQUEST', user_defined_status: '26', }); }); diff --git a/tests/api-resources/financial-accounts/interest-tier-schedule.test.ts b/tests/api-resources/financial-accounts/interest-tier-schedule.test.ts index 5312bb21..2f99c01f 100644 --- a/tests/api-resources/financial-accounts/interest-tier-schedule.test.ts +++ b/tests/api-resources/financial-accounts/interest-tier-schedule.test.ts @@ -28,6 +28,7 @@ describe('resource interestTierSchedule', () => { { credit_product_token: 'credit_product_token', effective_date: '2019-12-27', + penalty_rates: {}, tier_name: 'tier_name', tier_rates: {}, }, @@ -69,6 +70,7 @@ describe('resource interestTierSchedule', () => { test('update: required and optional params', async () => { const response = await client.financialAccounts.interestTierSchedule.update('2019-12-27', { financial_account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + penalty_rates: {}, tier_name: 'tier_name', tier_rates: {}, }); diff --git a/tests/api-resources/holds.test.ts b/tests/api-resources/holds.test.ts new file mode 100644 index 00000000..8a4386c8 --- /dev/null +++ b/tests/api-resources/holds.test.ts @@ -0,0 +1,82 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Lithic from 'lithic'; + +const client = new Lithic({ + apiKey: 'My Lithic API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource holds', () => { + test('create: only required params', async () => { + const responsePromise = client.holds.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { amount: 1 }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.holds.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + amount: 1, + token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + expiration_datetime: '2019-12-27T18:11:19.117Z', + memo: 'memo', + user_defined_id: 'user_defined_id', + }); + }); + + test('retrieve', async () => { + const responsePromise = client.holds.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list', async () => { + const responsePromise = client.holds.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.holds.list( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + begin: '2019-12-27T18:11:19.117Z', + end: '2019-12-27T18:11:19.117Z', + ending_before: 'ending_before', + page_size: 1, + starting_after: 'starting_after', + status: 'PENDING', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Lithic.NotFoundError); + }); + + test('void', async () => { + const responsePromise = client.holds.void('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/payments.test.ts b/tests/api-resources/payments.test.ts index d42b8cb6..6b57065a 100644 --- a/tests/api-resources/payments.test.ts +++ b/tests/api-resources/payments.test.ts @@ -36,6 +36,7 @@ describe('resource payments', () => { sec_code: 'CCD', ach_hold_period: 0, addenda: 'addenda', + override_company_name: 'override_company_name', }, type: 'COLLECTION', token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', diff --git a/tests/api-resources/reports/settlement/network-totals.test.ts b/tests/api-resources/reports/settlement/network-totals.test.ts index 2bf1f44a..01db9656 100644 --- a/tests/api-resources/reports/settlement/network-totals.test.ts +++ b/tests/api-resources/reports/settlement/network-totals.test.ts @@ -41,7 +41,7 @@ describe('resource networkTotals', () => { end: '2019-12-27T18:11:19.117Z', ending_before: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', institution_id: 'institution_id', - network: 'VISA', + network: 'AMEX', page_size: 1, report_date: '2019-12-27', report_date_begin: '2019-12-27', diff --git a/tests/api-resources/transaction-monitoring/cases/cases.test.ts b/tests/api-resources/transaction-monitoring/cases/cases.test.ts new file mode 100644 index 00000000..ff132019 --- /dev/null +++ b/tests/api-resources/transaction-monitoring/cases/cases.test.ts @@ -0,0 +1,142 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Lithic from 'lithic'; + +const client = new Lithic({ + apiKey: 'My Lithic API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource cases', () => { + test('retrieve', async () => { + const responsePromise = client.transactionMonitoring.cases.retrieve( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update', async () => { + const responsePromise = client.transactionMonitoring.cases.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list', async () => { + const responsePromise = client.transactionMonitoring.cases.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.transactionMonitoring.cases.list( + { + account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + assignee: 'assignee', + begin: '2019-12-27T18:11:19.117Z', + card_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + end: '2019-12-27T18:11:19.117Z', + ending_before: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + entity_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + page_size: 1, + queue_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + rule_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + sort_by: 'CREATED_ASC', + starting_after: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + status: 'OPEN', + transaction_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Lithic.NotFoundError); + }); + + test('listActivity', async () => { + const responsePromise = client.transactionMonitoring.cases.listActivity( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('listActivity: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.transactionMonitoring.cases.listActivity( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + ending_before: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + page_size: 1, + starting_after: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Lithic.NotFoundError); + }); + + test('listTransactions', async () => { + const responsePromise = client.transactionMonitoring.cases.listTransactions( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('listTransactions: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.transactionMonitoring.cases.listTransactions( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + ending_before: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + page_size: 1, + starting_after: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Lithic.NotFoundError); + }); + + test('retrieveCards', async () => { + const responsePromise = client.transactionMonitoring.cases.retrieveCards( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/transaction-monitoring/cases/comments.test.ts b/tests/api-resources/transaction-monitoring/cases/comments.test.ts new file mode 100644 index 00000000..914e5441 --- /dev/null +++ b/tests/api-resources/transaction-monitoring/cases/comments.test.ts @@ -0,0 +1,77 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Lithic from 'lithic'; + +const client = new Lithic({ + apiKey: 'My Lithic API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource comments', () => { + test('create: only required params', async () => { + const responsePromise = client.transactionMonitoring.cases.comments.create( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { comment: 'comment' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.transactionMonitoring.cases.comments.create( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { comment: 'comment', actor_token: 'actor_token' }, + ); + }); + + test('update: only required params', async () => { + const responsePromise = client.transactionMonitoring.cases.comments.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', comment: 'comment' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.transactionMonitoring.cases.comments.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + comment: 'comment', + actor_token: 'actor_token', + }, + ); + }); + + test('delete: only required params', async () => { + const responsePromise = client.transactionMonitoring.cases.comments.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.transactionMonitoring.cases.comments.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + ); + }); +}); diff --git a/tests/api-resources/transaction-monitoring/cases/files.test.ts b/tests/api-resources/transaction-monitoring/cases/files.test.ts new file mode 100644 index 00000000..f9cea3d6 --- /dev/null +++ b/tests/api-resources/transaction-monitoring/cases/files.test.ts @@ -0,0 +1,101 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Lithic from 'lithic'; + +const client = new Lithic({ + apiKey: 'My Lithic API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource files', () => { + test('create: only required params', async () => { + const responsePromise = client.transactionMonitoring.cases.files.create( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { name: 'name' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.transactionMonitoring.cases.files.create( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { name: 'name' }, + ); + }); + + test('retrieve: only required params', async () => { + const responsePromise = client.transactionMonitoring.cases.files.retrieve( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('retrieve: required and optional params', async () => { + const response = await client.transactionMonitoring.cases.files.retrieve( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + ); + }); + + test('list', async () => { + const responsePromise = client.transactionMonitoring.cases.files.list( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.transactionMonitoring.cases.files.list( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + ending_before: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + page_size: 1, + starting_after: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Lithic.NotFoundError); + }); + + test('delete: only required params', async () => { + const responsePromise = client.transactionMonitoring.cases.files.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.transactionMonitoring.cases.files.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { case_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + ); + }); +}); diff --git a/tests/api-resources/transaction-monitoring/queues.test.ts b/tests/api-resources/transaction-monitoring/queues.test.ts new file mode 100644 index 00000000..41032d00 --- /dev/null +++ b/tests/api-resources/transaction-monitoring/queues.test.ts @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Lithic from 'lithic'; + +const client = new Lithic({ + apiKey: 'My Lithic API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource queues', () => { + test('create: only required params', async () => { + const responsePromise = client.transactionMonitoring.queues.create({ name: 'name' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.transactionMonitoring.queues.create({ + name: 'name', + allowed_resolutions: ['x'], + description: 'description', + }); + }); + + test('retrieve', async () => { + const responsePromise = client.transactionMonitoring.queues.retrieve( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update', async () => { + const responsePromise = client.transactionMonitoring.queues.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list', async () => { + const responsePromise = client.transactionMonitoring.queues.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.transactionMonitoring.queues.list( + { + ending_before: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + page_size: 1, + starting_after: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Lithic.NotFoundError); + }); + + test('delete', async () => { + const responsePromise = client.transactionMonitoring.queues.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/transactions/transactions.test.ts b/tests/api-resources/transactions/transactions.test.ts index 79bd7990..5226dbfc 100644 --- a/tests/api-resources/transactions/transactions.test.ts +++ b/tests/api-resources/transactions/transactions.test.ts @@ -61,6 +61,25 @@ describe('resource transactions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + test('route: only required params', async () => { + const responsePromise = client.transactions.route('00000000-0000-0000-0000-000000000000', { + financial_account_token: '00000000-0000-0000-0000-000000000000', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('route: required and optional params', async () => { + const response = await client.transactions.route('00000000-0000-0000-0000-000000000000', { + financial_account_token: '00000000-0000-0000-0000-000000000000', + }); + }); + test('simulateAuthorization: only required params', async () => { const responsePromise = client.transactions.simulateAuthorization({ amount: 3831, diff --git a/tests/api-resources/webhooks.test.ts b/tests/api-resources/webhooks.test.ts index 728450b3..5f3f5d52 100644 --- a/tests/api-resources/webhooks.test.ts +++ b/tests/api-resources/webhooks.test.ts @@ -239,7 +239,7 @@ describe('resource webhooks', () => { describe('parse', () => { const secret = 'whsec_c2VjcmV0Cg=='; const payload = - '{"event_type":"account_holder.created","token":"00000000-0000-0000-0000-000000000001","account_token":"00000000-0000-0000-0000-000000000001","created":"2019-12-27T18:11:19.117Z","required_documents":[{"entity_token":"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e","status_reasons":["string"],"valid_documents":["string"]}],"status":"ACCEPTED","status_reason":["string"]}'; + '{"account_token":"00000000-0000-0000-0000-000000000002","card_token":"00000000-0000-0000-0000-000000000001","created":"2023-09-18T12:34:56Z","digital_wallet_token_metadata":{"payment_account_info":{"account_holder_data":{"phone_number":"+15555555555"},"pan_unique_reference":"pan_unique_ref_1234567890123456789012345678","payment_account_reference":"ref_1234567890123456789012","token_unique_reference":"token_unique_ref_1234567890123456789012345678"},"status":"Pending","payment_app_instance_id":"app_instance_123456789012345678901234567890","token_requestor_id":"12345678901","token_requestor_name":"APPLE_PAY"},"event_type":"digital_wallet.tokenization_approval_request","issuer_decision":"APPROVED","tokenization_channel":"DIGITAL_WALLET","tokenization_token":"tok_1234567890abcdef","wallet_decisioning_info":{"account_score":"100","device_score":"100","recommended_decision":"Decision1","recommendation_reasons":["Reason1"]},"customer_tokenization_decision":{"outcome":"APPROVED","responder_url":"https://example.com","latency":"100","response_code":"123456"},"device":{"imei":"123456789012345","ip_address":"1.1.1.1","location":"37.3860517/-122.0838511"},"rule_results":[{"auth_rule_token":"550e8400-e29b-41d4-a716-446655440003","explanation":"Account risk too high","name":"CustomerAccountRule","result":"DECLINED"}],"tokenization_decline_reasons":["ACCOUNT_SCORE_1"],"tokenization_source":"PUSH_PROVISION","tokenization_tfa_reasons":["WALLET_RECOMMENDED_TFA"]}'; function makeHeaders() { const msgID = '1'; @@ -261,7 +261,7 @@ describe('resource webhooks', () => { const event = lithic.webhooks.parse(payload, { headers, secret }); expect(event).toBeDefined(); if ('event_type' in event) { - expect(event.event_type).toBe('account_holder.created'); + expect(event.event_type).toBe('digital_wallet.tokenization_approval_request'); } }); diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 05c0bde5..627b64a3 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,7 +1,6 @@ import fs from 'fs'; import type { ResponseLike } from 'lithic/internal/to-file'; import { toFile } from 'lithic/core/uploads'; -import { File } from 'node:buffer'; class MyClass { name: string = 'foo'; diff --git a/yarn.lock b/yarn.lock index 2dc54a9d..11490574 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,12 +12,12 @@ resolved "https://registry.yarnpkg.com/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz#ba9494f85eb83017c5c855763969caf1d0adea00" integrity sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw== -"@arethetypeswrong/cli@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@arethetypeswrong/cli/-/cli-0.17.0.tgz#f97f10926b3f9f9eb5117550242d2e06c25cadac" - integrity sha512-xSMW7bfzVWpYw5JFgZqBXqr6PdR0/REmn3DkxCES5N0JTcB0CVgbIynJCvKBFmXaPc3hzmmTrb7+yPDRoOSZdA== +"@arethetypeswrong/cli@^0.18.0": + version "0.18.4" + resolved "https://registry.yarnpkg.com/@arethetypeswrong/cli/-/cli-0.18.4.tgz#c31f54f3b0d0e0f3256ab3edb6530beeb5e64b4b" + integrity sha512-kNWo6LTzGAuLYPpJ7Sgo63whSUeeSuKMlYx6IBgzs4ONEG807gW4hSSENvpeCHzO2H2wIzG5EFl0OKBbqGBAyA== dependencies: - "@arethetypeswrong/core" "0.17.0" + "@arethetypeswrong/core" "0.18.4" chalk "^4.1.2" cli-table3 "^0.6.3" commander "^10.0.1" @@ -25,15 +25,16 @@ marked-terminal "^7.1.0" semver "^7.5.4" -"@arethetypeswrong/core@0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@arethetypeswrong/core/-/core-0.17.0.tgz#abb3b5f425056d37193644c2a2de4aecf866b76b" - integrity sha512-FHyhFizXNetigTVsIhqXKGYLpazPS5YNojEPpZEUcBPt9wVvoEbNIvG+hybuBR+pjlRcbyuqhukHZm1fr+bDgA== +"@arethetypeswrong/core@0.18.4": + version "0.18.4" + resolved "https://registry.yarnpkg.com/@arethetypeswrong/core/-/core-0.18.4.tgz#24edea3d651dea7d32bf6f1cc9ee9a00db39de49" + integrity sha512-M5F0ePyN6h2Z6XxRiyIPqjGbltotXLjR0CKA0uKspsDu0QmgTNYvRb4RSQPMUs2ZXZHCCYpbaZbFbYOXLxCjUA== dependencies: "@andrewbranch/untar.js" "^1.0.3" + "@loaderkit/resolve" "^1.0.2" cjs-module-lexer "^1.2.3" - fflate "^0.8.2" - lru-cache "^10.4.3" + fflate "^0.8.3" + lru-cache "^11.0.1" semver "^7.5.4" typescript "5.6.1-rc" validate-npm-package-name "^5.0.0" @@ -306,6 +307,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@braidai/lang@^1.0.0": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@braidai/lang/-/lang-1.1.2.tgz#65bc2bc1db6d00e153b95ac7006f4573e289e9be" + integrity sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA== + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -688,6 +694,13 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@loaderkit/resolve@^1.0.2": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@loaderkit/resolve/-/resolve-1.0.6.tgz#8d45341e688faecc25b3ae919c0f45d94c4e26c9" + integrity sha512-G8FdIoF5CypfwmD9rl8BXod5HDn8JqB0CCNBXDTaRZ+yRYhARrrSToX1zg1zy9jX3zLqigsELwhT4gNtkdQAUg== + dependencies: + "@braidai/lang" "^1.0.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -709,11 +722,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@pkgr/core@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.4.tgz#d897170a2b0ba51f78a099edccd968f7b103387c" - integrity sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw== - "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -1224,18 +1232,10 @@ baseline-browser-mapping@^2.9.0: resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== -brace-expansion@^1.1.7: - version "1.1.12" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" - integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" - integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== +brace-expansion@^2.0.2: + version "2.1.4" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.4.tgz#589dab11c0018d0366be64cd8bf12c8dbecc8326" + integrity sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg== dependencies: balanced-match "^1.0.0" @@ -1400,11 +1400,6 @@ commander@^10.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -1533,14 +1528,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-prettier@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz#99b55d7dd70047886b2222fdd853665f180b36af" - integrity sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg== - dependencies: - prettier-linter-helpers "^1.0.0" - synckit "^0.11.7" - eslint-plugin-unused-imports@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738" @@ -1692,11 +1679,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-diff@^1.1.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" - integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== - fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" @@ -1737,10 +1719,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fflate@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" - integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== +fflate@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.3.tgz#bc27d8eb30343d4d512abb03480202ce65d825fc" + integrity sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA== file-entry-cache@^8.0.0: version "8.0.0" @@ -2531,10 +2513,10 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lru-cache@^10.4.3: - version "10.4.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" - integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.1: + version "11.5.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.5.2.tgz#00e16665c90c620fba14a3c368732a976493f760" + integrity sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g== lru-cache@^5.1.1: version "5.1.1" @@ -2610,26 +2592,12 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2, minimatch@^5.0.1, minimatch@^9.0.4, minimatch@^9.0.5: + version "9.0.9" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.9.tgz#9b0cb9fcb78087f6fd7eababe2511c4d3d60574e" + integrity sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg== dependencies: - brace-expansion "^1.1.7" - -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^9.0.4: - version "9.0.5" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" - integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== - dependencies: - brace-expansion "^2.0.1" + brace-expansion "^2.0.2" minimist@^1.2.6: version "1.2.6" @@ -2878,13 +2846,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - prettier@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848" @@ -3189,13 +3150,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -synckit@^0.11.7: - version "0.11.8" - resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457" - integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A== - dependencies: - "@pkgr/core" "^0.2.4" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -3269,9 +3223,9 @@ ts-node@^10.5.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz": - version "1.1.9" - resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz#777f6f5d9e26bf0e94e5170990dd3a841d6707cd" +"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz": + version "1.1.11" + resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz#010247051be13b55abdc98f787c017285149f4f2" dependencies: debug "^4.3.7" fast-glob "^3.3.2"