diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 099626f4..4fcfdf7a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.8.0" + ".": "1.9.0" } diff --git a/.stats.yml b/.stats.yml index 6e11cc44..a7460e17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lightspark/grid-ac58b94d902a9952a9aa45bd589ca1664c914506f5b8beff15d7cec4ab24b234.yml -openapi_spec_hash: a835ba4e59a96140b2c0f5d7cd015c17 -config_hash: 39732ea707a8b7c065f7dd194a1d5c41 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lightspark/grid-cf9501da12ff42178d1b985ae45473af001d6c538c592e52a19783faf4be7a29.yml +openapi_spec_hash: 05bf1617daa561849b09b5db0160f524 +config_hash: b7a592c7be763c8f7c2aa40c1ca104f3 diff --git a/CHANGELOG.md b/CHANGELOG.md index d3d381cb..3a14c026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,68 @@ # Changelog +## 1.9.0 (2026-07-10) + +Full Changelog: [v1.8.0...v1.9.0](https://github.com/lightsparkdev/grid-js-sdk/compare/v1.8.0...v1.9.0) + +### Features + +* Add encrypted OTP flow ([948a93b](https://github.com/lightsparkdev/grid-js-sdk/commit/948a93b3665eab90f89e3cf4c6dc9bb53daa2daf)) +* **api:** add BANK_TRANSFER rail support to CNY accounts with accountNumber field ([d0e7b9a](https://github.com/lightsparkdev/grid-js-sdk/commit/d0e7b9a52cfbbe1d89bd75fafb2b7636d927092b)) +* **api:** add bankName field to GTQ/JMD external accounts ([5c5c59c](https://github.com/lightsparkdev/grid-js-sdk/commit/5c5c59cb883e2a54f5bce2d64e1773b70fce8a1e)) +* **api:** add businessInfo fields to customers, verification error enum values ([98f92ce](https://github.com/lightsparkdev/grid-js-sdk/commit/98f92ce828c3d6ffa969b0b15b24336141e87f14)) +* **api:** add card transaction type to transaction union responses ([5f7a560](https://github.com/lightsparkdev/grid-js-sdk/commit/5f7a56011f66c418a088c7a5b6f9243251cb92e8)) +* **api:** add CNY_ACCOUNT support to external accounts ([98235f5](https://github.com/lightsparkdev/grid-js-sdk/commit/98235f5f29738efd5cdea95bd09e17640e0aa680)) +* **api:** add CNY_ACCOUNT support to external accounts and payment instructions ([2a4c89d](https://github.com/lightsparkdev/grid-js-sdk/commit/2a4c89d2b685fc1ceb4601583f777d337951d549)) +* **api:** add contactVerification field to customer responses ([6798574](https://github.com/lightsparkdev/grid-js-sdk/commit/6798574dff4c5a4103d033507742995a6628f8ce)) +* **api:** add direction field to transaction responses ([8eea143](https://github.com/lightsparkdev/grid-js-sdk/commit/8eea143207cbeb94169091b15de46cf330710385)) +* **api:** add FAMILY_SUPPORT and SALARY_PAYMENT to quotes purpose field ([2a7f1a0](https://github.com/lightsparkdev/grid-js-sdk/commit/2a7f1a0c2af396917dcf265ffbef6f69408595ce)) +* **api:** add ID_TYPE and ID_NUMBER to CustomerInfoFieldName enum ([51b3b49](https://github.com/lightsparkdev/grid-js-sdk/commit/51b3b497f1333727a577df3f0d47a84255e8faf3)) +* **api:** add identifier and idType fields to customers create ([21e8cea](https://github.com/lightsparkdev/grid-js-sdk/commit/21e8cea7d288781bfdf73750b14be044def415ff)) +* **api:** add NEFT/RTGS rails, optional fields to INR external accounts ([306f1f1](https://github.com/lightsparkdev/grid-js-sdk/commit/306f1f19947e5570e08b293f76188b25e78077d4)) +* **api:** add payment rail enum values to transfer-out operations ([c4a11cd](https://github.com/lightsparkdev/grid-js-sdk/commit/c4a11cd83f81f5f9845b20ec5920d944b6216a62)) +* **api:** add PENDING_AUTH state to cards ([225d436](https://github.com/lightsparkdev/grid-js-sdk/commit/225d436a0923663cfe8e0152d5abdc0a12b160cc)) +* **api:** add phoneNumber field to customers create/update/response ([7c9470b](https://github.com/lightsparkdev/grid-js-sdk/commit/7c9470b6f7cc4cd65cea539a35d7ee18e19be5f6)) +* **api:** add processorRef field to cards ([83719ec](https://github.com/lightsparkdev/grid-js-sdk/commit/83719ecf4bd54561b2ee7455d94489529c345cb2)) +* **api:** add receiptDeliveryConfirmedAt to transaction responses ([c6d1dba](https://github.com/lightsparkdev/grid-js-sdk/commit/c6d1dbac640733dcef2e55d8f32276a26188439b)) +* **api:** add remittanceInformation param to transferOut and agents.me methods ([9bd9746](https://github.com/lightsparkdev/grid-js-sdk/commit/9bd97469002e0e489f2e632d220ba634bbd9cf24)) +* **api:** add remittanceInformation parameter and field to quotes ([a0586ce](https://github.com/lightsparkdev/grid-js-sdk/commit/a0586ceb10093e9148f702ba52cc1311414ba156)) +* **api:** add settlement timing and rail fields to outgoing transactions ([ee77680](https://github.com/lightsparkdev/grid-js-sdk/commit/ee7768062646ee28bbe364d07a2ec7c0826445c8)) +* **api:** add SMS_OTP credential type to auth credentials ([0b35a73](https://github.com/lightsparkdev/grid-js-sdk/commit/0b35a73ee1cccfa68a307aac4589d5a1b8f20684)) +* **api:** add SWIFT account type, update COP/EGP account requirements ([23edde7](https://github.com/lightsparkdev/grid-js-sdk/commit/23edde7b90e3eb32de909ed1731f336a2b17da3e)) +* **api:** add total field to exchange rate fees ([c0d40f5](https://github.com/lightsparkdev/grid-js-sdk/commit/c0d40f50492fe0ecaed30b394055e95625680441)) +* **api:** add totalBalance field to internal account responses ([1e47f85](https://github.com/lightsparkdev/grid-js-sdk/commit/1e47f85bdae0e87997f97922115a517bcc243e0b)) +* **api:** manual updates ([bcb7d4c](https://github.com/lightsparkdev/grid-js-sdk/commit/bcb7d4cee483d96684a55eb85144fe44f7449089)) +* **api:** manual updates ([605f969](https://github.com/lightsparkdev/grid-js-sdk/commit/605f96997736f07612b2cd89ea0c7d300ff17f2b)) +* **api:** manual updates ([96b093a](https://github.com/lightsparkdev/grid-js-sdk/commit/96b093a646dfed74e80872b04d3da5b6abbf61b0)) +* **api:** manual updates ([3e10796](https://github.com/lightsparkdev/grid-js-sdk/commit/3e10796ee5b6831ad5deeb95501cd1b48544e3c4)) +* **transfers:** allow selecting payment rail on transfer-out destination ([11e1ce3](https://github.com/lightsparkdev/grid-js-sdk/commit/11e1ce3d50faed7c148b472443e350a36206ae54)) +* **types:** add HOLD to kyc/kyb status, FAILED to internal account status ([b534c1d](https://github.com/lightsparkdev/grid-js-sdk/commit/b534c1d2ecfdc959d89323a746f4480eda573644)) + + +### Bug Fixes + +* **client:** send content-type header for requests with an omitted optional body ([4b556f3](https://github.com/lightsparkdev/grid-js-sdk/commit/4b556f3fde004614930a06b5c857c79ba7d5969a)) +* **types:** make address optional, countryOfResidence required in EUR beneficiary ([901d0c4](https://github.com/lightsparkdev/grid-js-sdk/commit/901d0c44e38fed524eb8d9da7bfdbce37ff4d759)) +* **types:** make bankName optional in sgd_account ([f51e638](https://github.com/lightsparkdev/grid-js-sdk/commit/f51e638c38665b3ac157a7484e02571898acdcab)) +* **types:** remove PENDING_AUTH state from cards model and list params ([df34d0f](https://github.com/lightsparkdev/grid-js-sdk/commit/df34d0ffec870c6bf53d7928c020723e74a85960)) +* **types:** rename PENDING_ISSUE to PROCESSING in cards state enum ([a295fca](https://github.com/lightsparkdev/grid-js-sdk/commit/a295fcabc28d49feae6cfa49c284219acf74f194)) +* **types:** require bankName field in BDT/COP/EGP/GHS/PKR external account types ([f9c3f11](https://github.com/lightsparkdev/grid-js-sdk/commit/f9c3f11a720b40d03e2b2ed4ad0bb23da7745bde)) + + +### Chores + +* **internal:** regenerate SDK with no functional changes ([857b039](https://github.com/lightsparkdev/grid-js-sdk/commit/857b0391e508b1ef6f51a0c458b241e6e263096f)) + + +### Documentation + +* **api:** add KYB requirements to verifications submit method ([8cac5e8](https://github.com/lightsparkdev/grid-js-sdk/commit/8cac5e8f3d2263b69324f0814a83cd7a9fb27907)) +* **api:** clarify otpEncryptionTargetBundle behavior in auth credentials EMAIL_OTP flow ([0695f3c](https://github.com/lightsparkdev/grid-js-sdk/commit/0695f3c3f7ba16e5d0e6fb982eec07e7731178d9)) +* **api:** clarify passkey challenge encoding in auth credentials ([fdecfc0](https://github.com/lightsparkdev/grid-js-sdk/commit/fdecfc0e410ec1316281c3092413bd8ea08b83b7)) +* **api:** update cards retrieve method and panEmbedUrl field docs ([c0d20b4](https://github.com/lightsparkdev/grid-js-sdk/commit/c0d20b41cc1b05d7efadddf65e4526158ea08e1a)) +* **internal:** remove C# examples and documentation ([b3ce136](https://github.com/lightsparkdev/grid-js-sdk/commit/b3ce136a2a58f4ddbafe7ee45787684adfc87553)) +* **types:** document passkey assertion in auth credentials ([4bbc90c](https://github.com/lightsparkdev/grid-js-sdk/commit/4bbc90c878b58f252944ebf592e37964bd60ef4f)) + ## 1.8.0 (2026-05-28) Full Changelog: [v1.7.1...v1.8.0](https://github.com/lightsparkdev/grid-js-sdk/compare/v1.7.1...v1.8.0) diff --git a/README.md b/README.md index 6e550dc9..fe3abd0e 100644 --- a/README.md +++ b/README.md @@ -229,13 +229,13 @@ List methods in the LightsparkGrid API are paginated. You can use the `for await … of` syntax to iterate through items across all pages: ```ts -async function fetchAllCustomerListResponses(params) { - const allCustomerListResponses = []; +async function fetchAllCustomerOneoves(params) { + const allCustomerOneoves = []; // Automatically fetches more pages as needed. - for await (const customerListResponse of client.customers.list()) { - allCustomerListResponses.push(customerListResponse); + for await (const customerOneOf of client.customers.list()) { + allCustomerOneoves.push(customerOneOf); } - return allCustomerListResponses; + return allCustomerOneoves; } ``` @@ -243,8 +243,8 @@ Alternatively, you can request a single page at a time: ```ts let page = await client.customers.list(); -for (const customerListResponse of page.data) { - console.log(customerListResponse); +for (const customerOneOf of page.data) { + console.log(customerOneOf); } // Convenience methods are provided for manually paginating: diff --git a/api.md b/api.md index afc1bdac..685eeca8 100644 --- a/api.md +++ b/api.md @@ -11,7 +11,6 @@ Types: - BrlExternalAccountCreateInfo - BulkCustomerImportErrorEntry - BusinessCustomer -- BusinessInfoUpdate - BwpBeneficiary - BwpExternalAccountCreateInfo - CadBeneficiary @@ -79,6 +78,7 @@ Types: - CustomerInfoFieldName - EmbeddedWalletConfig - PlatformConfig +- PlatformConfigUpdateRequest - PlatformCurrencyConfig Methods: @@ -90,23 +90,31 @@ Methods: Types: -- CustomerCreateResponse -- CustomerRetrieveResponse -- CustomerUpdateResponse +- BusinessCustomerCreateRequest +- BusinessCustomerUpdateRequest +- Customer +- CustomerCreateRequestOneOf - CustomerListResponse -- CustomerDeleteResponse -- CustomerExportResponse -- CustomerGenerateKYCLinkResponse - -Methods: - -- client.customers.create({ ...params }) -> CustomerCreateResponse -- client.customers.retrieve(customerID) -> CustomerRetrieveResponse -- client.customers.update(customerID, { ...params }) -> CustomerUpdateResponse -- client.customers.list({ ...params }) -> CustomerListResponsesDefaultPagination -- client.customers.delete(customerID) -> CustomerDeleteResponse -- client.customers.export(id, { ...params }) -> CustomerExportResponse -- client.customers.generateKYCLink(customerID, { ...params }) -> CustomerGenerateKYCLinkResponse +- CustomerOneOf +- CustomerUpdateRequestOneOf +- IndividualCustomerCreateRequest +- IndividualCustomerUpdateRequest +- InternalAccountExportRequest +- InternalAccountExportResponse +- InternalAccountListResponse +- InternalAccountUpdateRequest +- KYCLinkCreateRequest +- KYCLinkResponse + +Methods: + +- client.customers.create({ ...params }) -> CustomerOneOf +- client.customers.retrieve(customerID) -> CustomerOneOf +- client.customers.update(customerID, { ...params }) -> CustomerOneOf +- client.customers.list({ ...params }) -> CustomerOneovesDefaultPagination +- client.customers.delete(customerID) -> CustomerOneOf +- client.customers.createKYCLink(customerID, { ...params }) -> KYCLinkResponse +- client.customers.export(id, { ...params }) -> InternalAccountExportResponse - client.customers.listInternalAccounts({ ...params }) -> InternalAccountsDefaultPagination - client.customers.updateInternalAccount(id, { ...params }) -> InternalAccount @@ -132,6 +140,7 @@ Types: - ExternalAccount - ExternalAccountCreate - ExternalAccountInfoOneOf +- ExternalAccountListResponse - GbpBeneficiary - GbpExternalAccountInfo - GhsExternalAccountInfo @@ -198,11 +207,11 @@ Methods: Types: -- PlatformListInternalAccountsResponse +- PlatformInternalAccountListResponse Methods: -- client.platform.listInternalAccounts({ ...params }) -> PlatformListInternalAccountsResponse +- client.platform.listInternalAccounts({ ...params }) -> PlatformInternalAccountListResponse ## ExternalAccounts @@ -232,6 +241,7 @@ Types: - NgnAccountInfo - PhpAccountInfo - PkrAccountInfo +- PlatformExternalAccountCreateRequest - RwfAccountInfo - SgdAccountInfo - ThbAccountInfo @@ -259,6 +269,7 @@ Types: - ExternalAccountReference - InternalAccountReference - Transaction +- TransferInRequest Methods: @@ -266,6 +277,10 @@ Methods: # TransferOut +Types: + +- TransferOutRequest + Methods: - client.transferOut.create({ ...params }) -> Transaction @@ -275,14 +290,14 @@ Methods: Types: - CounterpartyFieldDefinition +- ExternalAccountLookupResponse - LookupResponse -- ReceiverLookupExternalAccountResponse -- ReceiverLookupUmaResponse +- UmaLookupResponse Methods: -- client.receiver.lookupExternalAccount(accountID, { ...params }) -> ReceiverLookupExternalAccountResponse -- client.receiver.lookupUma(receiverUmaAddress, { ...params }) -> ReceiverLookupUmaResponse +- client.receiver.lookupExternalAccount(accountID, { ...params }) -> ExternalAccountLookupResponse +- client.receiver.lookupUma(receiverUmaAddress, { ...params }) -> UmaLookupResponse # Quotes @@ -295,6 +310,7 @@ Types: - PaymentInstructions - Quote - QuoteDestinationOneOf +- QuoteRequest - QuoteSourceOneOf Methods: @@ -313,6 +329,7 @@ Types: - OutgoingTransaction - OutgoingTransactionStatus - ReconciliationInstructions +- TransactionListResponse - TransactionSourceOneOf - TransactionStatus - TransactionType @@ -330,6 +347,8 @@ Types: - CurrencyAmount - UmaInvitation +- UmaInvitationClaimRequest +- UmaInvitationCreateRequest Methods: @@ -340,12 +359,20 @@ Methods: # Sandbox +Types: + +- SendRequest + Methods: - client.sandbox.sendFunds({ ...params }) -> OutgoingTransaction ## Uma +Types: + +- ReceiveRequest + Methods: - client.sandbox.uma.receivePayment({ ...params }) -> IncomingTransaction @@ -354,6 +381,7 @@ Methods: Types: +- FundRequest - InternalAccount Methods: @@ -364,11 +392,12 @@ Methods: Types: -- WebhookSendTestResponse +- TestWebhookRequest +- TestWebhookResponse Methods: -- client.sandbox.webhooks.sendTest() -> WebhookSendTestResponse +- client.sandbox.webhooks.sendTest() -> TestWebhookResponse ## Cards @@ -376,36 +405,40 @@ Methods: Types: +- AuthorizationRequest - CardMerchant - CardPullSummary - CardRefundSummary - CardSettlementSummary -- SimulateAuthorizationResponse -- SimulateClearingResponse -- SimulateReturnResponse +- ClearingRequest +- Refund +- RefundRequest Methods: -- client.sandbox.cards.simulate.authorization(id, { ...params }) -> SimulateAuthorizationResponse -- client.sandbox.cards.simulate.clearing(id, { ...params }) -> SimulateClearingResponse -- client.sandbox.cards.simulate.return(id, { ...params }) -> SimulateReturnResponse +- client.sandbox.cards.simulate.authorization(id, { ...params }) -> CardTransaction +- client.sandbox.cards.simulate.clearing(id, { ...params }) -> CardTransaction +- client.sandbox.cards.simulate.return(id, { ...params }) -> CardTransaction # UmaProviders Types: +- UmaProvider - UmaProviderListResponse Methods: -- client.umaProviders.list({ ...params }) -> UmaProviderListResponsesDefaultPagination +- client.umaProviders.list({ ...params }) -> UmaProvidersDefaultPagination # Tokens Types: - APIToken +- APITokenCreateRequest - Permission +- TokenListResponse Methods: @@ -418,6 +451,7 @@ Methods: Types: +- ExchangeRate - ExchangeRateListResponse Methods: @@ -431,7 +465,6 @@ Types: - AgentActionWebhookEvent - IncomingPaymentWebhookEvent - OutgoingPaymentWebhookEvent -- TestWebhookWebhookEvent - BulkUploadWebhookEvent - InvitationClaimedWebhookEvent - CustomerUpdateWebhookEvent @@ -449,17 +482,21 @@ Methods: Types: -- CryptoEstimateWithdrawalFeeResponse +- EstimateCryptoWithdrawalFeeRequest +- EstimateCryptoWithdrawalFeeResponse Methods: -- client.crypto.estimateWithdrawalFee({ ...params }) -> CryptoEstimateWithdrawalFeeResponse +- client.crypto.estimateWithdrawalFee({ ...params }) -> EstimateCryptoWithdrawalFeeResponse # BeneficialOwners Types: +- BeneficialOwnerCreateRequest +- BeneficialOwnerListResponse - BeneficialOwnerPersonalInfo +- BeneficialOwnerUpdateRequest Methods: @@ -472,32 +509,30 @@ Methods: Types: -- DocumentRetrieveResponse +- Document - DocumentListResponse -- DocumentReplaceResponse -- DocumentUploadResponse Methods: -- client.documents.retrieve(documentID) -> DocumentRetrieveResponse -- client.documents.list({ ...params }) -> DocumentListResponsesDefaultPagination +- client.documents.retrieve(documentID) -> Document +- client.documents.list({ ...params }) -> DocumentsDefaultPagination - client.documents.delete(documentID) -> void -- client.documents.replace(documentID, { ...params }) -> DocumentReplaceResponse -- client.documents.upload({ ...params }) -> DocumentUploadResponse +- client.documents.replace(documentID, { ...params }) -> Document +- client.documents.upload({ ...params }) -> Document # Verifications Types: -- VerificationRetrieveResponse +- Verification - VerificationListResponse -- VerificationSubmitResponse +- VerificationRequest Methods: -- client.verifications.retrieve(verificationID) -> VerificationRetrieveResponse -- client.verifications.list({ ...params }) -> VerificationListResponsesDefaultPagination -- client.verifications.submit({ ...params }) -> VerificationSubmitResponse +- client.verifications.retrieve(verificationID) -> Verification +- client.verifications.list({ ...params }) -> VerificationsDefaultPagination +- client.verifications.submit({ ...params }) -> Verification # Discoveries @@ -515,6 +550,7 @@ Methods: Types: +- AuthCredentialChallengeRequest - AuthCredentialCreateRequest - AuthCredentialCreateRequestOneOf - AuthCredentialListResponse @@ -549,6 +585,7 @@ Methods: Types: +- AuthSessionRefreshRequest - SessionListResponse Methods: @@ -575,6 +612,7 @@ Types: - AgentDeviceCodeStatusResponse - AgentListResponse - AgentPolicy +- AgentPolicyUpdateRequest - AgentUpdateRequest - AgentUsage @@ -654,14 +692,15 @@ Methods: Types: -- CardRetrieveResponse -- CardUpdateResponse +- Card +- CardCreateRequest - CardListResponse -- CardIssueResponse +- CardTransaction +- CardUpdateRequest Methods: -- client.cards.retrieve(id) -> CardRetrieveResponse -- client.cards.update(id, { ...params }) -> CardUpdateResponse -- client.cards.list({ ...params }) -> CardListResponsesDefaultPagination -- client.cards.issue({ ...params }) -> CardIssueResponse +- client.cards.retrieve(id) -> Card +- client.cards.update(id, { ...params }) -> Card +- client.cards.list({ ...params }) -> CardsDefaultPagination +- client.cards.issue({ ...params }) -> Card diff --git a/jsr.json b/jsr.json index 0ee281a4..b6064153 100644 --- a/jsr.json +++ b/jsr.json @@ -1,8 +1,10 @@ { "name": "@lightsparkdev/grid", - "version": "1.8.0", + "version": "1.9.0", "exports": "./index.ts", "publish": { - "exclude": ["!."] + "exclude": [ + "!." + ] } } diff --git a/package.json b/package.json index 3b99cfc3..c86fc7d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lightsparkdev/grid", - "version": "1.8.0", + "version": "1.9.0", "description": "The official TypeScript library for the Lightspark Grid API", "author": "Lightspark Grid ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index f7831306..72931a9d 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -1,7 +1,7 @@ { "dxt_version": "0.2", "name": "@lightsparkdev/grid-mcp", - "version": "1.8.0", + "version": "1.9.0", "description": "The official MCP Server for the Lightspark Grid API", "author": { "name": "Lightspark Grid", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 78a19981..b2c3e1f4 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "@lightsparkdev/grid-mcp", - "version": "1.8.0", + "version": "1.9.0", "description": "The official MCP Server for the Lightspark Grid API", "author": "Lightspark Grid ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts index 12c0b5bf..dac6d7e7 100644 --- a/packages/mcp-server/src/code-tool-worker.ts +++ b/packages/mcp-server/src/code-tool-worker.ts @@ -111,9 +111,9 @@ const fuse = new Fuse( 'client.config.retrieve', 'client.config.update', 'client.customers.create', + 'client.customers.createKYCLink', 'client.customers.delete', 'client.customers.export', - 'client.customers.generateKYCLink', 'client.customers.list', 'client.customers.listInternalAccounts', 'client.customers.retrieve', diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index 122635db..7b271b7c 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -97,11 +97,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "config->retrieve();\n\nvar_dump($platformConfig);", }, - csharp: { - method: 'Config.Retrieve', - example: - 'ConfigRetrieveParams parameters = new();\n\nvar platformConfig = await client.Config.Retrieve(parameters);\n\nConsole.WriteLine(platformConfig);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/config \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -140,12 +135,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'config().update', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.config.ConfigUpdateParams\nimport com.lightspark.grid.models.config.PlatformConfig\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val platformConfig: PlatformConfig = client.config().update()\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.config.PlatformConfig\nimport com.lightspark.grid.models.config.PlatformConfigUpdateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: PlatformConfigUpdateRequest = PlatformConfigUpdateRequest.builder().build()\n val platformConfig: PlatformConfig = client.config().update(params)\n}', }, go: { method: 'client.Config.Update', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tplatformConfig, err := client.Config.Update(context.TODO(), grid.ConfigUpdateParams{\n\t\tEmbeddedWalletConfig: grid.EmbeddedWalletConfigParam{\n\t\t\tAppName: grid.String("Acme Wallet"),\n\t\t\tSendFromEmailAddress: grid.String("noreply@acme.com"),\n\t\t\tSendFromEmailSenderName: grid.String("Acme Notifications"),\n\t\t\tReplyToEmailAddress: grid.String("support@acme.com"),\n\t\t\tLogoURL: grid.String("https://acme.com/logo.png"),\n\t\t},\n\t\tSupportedCurrencies: []grid.PlatformCurrencyConfigParam{{\n\t\t\tCurrencyCode: "USD",\n\t\t\tMinAmount: 100,\n\t\t\tMaxAmount: 1000000,\n\t\t\tEnabledTransactionTypes: []grid.TransactionType{grid.TransactionTypeOutgoing, grid.TransactionTypeIncoming},\n\t\t\tRequiredCounterpartyFields: []grid.CounterpartyFieldDefinitionParam{{\n\t\t\t\tName: grid.CustomerInfoFieldNameFullName,\n\t\t\t\tMandatory: true,\n\t\t\t}, {\n\t\t\t\tName: grid.CustomerInfoFieldNameNationality,\n\t\t\t\tMandatory: true,\n\t\t\t}, {\n\t\t\t\tName: grid.CustomerInfoFieldNameBirthDate,\n\t\t\t\tMandatory: true,\n\t\t\t}},\n\t\t}},\n\t\tUmaDomain: grid.String("mycompany.com"),\n\t\tWebhookEndpoint: grid.String("https://api.mycompany.com/webhooks/uma"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", platformConfig.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tplatformConfig, err := client.Config.Update(context.TODO(), grid.ConfigUpdateParams{\n\t\tPlatformConfigUpdateRequest: grid.PlatformConfigUpdateRequestParam{},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", platformConfig.ID)\n}\n', }, ruby: { method: 'config.update', @@ -159,16 +154,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'config->update', example: - "config->update(\n embeddedWalletConfig: [\n 'alphanumeric' => false,\n 'appName' => 'Acme Wallet',\n 'expirationSeconds' => 300,\n 'logoURL' => 'https://acme.com/logo.png',\n 'otpLength' => 6,\n 'replyToEmailAddress' => 'support@acme.com',\n 'sendFromEmailAddress' => 'noreply@acme.com',\n 'sendFromEmailSenderName' => 'Acme Notifications',\n ],\n supportedCurrencies: [\n [\n 'currencyCode' => 'USD',\n 'enabledTransactionTypes' => [\n TransactionType::OUTGOING, TransactionType::INCOMING\n ],\n 'maxAmount' => 1000000,\n 'minAmount' => 100,\n 'requiredCounterpartyFields' => [\n ['mandatory' => true, 'name' => CustomerInfoFieldName::FULL_NAME],\n ['mandatory' => true, 'name' => CustomerInfoFieldName::NATIONALITY],\n ['mandatory' => true, 'name' => CustomerInfoFieldName::BIRTH_DATE],\n ],\n ],\n ],\n umaDomain: 'mycompany.com',\n webhookEndpoint: 'https://api.mycompany.com/webhooks/uma',\n);\n\nvar_dump($platformConfig);", - }, - csharp: { - method: 'Config.Update', - example: - 'ConfigUpdateParams parameters = new();\n\nvar platformConfig = await client.Config.Update(parameters);\n\nConsole.WriteLine(platformConfig);', + "config->update(\n embeddedWalletConfig: [\n 'alphanumeric' => false,\n 'appName' => 'Acme Wallet',\n 'expirationSeconds' => 300,\n 'logoURL' => 'https://acme.com/logo.png',\n 'otpLength' => 6,\n 'replyToEmailAddress' => 'support@acme.com',\n 'sendFromEmailAddress' => 'noreply@acme.com',\n 'sendFromEmailSenderName' => 'Acme Notifications',\n ],\n supportedCurrencies: [\n [\n 'currencyCode' => 'USD',\n 'enabledTransactionTypes' => [\n TransactionType::OUTGOING, TransactionType::INCOMING\n ],\n 'maxAmount' => 1000000,\n 'minAmount' => 100,\n 'requiredCounterpartyFields' => [\n ['mandatory' => true, 'name' => CustomerInfoFieldName::FULL_NAME],\n ['mandatory' => true, 'name' => CustomerInfoFieldName::BIRTH_DATE],\n ['mandatory' => true, 'name' => CustomerInfoFieldName::NATIONALITY],\n ],\n ],\n ],\n umaDomain: 'mycompany.com',\n webhookEndpoint: 'https://api.mycompany.com/webhooks/uma',\n);\n\nvar_dump($platformConfig);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/config \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "embeddedWalletConfig": {\n "appName": "Acme Wallet",\n "logoUrl": "https://acme.com/logo.png",\n "replyToEmailAddress": "support@acme.com",\n "sendFromEmailAddress": "noreply@acme.com",\n "sendFromEmailSenderName": "Acme Notifications"\n },\n "supportedCurrencies": [\n {\n "currencyCode": "USD",\n "enabledTransactionTypes": [\n "OUTGOING",\n "INCOMING"\n ],\n "maxAmount": 1000000,\n "minAmount": 100,\n "requiredCounterpartyFields": [\n {\n "mandatory": true,\n "name": "FULL_NAME"\n },\n {\n "mandatory": true,\n "name": "NATIONALITY"\n },\n {\n "mandatory": true,\n "name": "BIRTH_DATE"\n }\n ]\n }\n ],\n "umaDomain": "mycompany.com",\n "webhookEndpoint": "https://api.mycompany.com/webhooks/uma"\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/config \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "umaDomain": "mycompany.com",\n "webhookEndpoint": "https://api.mycompany.com/webhooks/uma"\n }\'', }, }, }, @@ -182,37 +172,37 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) customers > (method) create', qualified: 'client.customers.create', params: [ - "CreateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; platformCustomerId?: string; region?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; businessInfo?: { businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; incorporatedOn?: string; legalName?: string; purposeOfAccount?: string; registrationNumber?: string; sourceOfFunds?: string; taxId?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; platformCustomerId?: string; region?: string; umaAddress?: string; };", + "CreateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: object; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; identifier?: string; idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; nationality?: string; phoneNumber?: string; platformCustomerId?: string; region?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: object; businessInfo?: { incorporatedOn: string; legalName: string; taxId: string; businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedCounterpartyCountries?: string[]; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; naicsCode?: string; purposeOfAccount?: string; purposeOfAccountOtherDescription?: string; registrationNumber?: string; sourceOfFunds?: string; sourceOfFundsCategories?: object[]; sourceOfFundsOtherDescription?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; phoneNumber?: string; platformCustomerId?: string; region?: string; umaAddress?: string; };", ], response: - "{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }", + '{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }', markdown: - "## create\n\n`client.customers.create(CreateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: object; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; platformCustomerId?: string; region?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: object; businessInfo?: object; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; platformCustomerId?: string; region?: string; umaAddress?: string; }): object | object`\n\n**post** `/customers`\n\nRegister a new customer in the system with an account identifier and bank account information\n\n### Parameters\n\n- `CreateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; platformCustomerId?: string; region?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; businessInfo?: { businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; incorporatedOn?: string; legalName?: string; purposeOfAccount?: string; registrationNumber?: string; sourceOfFunds?: string; taxId?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; platformCustomerId?: string; region?: string; umaAddress?: string; }`\n\n### Returns\n\n- `{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customer = await client.customers.create({ CreateCustomerRequest: { customerType: 'INDIVIDUAL' } });\n\nconsole.log(customer);\n```", + "## create\n\n`client.customers.create(CreateCustomerRequest: object | object): customer | customer`\n\n**post** `/customers`\n\nRegister a new customer in the system with an account identifier and bank account information\n\n### Parameters\n\n- `CreateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: object; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; identifier?: string; idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; nationality?: string; phoneNumber?: string; platformCustomerId?: string; region?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: object; businessInfo?: { incorporatedOn: string; legalName: string; taxId: string; businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedCounterpartyCountries?: string[]; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; naicsCode?: string; purposeOfAccount?: string; purposeOfAccountOtherDescription?: string; registrationNumber?: string; sourceOfFunds?: string; sourceOfFundsCategories?: object[]; sourceOfFundsOtherDescription?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; phoneNumber?: string; platformCustomerId?: string; region?: string; umaAddress?: string; }`\n\n### Returns\n\n- `{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customerOneOf = await client.customers.create({ CreateCustomerRequest: { customerType: 'INDIVIDUAL' } });\n\nconsole.log(customerOneOf);\n```", perLanguage: { typescript: { method: 'client.customers.create', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.create({\n CreateCustomerRequest: { customerType: 'INDIVIDUAL' },\n});\n\nconsole.log(customer);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customerOneOf = await client.customers.create({\n CreateCustomerRequest: { customerType: 'INDIVIDUAL' },\n});\n\nconsole.log(customerOneOf);", }, python: { method: 'customers.create', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer = client.customers.create(\n create_customer_request={\n "customer_type": "INDIVIDUAL"\n },\n)\nprint(customer)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer_one_of = client.customers.create(\n create_customer_request={\n "customer_type": "INDIVIDUAL"\n },\n)\nprint(customer_one_of)', }, kotlin: { method: 'customers().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerCreateParams\nimport com.lightspark.grid.models.customers.CustomerCreateResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CustomerCreateParams.CreateCustomerRequest.Individual = CustomerCreateParams.CreateCustomerRequest.Individual.builder().build()\n val customer: CustomerCreateResponse = client.customers().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.BusinessCustomerCreateRequest\nimport com.lightspark.grid.models.customers.CustomerOneOf\nimport com.lightspark.grid.models.customers.IndividualCustomerCreateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: IndividualCustomerCreateRequest = IndividualCustomerCreateRequest.builder()\n .customerType(IndividualCustomerCreateRequest.CustomerType.INDIVIDUAL)\n .build()\n val customerOneOf: CustomerOneOf = client.customers().create(params)\n}', }, go: { method: 'client.Customers.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomer, err := client.Customers.New(context.TODO(), grid.CustomerNewParams{\n\t\tOfIndividual: &grid.CustomerNewParamsCreateCustomerRequestIndividual{},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", customer)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomerOneOf, err := client.Customers.New(context.TODO(), grid.CustomerNewParams{\n\t\tCreateCustomerRequest: grid.CustomerCreateRequestOneOfUnionParam{\n\t\t\tOfIndividual: &grid.IndividualCustomerCreateRequestParam{\n\t\t\t\tCustomerType: grid.IndividualCustomerCreateRequestCustomerTypeIndividual,\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", customerOneOf)\n}\n', }, ruby: { method: 'customers.create', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer = lightspark_grid.customers.create(create_customer_request: {customerType: :INDIVIDUAL})\n\nputs(customer)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer_one_of = lightspark_grid.customers.create(create_customer_request: {customerType: :INDIVIDUAL})\n\nputs(customer_one_of)', }, cli: { method: 'customers create', @@ -222,16 +212,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'customers->create', example: - "customers->create(\n createCustomerRequest: [\n 'customerType' => 'INDIVIDUAL',\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1990-01-15',\n 'currencies' => ['USD', 'USDC'],\n 'email' => 'john.doe@example.com',\n 'fullName' => 'Jane Smith',\n 'kycStatus' => 'APPROVED',\n 'nationality' => 'US',\n 'platformCustomerID' => 'ind-9f84e0c2',\n 'region' => 'US',\n 'umaAddress' => '$john.doe@uma.domain.com',\n ],\n);\n\nvar_dump($customer);", - }, - csharp: { - method: 'Customers.Create', - example: - 'CustomerCreateParams parameters = new()\n{\n CreateCustomerRequest = new Individual()\n {\n Address = new()\n {\n Country = "US",\n Line1 = "123 Main Street",\n PostalCode = "94105",\n City = "San Francisco",\n Line2 = "Apt 4B",\n State = "CA",\n },\n BirthDate = "1990-01-15",\n Currencies =\n [\n "USD", "USDC"\n ],\n Email = "john.doe@example.com",\n FullName = "Jane Smith",\n KycStatus = KycStatus.Approved,\n Nationality = "US",\n PlatformCustomerID = "ind-9f84e0c2",\n Region = "US",\n UmaAddress = "$john.doe@uma.domain.com",\n },\n};\n\nvar customer = await client.Customers.Create(parameters);\n\nConsole.WriteLine(customer);', + "customers->create(\n createCustomerRequest: [\n 'customerType' => 'INDIVIDUAL',\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1990-01-15',\n 'currencies' => ['USD', 'USDC'],\n 'email' => 'john.doe@example.com',\n 'fullName' => 'John Michael Doe',\n 'identifier' => '123-45-6789',\n 'idType' => 'SSN',\n 'kycStatus' => 'APPROVED',\n 'nationality' => 'US',\n 'phoneNumber' => '+14155551234',\n 'platformCustomerID' => '9f84e0c2a72c4fa',\n 'region' => 'US',\n 'umaAddress' => '$john.doe@uma.domain.com',\n ],\n);\n\nvar_dump($customerOneOf);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/customers \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "customerType": "INDIVIDUAL",\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105",\n "city": "San Francisco",\n "line2": "Apt 4B",\n "state": "CA"\n },\n "birthDate": "1990-01-15",\n "currencies": [\n "USD",\n "USDC"\n ],\n "email": "john.doe@example.com",\n "fullName": "Jane Smith",\n "kycStatus": "APPROVED",\n "nationality": "US",\n "platformCustomerId": "ind-9f84e0c2",\n "region": "US",\n "umaAddress": "$john.doe@uma.domain.com"\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/customers \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "customerType": "INDIVIDUAL",\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105",\n "city": "San Francisco",\n "line2": "Apt 4B",\n "state": "CA"\n },\n "birthDate": "1990-01-15",\n "currencies": [\n "USD",\n "USDC"\n ],\n "email": "john.doe@example.com",\n "fullName": "John Michael Doe",\n "identifier": "123-45-6789",\n "idType": "SSN",\n "kycStatus": "APPROVED",\n "nationality": "US",\n "phoneNumber": "+14155551234",\n "platformCustomerId": "9f84e0c2a72c4fa",\n "region": "US",\n "umaAddress": "$john.doe@uma.domain.com"\n }\'', }, }, }, @@ -259,14 +244,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'updatedBefore?: string;', ], response: - "{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }", + '{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }', markdown: - "## list\n\n`client.customers.list(createdAfter?: string, createdBefore?: string, currency?: string, cursor?: string, customerType?: 'INDIVIDUAL' | 'BUSINESS', isIncludingDeleted?: boolean, limit?: number, platformCustomerId?: string, region?: string, umaAddress?: string, updatedAfter?: string, updatedBefore?: string): object | object`\n\n**get** `/customers`\n\nRetrieve a list of customers with optional filtering parameters. Returns all customers that match\nthe specified filters. If no filters are provided, returns all customers (paginated).\n\n\n### Parameters\n\n- `createdAfter?: string`\n Filter customers created after this timestamp (inclusive)\n\n- `createdBefore?: string`\n Filter customers created before this timestamp (inclusive)\n\n- `currency?: string`\n Filter by currency code. Returns customers that have this currency in their enabled currencies list.\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerType?: 'INDIVIDUAL' | 'BUSINESS'`\n Filter by customer type\n\n- `isIncludingDeleted?: boolean`\n Whether to include deleted customers in the results. Default is false.\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `platformCustomerId?: string`\n Filter by platform-specific customer identifier\n\n- `region?: string`\n Filter by customer region (ISO 3166-1 alpha-2 country code)\n\n- `umaAddress?: string`\n Filter by uma address\n\n- `updatedAfter?: string`\n Filter customers updated after this timestamp (inclusive)\n\n- `updatedBefore?: string`\n Filter customers updated before this timestamp (inclusive)\n\n### Returns\n\n- `{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const customerListResponse of client.customers.list()) {\n console.log(customerListResponse);\n}\n```", + "## list\n\n`client.customers.list(createdAfter?: string, createdBefore?: string, currency?: string, cursor?: string, customerType?: 'INDIVIDUAL' | 'BUSINESS', isIncludingDeleted?: boolean, limit?: number, platformCustomerId?: string, region?: string, umaAddress?: string, updatedAfter?: string, updatedBefore?: string): customer | customer`\n\n**get** `/customers`\n\nRetrieve a list of customers with optional filtering parameters. Returns all customers that match\nthe specified filters. If no filters are provided, returns all customers (paginated).\n\n\n### Parameters\n\n- `createdAfter?: string`\n Filter customers created after this timestamp (inclusive)\n\n- `createdBefore?: string`\n Filter customers created before this timestamp (inclusive)\n\n- `currency?: string`\n Filter by currency code. Returns customers that have this currency in their enabled currencies list.\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerType?: 'INDIVIDUAL' | 'BUSINESS'`\n Filter by customer type\n\n- `isIncludingDeleted?: boolean`\n Whether to include deleted customers in the results. Default is false.\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `platformCustomerId?: string`\n Filter by platform-specific customer identifier\n\n- `region?: string`\n Filter by customer region (ISO 3166-1 alpha-2 country code)\n\n- `umaAddress?: string`\n Filter by uma address\n\n- `updatedAfter?: string`\n Filter customers updated after this timestamp (inclusive)\n\n- `updatedBefore?: string`\n Filter customers updated before this timestamp (inclusive)\n\n### Returns\n\n- `{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const customerOneOf of client.customers.list()) {\n console.log(customerOneOf);\n}\n```", perLanguage: { typescript: { method: 'client.customers.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const customerListResponse of client.customers.list()) {\n console.log(customerListResponse);\n}", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const customerOneOf of client.customers.list()) {\n console.log(customerOneOf);\n}", }, python: { method: 'customers.list', @@ -297,11 +282,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->list(\n createdAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n currency: 'currency',\n cursor: 'cursor',\n customerType: 'INDIVIDUAL',\n isIncludingDeleted: true,\n limit: 1,\n platformCustomerID: 'platformCustomerId',\n region: 'region',\n umaAddress: 'umaAddress',\n updatedAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n updatedBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Customers.List', - example: - 'CustomerListParams parameters = new();\n\nvar page = await client.Customers.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -318,34 +298,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.customers.retrieve', params: ['customerId: string;'], response: - "{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }", + '{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }', markdown: - "## retrieve\n\n`client.customers.retrieve(customerId: string): object | object`\n\n**get** `/customers/{customerId}`\n\nRetrieve a customer by their system-generated ID\n\n### Parameters\n\n- `customerId: string`\n\n### Returns\n\n- `{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customer = await client.customers.retrieve('customerId');\n\nconsole.log(customer);\n```", + "## retrieve\n\n`client.customers.retrieve(customerId: string): customer | customer`\n\n**get** `/customers/{customerId}`\n\nRetrieve a customer by their system-generated ID\n\n### Parameters\n\n- `customerId: string`\n\n### Returns\n\n- `{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customerOneOf = await client.customers.retrieve('customerId');\n\nconsole.log(customerOneOf);\n```", perLanguage: { typescript: { method: 'client.customers.retrieve', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.retrieve('customerId');\n\nconsole.log(customer);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customerOneOf = await client.customers.retrieve('customerId');\n\nconsole.log(customerOneOf);", }, python: { method: 'customers.retrieve', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer = client.customers.retrieve(\n "customerId",\n)\nprint(customer)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer_one_of = client.customers.retrieve(\n "customerId",\n)\nprint(customer_one_of)', }, kotlin: { method: 'customers().retrieve', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerRetrieveParams\nimport com.lightspark.grid.models.customers.CustomerRetrieveResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val customer: CustomerRetrieveResponse = client.customers().retrieve("customerId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerOneOf\nimport com.lightspark.grid.models.customers.CustomerRetrieveParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val customerOneOf: CustomerOneOf = client.customers().retrieve("customerId")\n}', }, go: { method: 'client.Customers.Get', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomer, err := client.Customers.Get(context.TODO(), "customerId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", customer)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomerOneOf, err := client.Customers.Get(context.TODO(), "customerId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", customerOneOf)\n}\n', }, ruby: { method: 'customers.retrieve', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer = lightspark_grid.customers.retrieve("customerId")\n\nputs(customer)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer_one_of = lightspark_grid.customers.retrieve("customerId")\n\nputs(customer_one_of)', }, cli: { method: 'customers retrieve', @@ -355,12 +335,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'customers->retrieve', example: - "customers->retrieve('customerId');\n\nvar_dump($customer);", - }, - csharp: { - method: 'Customers.Retrieve', - example: - 'CustomerRetrieveParams parameters = new() { CustomerID = "customerId" };\n\nvar customer = await client.Customers.Retrieve(parameters);\n\nConsole.WriteLine(customer);', + "customers->retrieve('customerId');\n\nvar_dump($customerOneOf);", }, http: { example: @@ -374,44 +349,44 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'patch', summary: 'Update customer by ID', description: - "Update a customer's metadata by their system-generated ID.\n\nMost customer updates complete synchronously and return `200` with the updated customer. If the request changes `email` for a customer that has one or more tied Embedded Wallet internal accounts with `EMAIL_OTP` credentials, the email change uses the two-step signed-retry flow so the customer's wallet session authorizes the authentication credential update. On the signed retry, Grid updates the customer email and every tied `EMAIL_OTP` credential across all tied Embedded Wallets as one logical operation. If any tied credential cannot be updated, the customer email is not changed.\n\nFor an Embedded Wallet email update:\n\n1. Call `PATCH /customers/{customerId}` with the full update body and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`. The pending challenge binds the submitted update fields and the set of tied Embedded Wallet email OTP credentials that must be updated.\n\n2. Use the session API keypair of a verified authentication credential on one of the customer's tied Embedded Wallets to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated customer.\n", + "Update a customer's metadata by their system-generated ID.\n\nMost customer updates complete synchronously and return `200` with the updated customer. If the request changes `email` for a customer that has one or more tied Embedded Wallet internal accounts with `EMAIL_OTP` credentials, or changes `phoneNumber` for a customer that has one or more tied Embedded Wallet internal accounts with `SMS_OTP` credentials, the contact update uses the two-step signed-retry flow so the customer's wallet session authorizes the authentication credential update. On the signed retry, Grid updates the customer contact field and every tied matching OTP credential across all tied Embedded Wallets as one logical operation. If any tied credential cannot be updated, the customer contact field is not changed.\n\nUpdate `email` and `phoneNumber` in separate PATCH calls. A request that includes both fields is rejected.\n\nFor an Embedded Wallet email or SMS auth phone update:\n\n1. Call `PATCH /customers/{customerId}` with the full update body and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`. The pending challenge binds the submitted update fields and the set of tied Embedded Wallet OTP credentials that must be updated.\n\n2. Use the session API keypair of a verified authentication credential on one of the customer's tied Embedded Wallets to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated customer.\n", stainlessPath: '(resource) customers > (method) update', qualified: 'client.customers.update', params: [ 'customerId: string;', - "UpdateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; businessInfo?: { businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; incorporatedOn?: string; legalName?: string; purposeOfAccount?: string; registrationNumber?: string; sourceOfFunds?: string; taxId?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; umaAddress?: string; };", + "UpdateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: object; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; nationality?: string; phoneNumber?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: object; businessInfo?: { businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedCounterpartyCountries?: string[]; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; incorporatedOn?: string; legalName?: string; naicsCode?: string; purposeOfAccount?: string; purposeOfAccountOtherDescription?: string; registrationNumber?: string; sourceOfFunds?: string; sourceOfFundsCategories?: string[]; sourceOfFundsOtherDescription?: string; taxId?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; phoneNumber?: string; umaAddress?: string; };", 'Grid-Wallet-Signature?: string;', 'Request-Id?: string;', ], response: - "{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }", + '{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }', markdown: - "## update\n\n`client.customers.update(customerId: string, UpdateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: object; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: object; businessInfo?: object; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; umaAddress?: string; }, Grid-Wallet-Signature?: string, Request-Id?: string): object | object`\n\n**patch** `/customers/{customerId}`\n\nUpdate a customer's metadata by their system-generated ID.\n\nMost customer updates complete synchronously and return `200` with the updated customer. If the request changes `email` for a customer that has one or more tied Embedded Wallet internal accounts with `EMAIL_OTP` credentials, the email change uses the two-step signed-retry flow so the customer's wallet session authorizes the authentication credential update. On the signed retry, Grid updates the customer email and every tied `EMAIL_OTP` credential across all tied Embedded Wallets as one logical operation. If any tied credential cannot be updated, the customer email is not changed.\n\nFor an Embedded Wallet email update:\n\n1. Call `PATCH /customers/{customerId}` with the full update body and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`. The pending challenge binds the submitted update fields and the set of tied Embedded Wallet email OTP credentials that must be updated.\n\n2. Use the session API keypair of a verified authentication credential on one of the customer's tied Embedded Wallets to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated customer.\n\n\n### Parameters\n\n- `customerId: string`\n\n- `UpdateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; businessInfo?: { businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; incorporatedOn?: string; legalName?: string; purposeOfAccount?: string; registrationNumber?: string; sourceOfFunds?: string; taxId?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; umaAddress?: string; }`\n Request body for `PATCH /customers/{customerId}`. When `email` changes for a customer with tied Embedded Wallet internal accounts, Grid updates the customer email and every tied `EMAIL_OTP` credential across all tied Embedded Wallets through the endpoint's signed-retry flow.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customer = await client.customers.update('customerId', { UpdateCustomerRequest: { customerType: 'INDIVIDUAL' } });\n\nconsole.log(customer);\n```", + "## update\n\n`client.customers.update(customerId: string, UpdateCustomerRequest: object | object, Grid-Wallet-Signature?: string, Request-Id?: string): customer | customer`\n\n**patch** `/customers/{customerId}`\n\nUpdate a customer's metadata by their system-generated ID.\n\nMost customer updates complete synchronously and return `200` with the updated customer. If the request changes `email` for a customer that has one or more tied Embedded Wallet internal accounts with `EMAIL_OTP` credentials, or changes `phoneNumber` for a customer that has one or more tied Embedded Wallet internal accounts with `SMS_OTP` credentials, the contact update uses the two-step signed-retry flow so the customer's wallet session authorizes the authentication credential update. On the signed retry, Grid updates the customer contact field and every tied matching OTP credential across all tied Embedded Wallets as one logical operation. If any tied credential cannot be updated, the customer contact field is not changed.\n\nUpdate `email` and `phoneNumber` in separate PATCH calls. A request that includes both fields is rejected.\n\nFor an Embedded Wallet email or SMS auth phone update:\n\n1. Call `PATCH /customers/{customerId}` with the full update body and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`. The pending challenge binds the submitted update fields and the set of tied Embedded Wallet OTP credentials that must be updated.\n\n2. Use the session API keypair of a verified authentication credential on one of the customer's tied Embedded Wallets to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated customer.\n\n\n### Parameters\n\n- `customerId: string`\n\n- `UpdateCustomerRequest: { customerType: 'INDIVIDUAL'; address?: object; birthDate?: string; currencies?: string[]; email?: string; fullName?: string; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; nationality?: string; phoneNumber?: string; umaAddress?: string; } | { customerType: 'BUSINESS'; address?: object; businessInfo?: { businessType?: string; countriesOfOperation?: string[]; country?: string; doingBusinessAs?: string; entityType?: string; expectedCounterpartyCountries?: string[]; expectedMonthlyTransactionCount?: 'COUNT_UNDER_10' | 'COUNT_10_TO_100' | 'COUNT_100_TO_500' | 'COUNT_500_TO_1000' | 'COUNT_OVER_1000'; expectedMonthlyTransactionVolume?: string; expectedRecipientJurisdictions?: string[]; incorporatedOn?: string; legalName?: string; naicsCode?: string; purposeOfAccount?: string; purposeOfAccountOtherDescription?: string; registrationNumber?: string; sourceOfFunds?: string; sourceOfFundsCategories?: string[]; sourceOfFundsOtherDescription?: string; taxId?: string; }; currencies?: string[]; email?: string; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; phoneNumber?: string; umaAddress?: string; }`\n Request body for `PATCH /customers/{customerId}`. When `email` changes for a customer with tied Embedded Wallet internal accounts, Grid updates the customer email and every tied `EMAIL_OTP` credential through the endpoint's signed-retry flow. When `phoneNumber` changes for a customer with tied Embedded Wallet internal accounts, Grid updates the customer phone number and every tied `SMS_OTP` credential through the same signed-retry flow. Update `email` and `phoneNumber` in separate PATCH calls.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customerOneOf = await client.customers.update('customerId', { UpdateCustomerRequest: { customerType: 'INDIVIDUAL' } });\n\nconsole.log(customerOneOf);\n```", perLanguage: { typescript: { method: 'client.customers.update', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.update('customerId', {\n UpdateCustomerRequest: { customerType: 'INDIVIDUAL' },\n});\n\nconsole.log(customer);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customerOneOf = await client.customers.update('customerId', {\n UpdateCustomerRequest: { customerType: 'INDIVIDUAL' },\n});\n\nconsole.log(customerOneOf);", }, python: { method: 'customers.update', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer = client.customers.update(\n customer_id="customerId",\n update_customer_request={\n "customer_type": "INDIVIDUAL"\n },\n)\nprint(customer)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer_one_of = client.customers.update(\n customer_id="customerId",\n update_customer_request={\n "customer_type": "INDIVIDUAL"\n },\n)\nprint(customer_one_of)', }, kotlin: { method: 'customers().update', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerUpdateParams\nimport com.lightspark.grid.models.customers.CustomerUpdateResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CustomerUpdateParams = CustomerUpdateParams.builder()\n .customerId("customerId")\n .updateCustomerRequest(CustomerUpdateParams.UpdateCustomerRequest.Individual.builder().build())\n .build()\n val customer: CustomerUpdateResponse = client.customers().update(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerOneOf\nimport com.lightspark.grid.models.customers.CustomerUpdateParams\nimport com.lightspark.grid.models.customers.IndividualCustomerUpdateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CustomerUpdateParams = CustomerUpdateParams.builder()\n .customerId("customerId")\n .updateCustomerRequest(IndividualCustomerUpdateRequest.builder()\n .customerType(IndividualCustomerUpdateRequest.CustomerType.INDIVIDUAL)\n .build())\n .build()\n val customerOneOf: CustomerOneOf = client.customers().update(params)\n}', }, go: { method: 'client.Customers.Update', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomer, err := client.Customers.Update(\n\t\tcontext.TODO(),\n\t\t"customerId",\n\t\tgrid.CustomerUpdateParams{\n\t\t\tOfIndividual: &grid.CustomerUpdateParamsUpdateCustomerRequestIndividual{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", customer)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomerOneOf, err := client.Customers.Update(\n\t\tcontext.TODO(),\n\t\t"customerId",\n\t\tgrid.CustomerUpdateParams{\n\t\t\tUpdateCustomerRequest: grid.CustomerUpdateRequestOneOfUnionParam{\n\t\t\t\tOfIndividual: &grid.IndividualCustomerUpdateRequestParam{\n\t\t\t\t\tCustomerType: grid.IndividualCustomerUpdateRequestCustomerTypeIndividual,\n\t\t\t\t},\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", customerOneOf)\n}\n', }, ruby: { method: 'customers.update', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer = lightspark_grid.customers.update("customerId", update_customer_request: {customerType: :INDIVIDUAL})\n\nputs(customer)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer_one_of = lightspark_grid.customers.update("customerId", update_customer_request: {customerType: :INDIVIDUAL})\n\nputs(customer_one_of)', }, cli: { method: 'customers update', @@ -421,16 +396,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'customers->update', example: - "customers->update(\n 'customerId',\n updateCustomerRequest: [\n 'customerType' => 'INDIVIDUAL',\n 'address' => [\n 'country' => 'US',\n 'line1' => '456 Market St',\n 'postalCode' => '94103',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1985-06-15',\n 'currencies' => ['USD', 'EUR', 'USDC'],\n 'email' => 'john.doe@example.com',\n 'fullName' => 'John Smith',\n 'kycStatus' => 'APPROVED',\n 'nationality' => 'US',\n 'umaAddress' => '$john.doe@uma.domain.com',\n ],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:019542f5-b3e7-1d02-0000-000000000010',\n);\n\nvar_dump($customer);", - }, - csharp: { - method: 'Customers.Update', - example: - 'CustomerUpdateParams parameters = new()\n{\n CustomerID = "customerId",\n UpdateCustomerRequest = new Individual()\n {\n Address = new()\n {\n Country = "US",\n Line1 = "456 Market St",\n PostalCode = "94103",\n City = "San Francisco",\n Line2 = "Apt 4B",\n State = "CA",\n },\n BirthDate = "1985-06-15",\n Currencies =\n [\n "USD", "EUR", "USDC"\n ],\n Email = "john.doe@example.com",\n FullName = "John Smith",\n KycStatus = KycStatus.Approved,\n Nationality = "US",\n UmaAddress = "$john.doe@uma.domain.com",\n },\n};\n\nvar customer = await client.Customers.Update(parameters);\n\nConsole.WriteLine(customer);', + "customers->update(\n 'customerId',\n updateCustomerRequest: [\n 'customerType' => 'INDIVIDUAL',\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1990-01-15',\n 'currencies' => ['USD', 'EUR', 'USDC'],\n 'email' => 'john.doe@example.com',\n 'fullName' => 'John Michael Doe',\n 'kycStatus' => 'APPROVED',\n 'nationality' => 'US',\n 'phoneNumber' => '+14155551234',\n 'umaAddress' => '$john.doe@uma.domain.com',\n ],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:019542f5-b3e7-1d02-0000-000000000010',\n);\n\nvar_dump($customerOneOf);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/customers/$CUSTOMER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "customerType": "INDIVIDUAL",\n "address": {\n "country": "US",\n "line1": "456 Market St",\n "postalCode": "94103",\n "city": "San Francisco",\n "line2": "Apt 4B",\n "state": "CA"\n },\n "birthDate": "1985-06-15",\n "currencies": [\n "USD",\n "EUR",\n "USDC"\n ],\n "email": "john.doe@example.com",\n "fullName": "John Smith",\n "kycStatus": "APPROVED",\n "nationality": "US",\n "umaAddress": "$john.doe@uma.domain.com"\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/customers/$CUSTOMER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "customerType": "INDIVIDUAL",\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105",\n "city": "San Francisco",\n "line2": "Apt 4B",\n "state": "CA"\n },\n "birthDate": "1990-01-15",\n "currencies": [\n "USD",\n "EUR",\n "USDC"\n ],\n "email": "john.doe@example.com",\n "fullName": "John Michael Doe",\n "kycStatus": "APPROVED",\n "nationality": "US",\n "phoneNumber": "+14155551234",\n "umaAddress": "$john.doe@uma.domain.com"\n }\'', }, }, }, @@ -444,34 +414,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.customers.delete', params: ['customerId: string;'], response: - "{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }", + '{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }', markdown: - "## delete\n\n`client.customers.delete(customerId: string): object | object`\n\n**delete** `/customers/{customerId}`\n\nDelete a customer by their system-generated ID\n\n### Parameters\n\n- `customerId: string`\n\n### Returns\n\n- `{ customerType: 'INDIVIDUAL'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; birthDate?: string; createdAt?: string; currencies?: string[]; email?: string; fullName?: string; isDeleted?: boolean; kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; nationality?: string; region?: string; updatedAt?: string; } | { customerType: 'BUSINESS'; platformCustomerId: string; umaAddress: string; id?: string; address?: object; beneficialOwners?: object[]; businessInfo?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customer = await client.customers.delete('customerId');\n\nconsole.log(customer);\n```", + "## delete\n\n`client.customers.delete(customerId: string): customer | customer`\n\n**delete** `/customers/{customerId}`\n\nDelete a customer by their system-generated ID\n\n### Parameters\n\n- `customerId: string`\n\n### Returns\n\n- `{ customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; } | { customerType: object; platformCustomerId: string; umaAddress: string; id?: string; contactVerification?: object; createdAt?: string; currencies?: string[]; email?: string; isDeleted?: boolean; phoneNumber?: string; region?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst customerOneOf = await client.customers.delete('customerId');\n\nconsole.log(customerOneOf);\n```", perLanguage: { typescript: { method: 'client.customers.delete', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customer = await client.customers.delete('customerId');\n\nconsole.log(customer);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst customerOneOf = await client.customers.delete('customerId');\n\nconsole.log(customerOneOf);", }, python: { method: 'customers.delete', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer = client.customers.delete(\n "customerId",\n)\nprint(customer)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncustomer_one_of = client.customers.delete(\n "customerId",\n)\nprint(customer_one_of)', }, kotlin: { method: 'customers().delete', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerDeleteParams\nimport com.lightspark.grid.models.customers.CustomerDeleteResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val customer: CustomerDeleteResponse = client.customers().delete("customerId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerDeleteParams\nimport com.lightspark.grid.models.customers.CustomerOneOf\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val customerOneOf: CustomerOneOf = client.customers().delete("customerId")\n}', }, go: { method: 'client.Customers.Delete', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomer, err := client.Customers.Delete(context.TODO(), "customerId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", customer)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcustomerOneOf, err := client.Customers.Delete(context.TODO(), "customerId")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", customerOneOf)\n}\n', }, ruby: { method: 'customers.delete', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer = lightspark_grid.customers.delete("customerId")\n\nputs(customer)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncustomer_one_of = lightspark_grid.customers.delete("customerId")\n\nputs(customer_one_of)', }, cli: { method: 'customers delete', @@ -481,12 +451,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'customers->delete', example: - "customers->delete('customerId');\n\nvar_dump($customer);", - }, - csharp: { - method: 'Customers.Delete', - example: - 'CustomerDeleteParams parameters = new() { CustomerID = "customerId" };\n\nvar customer = await client.Customers.Delete(parameters);\n\nConsole.WriteLine(customer);', + "customers->delete('customerId');\n\nvar_dump($customerOneOf);", }, http: { example: @@ -511,9 +476,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET';", ], response: - "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", + "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", markdown: - "## list_internal_accounts\n\n`client.customers.listInternalAccounts(currency?: string, cursor?: string, customerId?: string, limit?: number, type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**get** `/customers/internal-accounts`\n\nRetrieve a list of internal accounts with optional filtering parameters. Returns all\ninternal accounts that match the specified filters. If no filters are provided, returns all internal accounts\n(paginated).\n\nInternal accounts are created automatically when a customer is created based on the platform configuration.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by internal accounts associated with a specific customer\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for a customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for the platform-managed holding accounts.\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const internalAccount of client.customers.listInternalAccounts()) {\n console.log(internalAccount);\n}\n```", + "## list_internal_accounts\n\n`client.customers.listInternalAccounts(currency?: string, cursor?: string, customerId?: string, limit?: number, type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: currency_amount; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**get** `/customers/internal-accounts`\n\nRetrieve a list of internal accounts with optional filtering parameters. Returns all\ninternal accounts that match the specified filters. If no filters are provided, returns all internal accounts\n(paginated).\n\nInternal accounts are created automatically when a customer is created based on the platform configuration.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by internal accounts associated with a specific customer\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for a customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for the platform-managed holding accounts.\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'`\n - `totalBalance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const internalAccount of client.customers.listInternalAccounts()) {\n console.log(internalAccount);\n}\n```", perLanguage: { typescript: { method: 'client.customers.listInternalAccounts', @@ -550,11 +515,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->listInternalAccounts(\n currency: 'currency',\n cursor: 'cursor',\n customerID: 'customerId',\n limit: 1,\n type: 'INTERNAL_FIAT',\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Customers.ListInternalAccounts', - example: - 'CustomerListInternalAccountsParams parameters = new();\n\nvar page = await client.Customers.ListInternalAccounts(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers/internal-accounts \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -578,32 +538,32 @@ const EMBEDDED_METHODS: MethodEntry[] = [ ], response: '{ id: string; encryptedWalletCredentials: string; }', markdown: - "## export\n\n`client.customers.export(id: string, clientPublicKey: string, Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; encryptedWalletCredentials: string; }`\n\n**post** `/internal-accounts/{id}/export`\n\nExport the wallet credentials of an Embedded Wallet internal account. The returned wallet credentials are HPKE-encrypted to the `clientPublicKey` supplied in the request body.\n\nExport is a two-step signed-retry flow (same pattern as add-additional credential, revoke credential, and revoke session):\n\n1. Call `POST /internal-accounts/{id}/export` with the request body `{ \"clientPublicKey\": \"...\" }` and no signature headers. Grid binds the `clientPublicKey` into the `payloadToSign` it returns, so the subsequent stamp in `Grid-Wallet-Signature` commits to the target encryption key. The response is `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of a verified authentication credential on the same internal account to build an API-key stamp over `payloadToSign`, then retry with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the **same** `clientPublicKey` submitted in step 1 — Grid rejects the retry with `401` if it disagrees with what was bound into `payloadToSign`. The signed retry returns `200` with `encryptedWalletCredentials`, which the client decrypts with the matching private key.\n\nThe `clientPublicKey` is ephemeral: generate a fresh P-256 keypair for this export and discard the private key after decrypting. Do not reuse the keypair from any prior verify call — that private key was already discarded after decrypting the session signing key it was issued against.\n\n\n### Parameters\n\n- `id: string`\n\n- `clientPublicKey: string`\n Fresh P-256 public key, uncompressed SEC1 hex — 130 hex chars where the first two are `04` (the uncompressed-point indicator). Generate a new keypair for each export and discard the private key after decrypting the response.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; encryptedWalletCredentials: string; }`\n\n - `id: string`\n - `encryptedWalletCredentials: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.customers.export('id', { clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2' });\n\nconsole.log(response);\n```", + "## export\n\n`client.customers.export(id: string, clientPublicKey: string, Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; encryptedWalletCredentials: string; }`\n\n**post** `/internal-accounts/{id}/export`\n\nExport the wallet credentials of an Embedded Wallet internal account. The returned wallet credentials are HPKE-encrypted to the `clientPublicKey` supplied in the request body.\n\nExport is a two-step signed-retry flow (same pattern as add-additional credential, revoke credential, and revoke session):\n\n1. Call `POST /internal-accounts/{id}/export` with the request body `{ \"clientPublicKey\": \"...\" }` and no signature headers. Grid binds the `clientPublicKey` into the `payloadToSign` it returns, so the subsequent stamp in `Grid-Wallet-Signature` commits to the target encryption key. The response is `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of a verified authentication credential on the same internal account to build an API-key stamp over `payloadToSign`, then retry with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the **same** `clientPublicKey` submitted in step 1 — Grid rejects the retry with `401` if it disagrees with what was bound into `payloadToSign`. The signed retry returns `200` with `encryptedWalletCredentials`, which the client decrypts with the matching private key.\n\nThe `clientPublicKey` is ephemeral: generate a fresh P-256 keypair for this export and discard the private key after decrypting. Do not reuse the keypair from any prior verify call — that private key was already discarded after decrypting the session signing key it was issued against.\n\n\n### Parameters\n\n- `id: string`\n\n- `clientPublicKey: string`\n Fresh P-256 public key, uncompressed SEC1 hex — 130 hex chars where the first two are `04` (the uncompressed-point indicator). Generate a new keypair for each export and discard the private key after decrypting the response.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; encryptedWalletCredentials: string; }`\n\n - `id: string`\n - `encryptedWalletCredentials: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst internalAccountExportResponse = await client.customers.export('id', { clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2' });\n\nconsole.log(internalAccountExportResponse);\n```", perLanguage: { typescript: { method: 'client.customers.export', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.customers.export('id', {\n clientPublicKey:\n '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n});\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst internalAccountExportResponse = await client.customers.export('id', {\n clientPublicKey:\n '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n});\n\nconsole.log(internalAccountExportResponse.id);", }, python: { method: 'customers.export', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.customers.export(\n id="id",\n client_public_key="04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ninternal_account_export_response = client.customers.export(\n id="id",\n client_public_key="04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n)\nprint(internal_account_export_response.id)', }, kotlin: { method: 'customers().export', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerExportParams\nimport com.lightspark.grid.models.customers.CustomerExportResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CustomerExportParams = CustomerExportParams.builder()\n .id("id")\n .clientPublicKey("04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2")\n .build()\n val response: CustomerExportResponse = client.customers().export(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerExportParams\nimport com.lightspark.grid.models.customers.InternalAccountExportRequest\nimport com.lightspark.grid.models.customers.InternalAccountExportResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CustomerExportParams = CustomerExportParams.builder()\n .id("id")\n .internalAccountExportRequest(InternalAccountExportRequest.builder()\n .clientPublicKey("04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2")\n .build())\n .build()\n val internalAccountExportResponse: InternalAccountExportResponse = client.customers().export(params)\n}', }, go: { method: 'client.Customers.Export', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Customers.Export(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.CustomerExportParams{\n\t\t\tClientPublicKey: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tinternalAccountExportResponse, err := client.Customers.Export(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.CustomerExportParams{\n\t\t\tInternalAccountExportRequest: grid.InternalAccountExportRequestParam{\n\t\t\t\tClientPublicKey: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\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", internalAccountExportResponse.ID)\n}\n', }, ruby: { method: 'customers.export', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.customers.export(\n "id",\n client_public_key: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2"\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ninternal_account_export_response = lightspark_grid.customers.export(\n "id",\n client_public_key: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2"\n)\n\nputs(internal_account_export_response)', }, cli: { method: 'customers export', @@ -613,12 +573,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'customers->export', example: - "customers->export(\n 'id',\n clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Customers.Export', - example: - 'CustomerExportParams parameters = new()\n{\n ID = "id",\n ClientPublicKey = "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n};\n\nvar response = await client.Customers.Export(parameters);\n\nConsole.WriteLine(response);', + "customers->export(\n 'id',\n clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($internalAccountExportResponse);", }, http: { example: @@ -637,54 +592,49 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.customers.updateInternalAccount', params: [ 'id: string;', - 'privateEnabled?: boolean;', + 'InternalAccountUpdateRequest: { privateEnabled?: boolean; };', 'Grid-Wallet-Signature?: string;', 'Request-Id?: string;', ], response: - "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", + "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", markdown: - "## update_internal_account\n\n`client.customers.updateInternalAccount(id: string, privateEnabled?: boolean, Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**patch** `/internal-accounts/{id}`\n\nUpdate mutable fields on an internal account. Today this supports updating the wallet privacy setting for an Embedded Wallet internal account.\n\nUpdating wallet privacy is a two-step signed-retry flow:\n\n1. Call `PATCH /internal-accounts/{id}` with the request body `{ \"privateEnabled\": true }` and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of a verified authentication credential on the same internal account to build an API-key stamp over `payloadToSign`, then retry with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated internal account.\n\n\n### Parameters\n\n- `id: string`\n\n- `privateEnabled?: boolean`\n Whether wallet privacy should be enabled for the Embedded Wallet.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst internalAccount = await client.customers.updateInternalAccount('InternalAccount:019542f5-b3e7-1d02-0000-000000000002');\n\nconsole.log(internalAccount);\n```", + "## update_internal_account\n\n`client.customers.updateInternalAccount(id: string, InternalAccountUpdateRequest: { privateEnabled?: boolean; }, Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: currency_amount; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**patch** `/internal-accounts/{id}`\n\nUpdate mutable fields on an internal account. Today this supports updating the wallet privacy setting for an Embedded Wallet internal account.\n\nUpdating wallet privacy is a two-step signed-retry flow:\n\n1. Call `PATCH /internal-accounts/{id}` with the request body `{ \"privateEnabled\": true }` and no signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of a verified authentication credential on the same internal account to build an API-key stamp over `payloadToSign`, then retry with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The retry body must carry the same update fields submitted in step 1. The signed retry returns `200` with the updated internal account.\n\n\n### Parameters\n\n- `id: string`\n\n- `InternalAccountUpdateRequest: { privateEnabled?: boolean; }`\n Partial request body for `PATCH /internal-accounts/{id}`. At least one update field must be provided. On step 1 of the signed-retry flow Grid binds the submitted update fields into `payloadToSign`; on step 2 the client echoes the same fields back and Grid applies the update to the internal account.\n - `privateEnabled?: boolean`\n Whether wallet privacy should be enabled for the Embedded Wallet.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'`\n - `totalBalance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst internalAccount = await client.customers.updateInternalAccount('InternalAccount:019542f5-b3e7-1d02-0000-000000000002', { InternalAccountUpdateRequest: {} });\n\nconsole.log(internalAccount);\n```", perLanguage: { typescript: { method: 'client.customers.updateInternalAccount', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst internalAccount = await client.customers.updateInternalAccount(\n 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n { privateEnabled: true },\n);\n\nconsole.log(internalAccount.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst internalAccount = await client.customers.updateInternalAccount(\n 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n { InternalAccountUpdateRequest: {} },\n);\n\nconsole.log(internalAccount.id);", }, python: { method: 'customers.update_internal_account', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ninternal_account = client.customers.update_internal_account(\n id="InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n private_enabled=True,\n)\nprint(internal_account.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ninternal_account = client.customers.update_internal_account(\n id="InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n internal_account_update_request={},\n)\nprint(internal_account.id)', }, kotlin: { method: 'customers().updateInternalAccount', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerUpdateInternalAccountParams\nimport com.lightspark.grid.models.sandbox.internalaccounts.InternalAccount\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val internalAccount: InternalAccount = client.customers().updateInternalAccount("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerUpdateInternalAccountParams\nimport com.lightspark.grid.models.customers.InternalAccountUpdateRequest\nimport com.lightspark.grid.models.sandbox.internalaccounts.InternalAccount\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CustomerUpdateInternalAccountParams = CustomerUpdateInternalAccountParams.builder()\n .id("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n .internalAccountUpdateRequest(InternalAccountUpdateRequest.builder().build())\n .build()\n val internalAccount: InternalAccount = client.customers().updateInternalAccount(params)\n}', }, go: { method: 'client.Customers.UpdateInternalAccount', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tinternalAccount, err := client.Customers.UpdateInternalAccount(\n\t\tcontext.TODO(),\n\t\t"InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n\t\tgrid.CustomerUpdateInternalAccountParams{\n\t\t\tPrivateEnabled: grid.Bool(true),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", internalAccount.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tinternalAccount, err := client.Customers.UpdateInternalAccount(\n\t\tcontext.TODO(),\n\t\t"InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n\t\tgrid.CustomerUpdateInternalAccountParams{\n\t\t\tInternalAccountUpdateRequest: grid.InternalAccountUpdateRequestParam{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", internalAccount.ID)\n}\n', }, ruby: { method: 'customers.update_internal_account', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ninternal_account = lightspark_grid.customers.update_internal_account("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n\nputs(internal_account)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ninternal_account = lightspark_grid.customers.update_internal_account(\n "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n internal_account_update_request: {}\n)\n\nputs(internal_account)', }, cli: { method: 'customers update_internal_account', example: - "grid customers update-internal-account \\\n --username 'My Username' \\\n --password 'My Password' \\\n --id InternalAccount:019542f5-b3e7-1d02-0000-000000000002", + "grid customers update-internal-account \\\n --username 'My Username' \\\n --password 'My Password' \\\n --id InternalAccount:019542f5-b3e7-1d02-0000-000000000002 \\\n --internal-account-update-request '{}'", }, php: { method: 'customers->updateInternalAccount', example: - "customers->updateInternalAccount(\n 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n privateEnabled: true,\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:019542f5-b3e7-1d02-0000-000000000010',\n);\n\nvar_dump($internalAccount);", - }, - csharp: { - method: 'Customers.UpdateInternalAccount', - example: - 'CustomerUpdateInternalAccountParams parameters = new()\n{\n ID = "InternalAccount:019542f5-b3e7-1d02-0000-000000000002"\n};\n\nvar internalAccount = await client.Customers.UpdateInternalAccount(parameters);\n\nConsole.WriteLine(internalAccount);', + "customers->updateInternalAccount(\n 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n internalAccountUpdateRequest: ['privateEnabled' => true],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:019542f5-b3e7-1d02-0000-000000000010',\n);\n\nvar_dump($internalAccount);", }, http: { example: @@ -693,58 +643,57 @@ const EMBEDDED_METHODS: MethodEntry[] = [ }, }, { - name: 'generate_kyc_link', + name: 'create_kyc_link', endpoint: '/customers/{customerId}/kyc-link', httpMethod: 'post', summary: 'Generate a hosted KYC link for an existing customer', description: "Generate a single-use hosted URL the customer can complete to verify their identity, and (where supported) a provider-specific `token` for embedding the verification flow directly via the provider's SDK.\n\nThe customer must already exist — create them with `POST /customers` first. Calling this endpoint does not change the customer's `kycStatus`; the customer remains `PENDING` until they complete (or fail) the hosted flow.\n\nEach call returns a fresh link. Previously-issued links are not invalidated, but they remain single-use and will expire on their own. For request-level retry safety, include an `Idempotency-Key` header.\n", - stainlessPath: '(resource) customers > (method) generate_kyc_link', - qualified: 'client.customers.generateKYCLink', - params: ['customerId: string;', 'redirectUri?: string;', 'Idempotency-Key?: string;'], + stainlessPath: '(resource) customers > (method) create_kyc_link', + qualified: 'client.customers.createKYCLink', + params: [ + 'customerId: string;', + 'KycLinkCreateRequest?: { redirectUri?: string; };', + 'Idempotency-Key?: string;', + ], response: "{ expiresAt: string; kycUrl: string; provider: 'SUMSUB'; token?: string; }", markdown: - "## generate_kyc_link\n\n`client.customers.generateKYCLink(customerId: string, redirectUri?: string, Idempotency-Key?: string): { expiresAt: string; kycUrl: string; provider: 'SUMSUB'; token?: string; }`\n\n**post** `/customers/{customerId}/kyc-link`\n\nGenerate a single-use hosted URL the customer can complete to verify their identity, and (where supported) a provider-specific `token` for embedding the verification flow directly via the provider's SDK.\n\nThe customer must already exist — create them with `POST /customers` first. Calling this endpoint does not change the customer's `kycStatus`; the customer remains `PENDING` until they complete (or fail) the hosted flow.\n\nEach call returns a fresh link. Previously-issued links are not invalidated, but they remain single-use and will expire on their own. For request-level retry safety, include an `Idempotency-Key` header.\n\n\n### Parameters\n\n- `customerId: string`\n\n- `redirectUri?: string`\n URI the customer is redirected to after completing the hosted KYC flow. Must start with `https://` (or `http://` for local development). Embedded in the returned `kycUrl`.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ expiresAt: string; kycUrl: string; provider: 'SUMSUB'; token?: string; }`\n A hosted KYC link that the customer can complete to verify their identity.\n\n - `expiresAt: string`\n - `kycUrl: string`\n - `provider: 'SUMSUB'`\n - `token?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.customers.generateKYCLink('customerId');\n\nconsole.log(response);\n```", + "## create_kyc_link\n\n`client.customers.createKYCLink(customerId: string, KycLinkCreateRequest?: { redirectUri?: string; }, Idempotency-Key?: string): { expiresAt: string; kycUrl: string; provider: 'SUMSUB'; token?: string; }`\n\n**post** `/customers/{customerId}/kyc-link`\n\nGenerate a single-use hosted URL the customer can complete to verify their identity, and (where supported) a provider-specific `token` for embedding the verification flow directly via the provider's SDK.\n\nThe customer must already exist — create them with `POST /customers` first. Calling this endpoint does not change the customer's `kycStatus`; the customer remains `PENDING` until they complete (or fail) the hosted flow.\n\nEach call returns a fresh link. Previously-issued links are not invalidated, but they remain single-use and will expire on their own. For request-level retry safety, include an `Idempotency-Key` header.\n\n\n### Parameters\n\n- `customerId: string`\n\n- `KycLinkCreateRequest?: { redirectUri?: string; }`\n Request body for generating a hosted KYC link for an existing customer.\n - `redirectUri?: string`\n URI the customer is redirected to after completing the hosted KYC flow. Must start with `https://` (or `http://` for local development). Embedded in the returned `kycUrl`.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ expiresAt: string; kycUrl: string; provider: 'SUMSUB'; token?: string; }`\n A hosted KYC link that the customer can complete to verify their identity.\n\n - `expiresAt: string`\n - `kycUrl: string`\n - `provider: 'SUMSUB'`\n - `token?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst kycLinkResponse = await client.customers.createKYCLink('customerId');\n\nconsole.log(kycLinkResponse);\n```", perLanguage: { typescript: { - method: 'client.customers.generateKYCLink', + method: 'client.customers.createKYCLink', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.customers.generateKYCLink('customerId');\n\nconsole.log(response.provider);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst kycLinkResponse = await client.customers.createKYCLink('customerId');\n\nconsole.log(kycLinkResponse.provider);", }, python: { - method: 'customers.generate_kyc_link', + method: 'customers.create_kyc_link', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.customers.generate_kyc_link(\n customer_id="customerId",\n)\nprint(response.provider)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nkyc_link_response = client.customers.create_kyc_link(\n customer_id="customerId",\n)\nprint(kyc_link_response.provider)', }, kotlin: { - method: 'customers().generateKycLink', + method: 'customers().createKycLink', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerGenerateKycLinkParams\nimport com.lightspark.grid.models.customers.CustomerGenerateKycLinkResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val response: CustomerGenerateKycLinkResponse = client.customers().generateKycLink("customerId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.customers.CustomerCreateKycLinkParams\nimport com.lightspark.grid.models.customers.KycLinkResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val kycLinkResponse: KycLinkResponse = client.customers().createKycLink("customerId")\n}', }, go: { - method: 'client.Customers.GenerateKYCLink', + method: 'client.Customers.NewKYCLink', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Customers.GenerateKYCLink(\n\t\tcontext.TODO(),\n\t\t"customerId",\n\t\tgrid.CustomerGenerateKYCLinkParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Provider)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tkycLinkResponse, err := client.Customers.NewKYCLink(\n\t\tcontext.TODO(),\n\t\t"customerId",\n\t\tgrid.CustomerNewKYCLinkParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", kycLinkResponse.Provider)\n}\n', }, ruby: { - method: 'customers.generate_kyc_link', + method: 'customers.create_kyc_link', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.customers.generate_kyc_link("customerId")\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nkyc_link_response = lightspark_grid.customers.create_kyc_link("customerId")\n\nputs(kyc_link_response)', }, cli: { - method: 'customers generate_kyc_link', + method: 'customers create_kyc_link', example: - "grid customers generate-kyc-link \\\n --username 'My Username' \\\n --password 'My Password' \\\n --customer-id customerId", + "grid customers create-kyc-link \\\n --username 'My Username' \\\n --password 'My Password' \\\n --customer-id customerId", }, php: { - method: 'customers->generateKYCLink', - example: - "customers->generateKYCLink(\n 'customerId',\n redirectUri: 'https://app.example.com/onboarding/completed',\n idempotencyKey: '',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Customers.GenerateKycLink', + method: 'customers->createKYCLink', example: - 'CustomerGenerateKycLinkParams parameters = new() { CustomerID = "customerId" };\n\nvar response = await client.Customers.GenerateKycLink(parameters);\n\nConsole.WriteLine(response);', + "customers->createKYCLink(\n 'customerId',\n kycLinkCreateRequest: [\n 'redirectUri' => 'https://app.example.com/onboarding/completed'\n ],\n idempotencyKey: '',\n);\n\nvar_dump($kycLinkResponse);", }, http: { example: @@ -763,9 +712,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.customers.externalAccounts.list', params: ['currency?: string;', 'cursor?: string;', 'customerId?: string;', 'limit?: number;'], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## list\n\n`client.customers.externalAccounts.list(currency?: string, cursor?: string, customerId?: string, limit?: number): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/customers/external-accounts`\n\nRetrieve a list of external accounts with optional filtering parameters. Returns all\nexternal accounts that match the specified filters. If no filters are provided, returns all external accounts\n(paginated).\n\nExternal accounts are bank accounts, cryptocurrency wallets, or other payment destinations that customers can use to receive funds from the platform.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by external accounts associated with a specific customer\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const externalAccount of client.customers.externalAccounts.list()) {\n console.log(externalAccount);\n}\n```", + "## list\n\n`client.customers.externalAccounts.list(currency?: string, cursor?: string, customerId?: string, limit?: number): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/customers/external-accounts`\n\nRetrieve a list of external accounts with optional filtering parameters. Returns all\nexternal accounts that match the specified filters. If no filters are provided, returns all external accounts\n(paginated).\n\nExternal accounts are bank accounts, cryptocurrency wallets, or other payment destinations that customers can use to receive funds from the platform.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by external accounts associated with a specific customer\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const externalAccount of client.customers.externalAccounts.list()) {\n console.log(externalAccount);\n}\n```", perLanguage: { typescript: { method: 'client.customers.externalAccounts.list', @@ -802,11 +751,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->externalAccounts->list(\n currency: 'currency', cursor: 'cursor', customerID: 'customerId', limit: 1\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Customers.ExternalAccounts.List', - example: - 'ExternalAccountListParams parameters = new();\n\nvar page = await client.Customers.ExternalAccounts.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers/external-accounts \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -822,16 +766,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) customers.external_accounts > (method) create', qualified: 'client.customers.externalAccounts.create', params: [ - "accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; };", + "accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: object; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; address?: address; birthDate?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; };", 'currency: string;', 'customerId?: string;', 'defaultUmaDepositAccount?: boolean;', 'platformAccountId?: string;', ], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## create\n\n`client.customers.externalAccounts.create(accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: aed_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: bdt_beneficiary | business_beneficiary; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: brl_beneficiary | business_beneficiary; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: bwp_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: cad_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: cop_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: dkk_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: egp_beneficiary | business_beneficiary; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: eur_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: gbp_beneficiary | business_beneficiary; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: ghs_beneficiary | business_beneficiary; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: gtq_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: hkd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: htg_beneficiary | business_beneficiary; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: idr_beneficiary | business_beneficiary; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: inr_beneficiary | business_beneficiary; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: jmd_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: kes_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: mwk_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: mxn_beneficiary | business_beneficiary; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: myr_beneficiary | business_beneficiary; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: ngn_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: php_beneficiary | business_beneficiary; } | { accountType: 'PKR_ACCOUNT'; beneficiary: pkr_beneficiary | business_beneficiary; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: rwf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: sgd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: thb_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: tzs_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: ugx_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: usd_beneficiary | business_beneficiary; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: vnd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: xaf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: xof_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: zar_beneficiary | business_beneficiary; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: zmw_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; swiftCode: string; accountNumber?: string; iban?: string; }, currency: string, customerId?: string, defaultUmaDepositAccount?: boolean, platformAccountId?: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**post** `/customers/external-accounts`\n\nRegister a new external bank account for a customer.\n\n### Parameters\n\n- `accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; }`\n Required fields depend on the selected paymentRails:\n- BANK_TRANSFER: accountNumber\n- MOBILE_MONEY: phoneNumber\n\n- `currency: string`\n The ISO 4217 currency code\n\n- `customerId?: string`\n The ID of the customer for whom to create the external account. If not provided, the external account will be created on behalf of the platform.\n\n- `defaultUmaDepositAccount?: boolean`\n Whether to set the external account as the default UMA deposit account. When set to true, incoming payments to this customer's UMA address will be automatically deposited into this external account. False if not provided. Note that only one external account can be set as the default UMA deposit account for a customer, so if there is already a default UMA deposit account, this will override the existing default UMA deposit account. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer.\n\n- `platformAccountId?: string`\n Your platform's identifier for the account in your system. This can be used to reference the account by your own identifier.\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.customers.externalAccounts.create({\n accountInfo: {\n accountType: 'AED_ACCOUNT',\n beneficiary: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n beneficiaryType: 'INDIVIDUAL',\n fullName: 'fullName',\n},\n iban: 'AE070331234567890123456',\n},\n currency: 'USD',\n});\n\nconsole.log(externalAccount);\n```", + "## create\n\n`client.customers.externalAccounts.create(accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: aed_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: bdt_beneficiary | business_beneficiary; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: brl_beneficiary | business_beneficiary; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: bwp_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: cad_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | object; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: cop_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: dkk_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: egp_beneficiary | business_beneficiary; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: eur_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: gbp_beneficiary | business_beneficiary; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: ghs_beneficiary | business_beneficiary; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: gtq_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: hkd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: htg_beneficiary | business_beneficiary; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: idr_beneficiary | business_beneficiary; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: inr_beneficiary | business_beneficiary; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: jmd_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: kes_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: mwk_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: mxn_beneficiary | business_beneficiary; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: myr_beneficiary | business_beneficiary; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: ngn_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: php_beneficiary | business_beneficiary; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: pkr_beneficiary | business_beneficiary; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: rwf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: sgd_beneficiary | business_beneficiary; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: thb_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: tzs_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: ugx_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: usd_beneficiary | business_beneficiary; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: vnd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: xaf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: xof_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: zar_beneficiary | business_beneficiary; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: zmw_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; swiftCode: string; accountNumber?: string; iban?: string; }, currency: string, customerId?: string, defaultUmaDepositAccount?: boolean, platformAccountId?: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**post** `/customers/external-accounts`\n\nRegister a new external bank account for a customer.\n\n### Parameters\n\n- `accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: object; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; address?: address; birthDate?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; }`\n Required fields depend on the selected paymentRails:\n- BANK_TRANSFER: accountNumber, bankName\n- MOBILE_MONEY: bankName, phoneNumber\n\n- `currency: string`\n The ISO 4217 currency code\n\n- `customerId?: string`\n The ID of the customer for whom to create the external account. If not provided, the external account will be created on behalf of the platform.\n\n- `defaultUmaDepositAccount?: boolean`\n Whether to set the external account as the default UMA deposit account. When set to true, incoming payments to this customer's UMA address will be automatically deposited into this external account. False if not provided. Note that only one external account can be set as the default UMA deposit account for a customer, so if there is already a default UMA deposit account, this will override the existing default UMA deposit account. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer.\n\n- `platformAccountId?: string`\n Your platform's identifier for the account in your system. This can be used to reference the account by your own identifier.\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.customers.externalAccounts.create({\n accountInfo: {\n accountType: 'AED_ACCOUNT',\n beneficiary: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n beneficiaryType: 'INDIVIDUAL',\n fullName: 'fullName',\n},\n iban: 'AE070331234567890123456',\n},\n currency: 'USD',\n});\n\nconsole.log(externalAccount);\n```", perLanguage: { typescript: { method: 'client.customers.externalAccounts.create', @@ -868,11 +812,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->externalAccounts->create(\n accountInfo: [\n 'accountType' => 'AED_ACCOUNT',\n 'beneficiary' => [\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'beneficiaryType' => 'INDIVIDUAL',\n 'fullName' => 'fullName',\n 'birthDate' => 'birthDate',\n 'countryOfResidence' => 'countryOfResidence',\n 'email' => 'email',\n 'nationality' => 'nationality',\n 'phoneNumber' => 'phoneNumber',\n ],\n 'iban' => 'AE070331234567890123456',\n 'swiftCode' => 'EBILAEAD',\n ],\n currency: 'USD',\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n defaultUmaDepositAccount: true,\n platformAccountID: 'ext_acc_123456',\n);\n\nvar_dump($externalAccount);", }, - csharp: { - method: 'Customers.ExternalAccounts.Create', - example: - 'ExternalAccountCreateParams parameters = new()\n{\n AccountInfo = new AedExternalAccountCreateInfo()\n {\n AccountType = AccountType.AedAccount,\n Beneficiary = new AedBeneficiary()\n {\n Address = new()\n {\n Country = "US",\n Line1 = "123 Main Street",\n PostalCode = "94105",\n City = "San Francisco",\n Line2 = "Apt 4B",\n State = "CA",\n },\n BeneficiaryType = BeneficiaryType.Individual,\n FullName = "fullName",\n BirthDate = "birthDate",\n CountryOfResidence = "countryOfResidence",\n Email = "email",\n Nationality = "nationality",\n PhoneNumber = "phoneNumber",\n },\n Iban = "AE070331234567890123456",\n SwiftCode = "EBILAEAD",\n },\n Currency = "USD",\n};\n\nvar externalAccount = await client.Customers.ExternalAccounts.Create(parameters);\n\nConsole.WriteLine(externalAccount);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers/external-accounts \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "accountInfo": {\n "accountType": "AED_ACCOUNT",\n "beneficiary": {\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105"\n },\n "beneficiaryType": "INDIVIDUAL",\n "fullName": "fullName"\n },\n "iban": "AE070331234567890123456",\n "swiftCode": "EBILAEAD"\n },\n "currency": "USD",\n "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",\n "platformAccountId": "ext_acc_123456"\n }\'', @@ -889,9 +828,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.customers.externalAccounts.retrieve', params: ['externalAccountId: string;'], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## retrieve\n\n`client.customers.externalAccounts.retrieve(externalAccountId: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/customers/external-accounts/{externalAccountId}`\n\nRetrieve a customer external account by its system-generated ID\n\n### Parameters\n\n- `externalAccountId: string`\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.customers.externalAccounts.retrieve('externalAccountId');\n\nconsole.log(externalAccount);\n```", + "## retrieve\n\n`client.customers.externalAccounts.retrieve(externalAccountId: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/customers/external-accounts/{externalAccountId}`\n\nRetrieve a customer external account by its system-generated ID\n\n### Parameters\n\n- `externalAccountId: string`\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.customers.externalAccounts.retrieve('externalAccountId');\n\nconsole.log(externalAccount);\n```", perLanguage: { typescript: { method: 'client.customers.externalAccounts.retrieve', @@ -928,11 +867,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->externalAccounts->retrieve(\n 'externalAccountId'\n);\n\nvar_dump($externalAccount);", }, - csharp: { - method: 'Customers.ExternalAccounts.Retrieve', - example: - 'ExternalAccountRetrieveParams parameters = new()\n{\n ExternalAccountID = "externalAccountId"\n};\n\nvar externalAccount = await client.Customers.ExternalAccounts.Retrieve(parameters);\n\nConsole.WriteLine(externalAccount);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers/external-accounts/$EXTERNAL_ACCOUNT_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -986,11 +920,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->externalAccounts->delete('externalAccountId');\n\nvar_dump($result);", }, - csharp: { - method: 'Customers.ExternalAccounts.Delete', - example: - 'ExternalAccountDeleteParams parameters = new()\n{\n ExternalAccountID = "externalAccountId"\n};\n\nawait client.Customers.ExternalAccounts.Delete(parameters);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers/external-accounts/$EXTERNAL_ACCOUNT_ID \\\n -X DELETE \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1046,11 +975,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->bulk->uploadCsv(\n file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n);\n\nvar_dump($response);", }, - csharp: { - method: 'Customers.Bulk.UploadCsv', - example: - 'BulkUploadCsvParams parameters = new()\n{\n File = Encoding.UTF8.GetBytes("Example data")\n};\n\nvar response = await client.Customers.Bulk.UploadCsv(parameters);\n\nConsole.WriteLine(response);', - }, http: { example: "curl https://api.lightspark.com/grid/2025-10-13/customers/bulk/csv \\\n -H 'Content-Type: multipart/form-data' \\\n -u \"$GRID_CLIENT_ID:GRID_CLIENT_SECRET\" \\\n -F 'file=@/path/to/file'", @@ -1107,11 +1031,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "customers->bulk->getJobStatus('jobId');\n\nvar_dump($response);", }, - csharp: { - method: 'Customers.Bulk.GetJobStatus', - example: - 'BulkGetJobStatusParams parameters = new() { JobID = "jobId" };\n\nvar response = await client.Customers.Bulk.GetJobStatus(parameters);\n\nConsole.WriteLine(response);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/customers/bulk/jobs/$JOB_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1129,34 +1048,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.platform.listInternalAccounts', params: ['currency?: string;', "type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET';"], response: - "{ data: { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }[]; }", + "{ data: { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: currency_amount; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }[]; }", markdown: - "## list_internal_accounts\n\n`client.platform.listInternalAccounts(currency?: string, type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'): { data: internal_account[]; }`\n\n**get** `/platform/internal-accounts`\n\nRetrieve a list of all internal accounts that belong to the platform, as opposed to an individual customer.\n\nThese accounts are created automatically when the platform is configured for each supported currency. They can be used for things like distributing bitcoin rewards to customers, or for other platform-wide purposes.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for a customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for the platform-managed holding accounts.\n\n### Returns\n\n- `{ data: { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }[]; }`\n\n - `data: { id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.platform.listInternalAccounts();\n\nconsole.log(response);\n```", + "## list_internal_accounts\n\n`client.platform.listInternalAccounts(currency?: string, type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'): { data: internal_account[]; }`\n\n**get** `/platform/internal-accounts`\n\nRetrieve a list of all internal accounts that belong to the platform, as opposed to an individual customer.\n\nThese accounts are created automatically when the platform is configured for each supported currency. They can be used for things like distributing bitcoin rewards to customers, or for other platform-wide purposes.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for a customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for the platform-managed holding accounts.\n\n### Returns\n\n- `{ data: { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: currency_amount; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }[]; }`\n\n - `data: { id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst platformInternalAccountListResponse = await client.platform.listInternalAccounts();\n\nconsole.log(platformInternalAccountListResponse);\n```", perLanguage: { typescript: { method: 'client.platform.listInternalAccounts', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.platform.listInternalAccounts();\n\nconsole.log(response.data);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst platformInternalAccountListResponse = await client.platform.listInternalAccounts();\n\nconsole.log(platformInternalAccountListResponse.data);", }, python: { method: 'platform.list_internal_accounts', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.platform.list_internal_accounts()\nprint(response.data)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nplatform_internal_account_list_response = client.platform.list_internal_accounts()\nprint(platform_internal_account_list_response.data)', }, kotlin: { method: 'platform().listInternalAccounts', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.platform.PlatformListInternalAccountsParams\nimport com.lightspark.grid.models.platform.PlatformListInternalAccountsResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val response: PlatformListInternalAccountsResponse = client.platform().listInternalAccounts()\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.platform.PlatformInternalAccountListResponse\nimport com.lightspark.grid.models.platform.PlatformListInternalAccountsParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val platformInternalAccountListResponse: PlatformInternalAccountListResponse = client.platform().listInternalAccounts()\n}', }, go: { method: 'client.Platform.ListInternalAccounts', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Platform.ListInternalAccounts(context.TODO(), grid.PlatformListInternalAccountsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tplatformInternalAccountListResponse, err := client.Platform.ListInternalAccounts(context.TODO(), grid.PlatformListInternalAccountsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", platformInternalAccountListResponse.Data)\n}\n', }, ruby: { method: 'platform.list_internal_accounts', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.platform.list_internal_accounts\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nplatform_internal_account_list_response = lightspark_grid.platform.list_internal_accounts\n\nputs(platform_internal_account_list_response)', }, cli: { method: 'platform list_internal_accounts', @@ -1166,12 +1085,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'platform->listInternalAccounts', example: - "platform->listInternalAccounts(\n currency: 'currency', type: 'INTERNAL_FIAT'\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Platform.ListInternalAccounts', - example: - 'PlatformListInternalAccountsParams parameters = new();\n\nvar response = await client.Platform.ListInternalAccounts(parameters);\n\nConsole.WriteLine(response);', + "platform->listInternalAccounts(\n currency: 'currency', type: 'INTERNAL_FIAT'\n);\n\nvar_dump($platformInternalAccountListResponse);", }, http: { example: @@ -1190,9 +1104,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.platform.externalAccounts.list', params: ['currency?: string;', 'cursor?: string;', 'limit?: number;'], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## list\n\n`client.platform.externalAccounts.list(currency?: string, cursor?: string, limit?: number): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/platform/external-accounts`\n\nRetrieve a list of all external accounts that belong to the platform, as opposed to an individual customer.\n\nThese accounts are used for platform-wide operations such as receiving funds from external sources or managing platform-level payment destinations.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const externalAccount of client.platform.externalAccounts.list()) {\n console.log(externalAccount);\n}\n```", + "## list\n\n`client.platform.externalAccounts.list(currency?: string, cursor?: string, limit?: number): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/platform/external-accounts`\n\nRetrieve a list of all external accounts that belong to the platform, as opposed to an individual customer.\n\nThese accounts are used for platform-wide operations such as receiving funds from external sources or managing platform-level payment destinations.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const externalAccount of client.platform.externalAccounts.list()) {\n console.log(externalAccount);\n}\n```", perLanguage: { typescript: { method: 'client.platform.externalAccounts.list', @@ -1229,11 +1143,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "platform->externalAccounts->list(\n currency: 'currency', cursor: 'cursor', limit: 1\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Platform.ExternalAccounts.List', - example: - 'ExternalAccountListParams parameters = new();\n\nvar page = await client.Platform.ExternalAccounts.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/platform/external-accounts \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1249,14 +1158,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) platform.external_accounts > (method) create', qualified: 'client.platform.externalAccounts.create', params: [ - "accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; };", + "accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: object; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; address?: address; birthDate?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; };", 'currency: string;', 'platformAccountId?: string;', ], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## create\n\n`client.platform.externalAccounts.create(accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: aed_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: bdt_beneficiary | business_beneficiary; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: brl_beneficiary | business_beneficiary; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: bwp_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: cad_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: cop_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: dkk_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: egp_beneficiary | business_beneficiary; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: eur_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: gbp_beneficiary | business_beneficiary; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: ghs_beneficiary | business_beneficiary; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: gtq_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: hkd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: htg_beneficiary | business_beneficiary; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: idr_beneficiary | business_beneficiary; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: inr_beneficiary | business_beneficiary; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: jmd_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: kes_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: mwk_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: mxn_beneficiary | business_beneficiary; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: myr_beneficiary | business_beneficiary; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: ngn_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: php_beneficiary | business_beneficiary; } | { accountType: 'PKR_ACCOUNT'; beneficiary: pkr_beneficiary | business_beneficiary; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: rwf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: sgd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: thb_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: tzs_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: ugx_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: usd_beneficiary | business_beneficiary; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: vnd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: xaf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: xof_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: zar_beneficiary | business_beneficiary; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: zmw_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; swiftCode: string; accountNumber?: string; iban?: string; }, currency: string, platformAccountId?: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**post** `/platform/external-accounts`\n\nRegister a new external bank account for the platform.\n\n### Parameters\n\n- `accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; }`\n Required fields depend on the selected paymentRails:\n- BANK_TRANSFER: accountNumber\n- MOBILE_MONEY: phoneNumber\n\n- `currency: string`\n The ISO 4217 currency code\n\n- `platformAccountId?: string`\n Your platform's identifier for the account in your system. This can be used to reference the account by your own identifier.\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.platform.externalAccounts.create({\n accountInfo: {\n accountNumber: '12345678901',\n accountType: 'USD_ACCOUNT',\n beneficiary: { beneficiaryType: 'INDIVIDUAL', fullName: 'John Doe' },\n routingNumber: '123456789',\n},\n currency: 'USD',\n});\n\nconsole.log(externalAccount);\n```", + "## create\n\n`client.platform.externalAccounts.create(accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: aed_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: bdt_beneficiary | business_beneficiary; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: brl_beneficiary | business_beneficiary; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: bwp_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: cad_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | object; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: cop_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: dkk_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: egp_beneficiary | business_beneficiary; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: eur_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: gbp_beneficiary | business_beneficiary; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: ghs_beneficiary | business_beneficiary; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: gtq_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: hkd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: htg_beneficiary | business_beneficiary; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: idr_beneficiary | business_beneficiary; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: inr_beneficiary | business_beneficiary; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: jmd_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: kes_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: mwk_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: mxn_beneficiary | business_beneficiary; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: myr_beneficiary | business_beneficiary; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: ngn_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: php_beneficiary | business_beneficiary; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: pkr_beneficiary | business_beneficiary; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: rwf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: sgd_beneficiary | business_beneficiary; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: thb_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: tzs_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: ugx_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: usd_beneficiary | business_beneficiary; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: vnd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: xaf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: xof_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: zar_beneficiary | business_beneficiary; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: zmw_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; swiftCode: string; accountNumber?: string; iban?: string; }, currency: string, platformAccountId?: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**post** `/platform/external-accounts`\n\nRegister a new external bank account for the platform.\n\n### Parameters\n\n- `accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: object; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; address?: address; birthDate?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; }`\n Required fields depend on the selected paymentRails:\n- BANK_TRANSFER: accountNumber, bankName\n- MOBILE_MONEY: bankName, phoneNumber\n\n- `currency: string`\n The ISO 4217 currency code\n\n- `platformAccountId?: string`\n Your platform's identifier for the account in your system. This can be used to reference the account by your own identifier.\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.platform.externalAccounts.create({\n accountInfo: {\n accountType: 'AED_ACCOUNT',\n beneficiary: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n beneficiaryType: 'INDIVIDUAL',\n fullName: 'fullName',\n},\n iban: 'AE070331234567890123456',\n},\n currency: 'USD',\n});\n\nconsole.log(externalAccount);\n```", perLanguage: { typescript: { method: 'client.platform.externalAccounts.create', @@ -1271,36 +1180,31 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'platform().externalAccounts().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.UsdExternalAccountCreateInfo\nimport com.lightspark.grid.models.customers.externalaccounts.ExternalAccount\nimport com.lightspark.grid.models.platform.externalaccounts.ExternalAccountCreateParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: ExternalAccountCreateParams = ExternalAccountCreateParams.builder()\n .accountInfo(UsdExternalAccountCreateInfo.builder()\n .accountNumber("12345678901")\n .accountType(UsdExternalAccountCreateInfo.AccountType.USD_ACCOUNT)\n .individualBeneficiary("John Doe")\n .routingNumber("123456789")\n .build())\n .currency("USD")\n .build()\n val externalAccount: ExternalAccount = client.platform().externalAccounts().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.AedBeneficiary\nimport com.lightspark.grid.models.AedExternalAccountCreateInfo\nimport com.lightspark.grid.models.customers.externalaccounts.Address\nimport com.lightspark.grid.models.customers.externalaccounts.ExternalAccount\nimport com.lightspark.grid.models.platform.externalaccounts.PlatformExternalAccountCreateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: PlatformExternalAccountCreateRequest = PlatformExternalAccountCreateRequest.builder()\n .accountInfo(AedExternalAccountCreateInfo.builder()\n .accountType(AedExternalAccountCreateInfo.AccountType.AED_ACCOUNT)\n .beneficiary(AedBeneficiary.builder()\n .address(Address.builder()\n .country("US")\n .line1("123 Main Street")\n .postalCode("94105")\n .build())\n .beneficiaryType(AedBeneficiary.BeneficiaryType.INDIVIDUAL)\n .fullName("fullName")\n .build())\n .iban("AE070331234567890123456")\n .build())\n .currency("USD")\n .build()\n val externalAccount: ExternalAccount = client.platform().externalAccounts().create(params)\n}', }, go: { method: 'client.Platform.ExternalAccounts.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n\t"github.com/stainless-sdks/grid-go/shared"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\texternalAccount, err := client.Platform.ExternalAccounts.New(context.TODO(), grid.PlatformExternalAccountNewParams{\n\t\tAccountInfo: grid.PlatformExternalAccountNewParamsAccountInfoUnion{\n\t\t\tOfUsdAccount: &shared.UsdExternalAccountCreateInfoParam{\n\t\t\t\tAccountType: shared.UsdExternalAccountCreateInfoAccountTypeUsdAccount,\n\t\t\t\tAccountNumber: "12345678901",\n\t\t\t\tRoutingNumber: "123456789",\n\t\t\t\tBeneficiary: shared.UsdExternalAccountCreateInfoBeneficiaryUnionParam{\n\t\t\t\t\tOfIndividual: &grid.UsdBeneficiaryParam{\n\t\t\t\t\t\tBeneficiaryType: grid.UsdBeneficiaryBeneficiaryTypeIndividual,\n\t\t\t\t\t\tFullName: "John Doe",\n\t\t\t\t\t\tBirthDate: grid.String("1990-01-15"),\n\t\t\t\t\t\tNationality: grid.String("US"),\n\t\t\t\t\t\tAddress: grid.AddressParam{\n\t\t\t\t\t\t\tLine1: "123 Main Street",\n\t\t\t\t\t\t\tCity: grid.String("San Francisco"),\n\t\t\t\t\t\t\tState: grid.String("CA"),\n\t\t\t\t\t\t\tPostalCode: "94105",\n\t\t\t\t\t\t\tCountry: "US",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tCurrency: "USD",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalAccount.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n\t"github.com/stainless-sdks/grid-go/shared"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\texternalAccount, err := client.Platform.ExternalAccounts.New(context.TODO(), grid.PlatformExternalAccountNewParams{\n\t\tPlatformExternalAccountCreateRequest: grid.PlatformExternalAccountCreateRequestParam{\n\t\t\tAccountInfo: grid.PlatformExternalAccountCreateRequestAccountInfoUnionParam{\n\t\t\t\tOfAedAccount: &shared.AedExternalAccountCreateInfoParam{\n\t\t\t\t\tAccountType: shared.AedExternalAccountCreateInfoAccountTypeAedAccount,\n\t\t\t\t\tBeneficiary: shared.AedExternalAccountCreateInfoBeneficiaryUnionParam{\n\t\t\t\t\t\tOfIndividual: &shared.AedBeneficiaryParam{\n\t\t\t\t\t\t\tAddress: grid.AddressParam{\n\t\t\t\t\t\t\t\tCountry: "US",\n\t\t\t\t\t\t\t\tLine1: "123 Main Street",\n\t\t\t\t\t\t\t\tPostalCode: "94105",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tBeneficiaryType: shared.AedBeneficiaryBeneficiaryTypeIndividual,\n\t\t\t\t\t\t\tFullName: "fullName",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tIban: "AE070331234567890123456",\n\t\t\t\t},\n\t\t\t},\n\t\t\tCurrency: "USD",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalAccount.ID)\n}\n', }, ruby: { method: 'platform.external_accounts.create', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nexternal_account = lightspark_grid.platform.external_accounts.create(\n account_info: {\n accountNumber: "12345678901",\n accountType: :USD_ACCOUNT,\n beneficiary: {beneficiaryType: :INDIVIDUAL, fullName: "John Doe"},\n routingNumber: "123456789"\n },\n currency: "USD"\n)\n\nputs(external_account)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nexternal_account = lightspark_grid.platform.external_accounts.create(\n account_info: {\n accountType: :AED_ACCOUNT,\n beneficiary: {\n address: {country: "US", line1: "123 Main Street", postalCode: "94105"},\n beneficiaryType: :INDIVIDUAL,\n fullName: "fullName"\n },\n iban: "AE070331234567890123456"\n },\n currency: "USD"\n)\n\nputs(external_account)', }, cli: { method: 'external_accounts create', example: - "grid platform:external-accounts create \\\n --username 'My Username' \\\n --password 'My Password' \\\n --account-info \"{accountNumber: '12345678901', accountType: USD_ACCOUNT, beneficiary: {beneficiaryType: INDIVIDUAL, fullName: John Doe}, routingNumber: '123456789'}\" \\\n --currency USD", + "grid platform:external-accounts create \\\n --username 'My Username' \\\n --password 'My Password' \\\n --account-info \"{accountType: AED_ACCOUNT, beneficiary: {address: {country: US, line1: 123 Main Street, postalCode: '94105'}, beneficiaryType: INDIVIDUAL, fullName: fullName}, iban: AE070331234567890123456}\" \\\n --currency USD", }, php: { method: 'platform->externalAccounts->create', example: - "platform->externalAccounts->create(\n accountInfo: [\n 'accountNumber' => '12345678901',\n 'accountType' => 'USD_ACCOUNT',\n 'beneficiary' => [\n 'beneficiaryType' => 'INDIVIDUAL',\n 'fullName' => 'John Doe',\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1990-01-15',\n 'countryOfResidence' => 'countryOfResidence',\n 'email' => 'email',\n 'nationality' => 'US',\n 'phoneNumber' => 'phoneNumber',\n ],\n 'routingNumber' => '123456789',\n ],\n currency: 'USD',\n platformAccountID: 'ext_acc_123456',\n);\n\nvar_dump($externalAccount);", - }, - csharp: { - method: 'Platform.ExternalAccounts.Create', - example: - 'ExternalAccountCreateParams parameters = new()\n{\n AccountInfo = new UsdExternalAccountCreateInfo()\n {\n AccountNumber = "12345678901",\n AccountType = AccountType.UsdAccount,\n Beneficiary = new UsdBeneficiary()\n {\n BeneficiaryType = BeneficiaryType.Individual,\n FullName = "John Doe",\n Address = new()\n {\n Country = "US",\n Line1 = "123 Main Street",\n PostalCode = "94105",\n City = "San Francisco",\n Line2 = "Apt 4B",\n State = "CA",\n },\n BirthDate = "1990-01-15",\n CountryOfResidence = "countryOfResidence",\n Email = "email",\n Nationality = "US",\n PhoneNumber = "phoneNumber",\n },\n RoutingNumber = "123456789",\n },\n Currency = "USD",\n};\n\nvar externalAccount = await client.Platform.ExternalAccounts.Create(parameters);\n\nConsole.WriteLine(externalAccount);', + "platform->externalAccounts->create(\n accountInfo: [\n 'accountType' => 'AED_ACCOUNT',\n 'beneficiary' => [\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'beneficiaryType' => 'INDIVIDUAL',\n 'fullName' => 'fullName',\n 'birthDate' => 'birthDate',\n 'countryOfResidence' => 'countryOfResidence',\n 'email' => 'email',\n 'nationality' => 'nationality',\n 'phoneNumber' => 'phoneNumber',\n ],\n 'iban' => 'AE070331234567890123456',\n 'swiftCode' => 'EBILAEAD',\n ],\n currency: 'USD',\n platformAccountID: 'ext_acc_123456',\n);\n\nvar_dump($externalAccount);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/platform/external-accounts \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "accountInfo": {\n "accountNumber": "12345678901",\n "accountType": "USD_ACCOUNT",\n "beneficiary": {\n "beneficiaryType": "INDIVIDUAL",\n "fullName": "John Doe",\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105",\n "city": "San Francisco",\n "state": "CA"\n },\n "birthDate": "1990-01-15",\n "nationality": "US"\n },\n "routingNumber": "123456789"\n },\n "currency": "USD",\n "platformAccountId": "ext_acc_123456"\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/platform/external-accounts \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "accountInfo": {\n "accountType": "AED_ACCOUNT",\n "beneficiary": {\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105"\n },\n "beneficiaryType": "INDIVIDUAL",\n "fullName": "fullName"\n },\n "iban": "AE070331234567890123456",\n "swiftCode": "EBILAEAD"\n },\n "currency": "USD",\n "platformAccountId": "ext_acc_123456"\n }\'', }, }, }, @@ -1314,9 +1218,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.platform.externalAccounts.retrieve', params: ['externalAccountId: string;'], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## retrieve\n\n`client.platform.externalAccounts.retrieve(externalAccountId: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/platform/external-accounts/{externalAccountId}`\n\nRetrieve a platform external account by its system-generated ID\n\n### Parameters\n\n- `externalAccountId: string`\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.platform.externalAccounts.retrieve('externalAccountId');\n\nconsole.log(externalAccount);\n```", + "## retrieve\n\n`client.platform.externalAccounts.retrieve(externalAccountId: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/platform/external-accounts/{externalAccountId}`\n\nRetrieve a platform external account by its system-generated ID\n\n### Parameters\n\n- `externalAccountId: string`\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.platform.externalAccounts.retrieve('externalAccountId');\n\nconsole.log(externalAccount);\n```", perLanguage: { typescript: { method: 'client.platform.externalAccounts.retrieve', @@ -1353,11 +1257,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "platform->externalAccounts->retrieve(\n 'externalAccountId'\n);\n\nvar_dump($externalAccount);", }, - csharp: { - method: 'Platform.ExternalAccounts.Retrieve', - example: - 'ExternalAccountRetrieveParams parameters = new()\n{\n ExternalAccountID = "externalAccountId"\n};\n\nvar externalAccount = await client.Platform.ExternalAccounts.Retrieve(parameters);\n\nConsole.WriteLine(externalAccount);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/platform/external-accounts/$EXTERNAL_ACCOUNT_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1411,11 +1310,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "platform->externalAccounts->delete('externalAccountId');\n\nvar_dump($result);", }, - csharp: { - method: 'Platform.ExternalAccounts.Delete', - example: - 'ExternalAccountDeleteParams parameters = new()\n{\n ExternalAccountID = "externalAccountId"\n};\n\nawait client.Platform.ExternalAccounts.Delete(parameters);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/platform/external-accounts/$EXTERNAL_ACCOUNT_ID \\\n -X DELETE \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1437,10 +1331,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'amount?: number;', 'Idempotency-Key?: string;', ], - response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }", + response: 'object | object | object', markdown: - "## create\n\n`client.transferIn.create(destination: { accountId: string; }, source: { accountId: string; }, amount?: number, Idempotency-Key?: string): object | object`\n\n**post** `/transfer-in`\n\nTransfer funds from an external account to an internal account for a specific customer. This endpoint should only be used for external account sources with pull functionality (e.g. ACH Pull). Otherwise, use the paymentInstructions on the internal account to deposit funds.\n\n\n### Parameters\n\n- `destination: { accountId: string; }`\n Destination internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `source: { accountId: string; }`\n Source external account details\n - `accountId: string`\n Reference to an external account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.transferIn.create({\n destination: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n source: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n});\n\nconsole.log(transaction);\n```", + "## create\n\n`client.transferIn.create(destination: { accountId: string; }, source: { accountId: string; }, amount?: number, Idempotency-Key?: string): object | object | object`\n\n**post** `/transfer-in`\n\nTransfer funds from an external account to an internal account for a specific customer. This endpoint should only be used for external account sources with pull functionality (e.g. ACH Pull). Otherwise, use the paymentInstructions on the internal account to deposit funds.\n\n\n### Parameters\n\n- `destination: { accountId: string; }`\n Destination internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `source: { accountId: string; }`\n Source external account details\n - `accountId: string`\n Reference to an external account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.transferIn.create({\n destination: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n source: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n});\n\nconsole.log(transaction);\n```", perLanguage: { typescript: { method: 'client.transferIn.create', @@ -1455,12 +1348,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'transferIn().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.transferin.ExternalAccountReference\nimport com.lightspark.grid.models.transferin.InternalAccountReference\nimport com.lightspark.grid.models.transferin.Transaction\nimport com.lightspark.grid.models.transferin.TransferInCreateParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TransferInCreateParams = TransferInCreateParams.builder()\n .destination(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .source(ExternalAccountReference.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .build()\n val transaction: Transaction = client.transferIn().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.transferin.ExternalAccountReference\nimport com.lightspark.grid.models.transferin.InternalAccountReference\nimport com.lightspark.grid.models.transferin.Transaction\nimport com.lightspark.grid.models.transferin.TransferInRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TransferInRequest = TransferInRequest.builder()\n .destination(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .source(ExternalAccountReference.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .build()\n val transaction: Transaction = client.transferIn().create(params)\n}', }, go: { method: 'client.TransferIn.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\ttransaction, err := client.TransferIn.New(context.TODO(), grid.TransferInNewParams{\n\t\tDestination: grid.InternalAccountReferenceParam{\n\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tSource: grid.ExternalAccountReferenceParam{\n\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t\tAmount: grid.Int(12550),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", transaction)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\ttransaction, err := client.TransferIn.New(context.TODO(), grid.TransferInNewParams{\n\t\tTransferInRequest: grid.TransferInRequestParam{\n\t\t\tDestination: grid.InternalAccountReferenceParam{\n\t\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t\t},\n\t\t\tSource: grid.ExternalAccountReferenceParam{\n\t\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\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", transaction)\n}\n', }, ruby: { method: 'transfer_in.create', @@ -1477,11 +1370,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "transferIn->create(\n destination: [\n 'accountID' => 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123'\n ],\n source: [\n 'accountID' => 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965'\n ],\n amount: 12550,\n idempotencyKey: '550e8400-e29b-41d4-a716-446655440000',\n);\n\nvar_dump($transaction);", }, - csharp: { - method: 'TransferIn.Create', - example: - 'TransferInCreateParams parameters = new()\n{\n Destination = new("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"),\n Source = new("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"),\n};\n\nvar transaction = await client.TransferIn.Create(parameters);\n\nConsole.WriteLine(transaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/transfer-in \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "destination": {\n "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "source": {\n "accountId": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "amount": 12550\n }\'', @@ -1497,35 +1385,35 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) transfer_out > (method) create', qualified: 'client.transferOut.create', params: [ - 'destination: { accountId: string; };', + 'destination: { accountId: string; paymentRail?: string; };', 'source: { accountId: string; };', 'amount?: number;', + 'remittanceInformation?: string;', 'Idempotency-Key?: string;', ], - response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }", + response: 'object | object | object', markdown: - "## create\n\n`client.transferOut.create(destination: { accountId: string; }, source: { accountId: string; }, amount?: number, Idempotency-Key?: string): object | object`\n\n**post** `/transfer-out`\n\nTransfer funds from an internal account to an external account for a specific customer.\n\n\n### Parameters\n\n- `destination: { accountId: string; }`\n Destination external account details\n - `accountId: string`\n Reference to an external account ID\n\n- `source: { accountId: string; }`\n Source internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.transferOut.create({\n destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n});\n\nconsole.log(transaction);\n```", + "## create\n\n`client.transferOut.create(destination: { accountId: string; paymentRail?: string; }, source: { accountId: string; }, amount?: number, remittanceInformation?: string, Idempotency-Key?: string): object | object | object`\n\n**post** `/transfer-out`\n\nTransfer funds from an internal account to an external account for a specific customer.\n\n\n### Parameters\n\n- `destination: { accountId: string; paymentRail?: string; }`\n Destination external account details\n - `accountId: string`\n Reference to an external account ID\n - `paymentRail?: string`\n The payment rail to use for the transfer. Must be one of the rails supported by the destination account. If not specified, the system will select a default rail.\n\n- `source: { accountId: string; }`\n Source internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `remittanceInformation?: string`\n Free-form information about the payment that travels with it to the recipient. The field this populates depends on the payment rail: for ACH it populates the Addenda record, for FedNow and RTP it populates the remittanceInformation field, and for wires it populates the OBI (Originator to Beneficiary Information) / beneficiary information.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.transferOut.create({\n destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n});\n\nconsole.log(transaction);\n```", perLanguage: { typescript: { method: 'client.transferOut.create', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst transaction = await client.transferOut.create({\n destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n amount: 12550,\n});\n\nconsole.log(transaction);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst transaction = await client.transferOut.create({\n destination: {\n accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n paymentRail: 'ACH',\n },\n source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n amount: 12550,\n remittanceInformation: '12345',\n});\n\nconsole.log(transaction);", }, python: { method: 'transfer_out.create', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ntransaction = client.transfer_out.create(\n destination={\n "account_id": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n source={\n "account_id": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n amount=12550,\n)\nprint(transaction)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ntransaction = client.transfer_out.create(\n destination={\n "account_id": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n "payment_rail": "ACH",\n },\n source={\n "account_id": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n amount=12550,\n remittance_information="12345",\n)\nprint(transaction)', }, kotlin: { method: 'transferOut().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.transferin.ExternalAccountReference\nimport com.lightspark.grid.models.transferin.InternalAccountReference\nimport com.lightspark.grid.models.transferin.Transaction\nimport com.lightspark.grid.models.transferout.TransferOutCreateParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TransferOutCreateParams = TransferOutCreateParams.builder()\n .destination(ExternalAccountReference.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .source(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .build()\n val transaction: Transaction = client.transferOut().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.transferin.InternalAccountReference\nimport com.lightspark.grid.models.transferin.Transaction\nimport com.lightspark.grid.models.transferout.TransferOutRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TransferOutRequest = TransferOutRequest.builder()\n .destination(TransferOutRequest.Destination.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .source(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .build()\n val transaction: Transaction = client.transferOut().create(params)\n}', }, go: { method: 'client.TransferOut.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\ttransaction, err := client.TransferOut.New(context.TODO(), grid.TransferOutNewParams{\n\t\tDestination: grid.ExternalAccountReferenceParam{\n\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t\tSource: grid.InternalAccountReferenceParam{\n\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tAmount: grid.Int(12550),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", transaction)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\ttransaction, err := client.TransferOut.New(context.TODO(), grid.TransferOutNewParams{\n\t\tTransferOutRequest: grid.TransferOutRequestParam{\n\t\t\tDestination: grid.TransferOutRequestDestinationParam{\n\t\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t\t},\n\t\t\tSource: grid.InternalAccountReferenceParam{\n\t\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\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", transaction)\n}\n', }, ruby: { method: 'transfer_out.create', @@ -1540,16 +1428,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'transferOut->create', example: - "transferOut->create(\n destination: [\n 'accountID' => 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965'\n ],\n source: [\n 'accountID' => 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123'\n ],\n amount: 12550,\n idempotencyKey: '550e8400-e29b-41d4-a716-446655440000',\n);\n\nvar_dump($transaction);", - }, - csharp: { - method: 'TransferOut.Create', - example: - 'TransferOutCreateParams parameters = new()\n{\n Destination = new("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"),\n Source = new("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"),\n};\n\nvar transaction = await client.TransferOut.Create(parameters);\n\nConsole.WriteLine(transaction);', + "transferOut->create(\n destination: [\n 'accountID' => 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n 'paymentRail' => 'ACH',\n ],\n source: [\n 'accountID' => 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123'\n ],\n amount: 12550,\n remittanceInformation: '12345',\n idempotencyKey: '550e8400-e29b-41d4-a716-446655440000',\n);\n\nvar_dump($transaction);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/transfer-out \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "destination": {\n "accountId": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "source": {\n "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "amount": 12550\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/transfer-out \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "destination": {\n "accountId": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "source": {\n "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "amount": 12550,\n "remittanceInformation": "12345"\n }\'', }, }, }, @@ -1566,32 +1449,32 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ lookupId: string; supportedCurrencies: { currency: currency; estimatedExchangeRate: number; max: number; min: number; }[]; requiredPayerDataFields?: object[]; }', markdown: - "## lookup_uma\n\n`client.receiver.lookupUma(receiverUmaAddress: string, customerId?: string, senderUmaAddress?: string): object`\n\n**get** `/receiver/uma/{receiverUmaAddress}`\n\nLookup a receiving UMA address to determine supported currencies and exchange rates.\nThis endpoint helps platforms determine what currencies they can send to a given UMA address.\n\n\n### Parameters\n\n- `receiverUmaAddress: string`\n\n- `customerId?: string`\n System ID of the sender (optional if senderUmaAddress is provided)\n\n- `senderUmaAddress?: string`\n UMA address of the sender (optional if customerId is provided)\n\n### Returns\n\n- `{ lookupId: string; supportedCurrencies: { currency: currency; estimatedExchangeRate: number; max: number; min: number; }[]; requiredPayerDataFields?: object[]; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.receiver.lookupUma('receiverUmaAddress');\n\nconsole.log(response);\n```", + "## lookup_uma\n\n`client.receiver.lookupUma(receiverUmaAddress: string, customerId?: string, senderUmaAddress?: string): object`\n\n**get** `/receiver/uma/{receiverUmaAddress}`\n\nLookup a receiving UMA address to determine supported currencies and exchange rates.\nThis endpoint helps platforms determine what currencies they can send to a given UMA address.\n\n\n### Parameters\n\n- `receiverUmaAddress: string`\n\n- `customerId?: string`\n System ID of the sender (optional if senderUmaAddress is provided)\n\n- `senderUmaAddress?: string`\n UMA address of the sender (optional if customerId is provided)\n\n### Returns\n\n- `{ lookupId: string; supportedCurrencies: { currency: currency; estimatedExchangeRate: number; max: number; min: number; }[]; requiredPayerDataFields?: object[]; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst umaLookupResponse = await client.receiver.lookupUma('receiverUmaAddress');\n\nconsole.log(umaLookupResponse);\n```", perLanguage: { typescript: { method: 'client.receiver.lookupUma', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.receiver.lookupUma('receiverUmaAddress');\n\nconsole.log(response);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst umaLookupResponse = await client.receiver.lookupUma('receiverUmaAddress');\n\nconsole.log(umaLookupResponse);", }, python: { method: 'receiver.lookup_uma', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.receiver.lookup_uma(\n receiver_uma_address="receiverUmaAddress",\n)\nprint(response)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\numa_lookup_response = client.receiver.lookup_uma(\n receiver_uma_address="receiverUmaAddress",\n)\nprint(uma_lookup_response)', }, kotlin: { method: 'receiver().lookupUma', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.receiver.ReceiverLookupUmaParams\nimport com.lightspark.grid.models.receiver.ReceiverLookupUmaResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val response: ReceiverLookupUmaResponse = client.receiver().lookupUma("receiverUmaAddress")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.receiver.ReceiverLookupUmaParams\nimport com.lightspark.grid.models.receiver.UmaLookupResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val umaLookupResponse: UmaLookupResponse = client.receiver().lookupUma("receiverUmaAddress")\n}', }, go: { method: 'client.Receiver.LookupUma', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Receiver.LookupUma(\n\t\tcontext.TODO(),\n\t\t"receiverUmaAddress",\n\t\tgrid.ReceiverLookupUmaParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tumaLookupResponse, err := client.Receiver.LookupUma(\n\t\tcontext.TODO(),\n\t\t"receiverUmaAddress",\n\t\tgrid.ReceiverLookupUmaParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", umaLookupResponse)\n}\n', }, ruby: { method: 'receiver.lookup_uma', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.receiver.lookup_uma("receiverUmaAddress")\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\numa_lookup_response = lightspark_grid.receiver.lookup_uma("receiverUmaAddress")\n\nputs(uma_lookup_response)', }, cli: { method: 'receiver lookup_uma', @@ -1601,12 +1484,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'receiver->lookupUma', example: - "receiver->lookupUma(\n 'receiverUmaAddress',\n customerID: 'customerId',\n senderUmaAddress: 'senderUmaAddress',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Receiver.LookupUma', - example: - 'ReceiverLookupUmaParams parameters = new()\n{\n ReceiverUmaAddress = "receiverUmaAddress"\n};\n\nvar response = await client.Receiver.LookupUma(parameters);\n\nConsole.WriteLine(response);', + "receiver->lookupUma(\n 'receiverUmaAddress',\n customerID: 'customerId',\n senderUmaAddress: 'senderUmaAddress',\n);\n\nvar_dump($umaLookupResponse);", }, http: { example: @@ -1627,32 +1505,32 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ lookupId: string; supportedCurrencies: { currency: currency; estimatedExchangeRate: number; max: number; min: number; }[]; requiredPayerDataFields?: object[]; }', markdown: - "## lookup_external_account\n\n`client.receiver.lookupExternalAccount(accountId: string, customerId?: string, senderUmaAddress?: string): object`\n\n**get** `/receiver/external-account/{accountId}`\n\nLookup an external account by ID to determine supported currencies and exchange rates.\nThis endpoint helps platforms determine what currencies they can send to a given external account, along with the current estimated exchange rates and minimum and maximum amounts that can be sent.\n\n\n### Parameters\n\n- `accountId: string`\n\n- `customerId?: string`\n System ID of the sender (optional if senderUmaAddress is provided)\n\n- `senderUmaAddress?: string`\n UMA address of the sender (optional if customerId is provided)\n\n### Returns\n\n- `{ lookupId: string; supportedCurrencies: { currency: currency; estimatedExchangeRate: number; max: number; min: number; }[]; requiredPayerDataFields?: object[]; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.receiver.lookupExternalAccount('ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965');\n\nconsole.log(response);\n```", + "## lookup_external_account\n\n`client.receiver.lookupExternalAccount(accountId: string, customerId?: string, senderUmaAddress?: string): object`\n\n**get** `/receiver/external-account/{accountId}`\n\nLookup an external account by ID to determine supported currencies and exchange rates.\nThis endpoint helps platforms determine what currencies they can send to a given external account, along with the current estimated exchange rates and minimum and maximum amounts that can be sent.\n\n\n### Parameters\n\n- `accountId: string`\n\n- `customerId?: string`\n System ID of the sender (optional if senderUmaAddress is provided)\n\n- `senderUmaAddress?: string`\n UMA address of the sender (optional if customerId is provided)\n\n### Returns\n\n- `{ lookupId: string; supportedCurrencies: { currency: currency; estimatedExchangeRate: number; max: number; min: number; }[]; requiredPayerDataFields?: object[]; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccountLookupResponse = await client.receiver.lookupExternalAccount('ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965');\n\nconsole.log(externalAccountLookupResponse);\n```", perLanguage: { typescript: { method: 'client.receiver.lookupExternalAccount', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.receiver.lookupExternalAccount(\n 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n);\n\nconsole.log(response);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst externalAccountLookupResponse = await client.receiver.lookupExternalAccount(\n 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n);\n\nconsole.log(externalAccountLookupResponse);", }, python: { method: 'receiver.lookup_external_account', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.receiver.lookup_external_account(\n account_id="ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n)\nprint(response)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nexternal_account_lookup_response = client.receiver.lookup_external_account(\n account_id="ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n)\nprint(external_account_lookup_response)', }, kotlin: { method: 'receiver().lookupExternalAccount', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.receiver.ReceiverLookupExternalAccountParams\nimport com.lightspark.grid.models.receiver.ReceiverLookupExternalAccountResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val response: ReceiverLookupExternalAccountResponse = client.receiver().lookupExternalAccount("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.receiver.ExternalAccountLookupResponse\nimport com.lightspark.grid.models.receiver.ReceiverLookupExternalAccountParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val externalAccountLookupResponse: ExternalAccountLookupResponse = client.receiver().lookupExternalAccount("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n}', }, go: { method: 'client.Receiver.LookupExternalAccount', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Receiver.LookupExternalAccount(\n\t\tcontext.TODO(),\n\t\t"ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\tgrid.ReceiverLookupExternalAccountParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\texternalAccountLookupResponse, err := client.Receiver.LookupExternalAccount(\n\t\tcontext.TODO(),\n\t\t"ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\tgrid.ReceiverLookupExternalAccountParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", externalAccountLookupResponse)\n}\n', }, ruby: { method: 'receiver.lookup_external_account', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.receiver.lookup_external_account("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nexternal_account_lookup_response = lightspark_grid.receiver.lookup_external_account("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n\nputs(external_account_lookup_response)', }, cli: { method: 'receiver lookup_external_account', @@ -1662,12 +1540,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'receiver->lookupExternalAccount', example: - "receiver->lookupExternalAccount(\n 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n customerID: 'customerId',\n senderUmaAddress: 'senderUmaAddress',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Receiver.LookupExternalAccount', - example: - 'ReceiverLookupExternalAccountParams parameters = new()\n{\n AccountID = "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n};\n\nvar response = await client.Receiver.LookupExternalAccount(parameters);\n\nConsole.WriteLine(response);', + "receiver->lookupExternalAccount(\n 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n customerID: 'customerId',\n senderUmaAddress: 'senderUmaAddress',\n);\n\nvar_dump($externalAccountLookupResponse);", }, http: { example: @@ -1686,9 +1559,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.quotes.retrieve', params: ['quoteId: string;'], response: - "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }", + "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }", markdown: - "## retrieve\n\n`client.quotes.retrieve(quoteId: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }`\n\n**get** `/quotes/{quoteId}`\n\nRetrieve a quote by its ID. If the quote has been settled, it will include\nthe transaction ID. This allows clients to track the full lifecycle of a payment\nfrom quote creation to settlement.\n\n\n### Parameters\n\n- `quoteId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.quotes.retrieve('quoteId');\n\nconsole.log(quote);\n```", + "## retrieve\n\n`client.quotes.retrieve(quoteId: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }`\n\n**get** `/quotes/{quoteId}`\n\nRetrieve a quote by its ID. If the quote has been settled, it will include\nthe transaction ID. This allows clients to track the full lifecycle of a payment\nfrom quote creation to settlement.\n\n\n### Parameters\n\n- `quoteId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `remittanceInformation?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.quotes.retrieve('quoteId');\n\nconsole.log(quote);\n```", perLanguage: { typescript: { method: 'client.quotes.retrieve', @@ -1725,11 +1598,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "quotes->retrieve('quoteId');\n\nvar_dump($quote);", }, - csharp: { - method: 'Quotes.Retrieve', - example: - 'QuoteRetrieveParams parameters = new() { QuoteID = "quoteId" };\n\nvar quote = await client.Quotes.Retrieve(parameters);\n\nConsole.WriteLine(quote);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/quotes/$QUOTE_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1754,13 +1622,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'immediatelyExecute?: boolean;', 'lookupId?: string;', 'purposeOfPayment?: string;', + 'remittanceInformation?: string;', 'senderCustomerInfo?: object;', 'Idempotency-Key?: string;', ], response: - "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }", + "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }", markdown: - "## create\n\n`client.quotes.create(destination: object, lockedCurrencyAmount: number, lockedCurrencySide: 'SENDING' | 'RECEIVING', source: object, description?: string, immediatelyExecute?: boolean, lookupId?: string, purposeOfPayment?: string, senderCustomerInfo?: object, Idempotency-Key?: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }`\n\n**post** `/quotes`\n\nGenerate a quote for a cross-currency transfer between any combination of accounts\nand UMA addresses. This endpoint handles currency exchange and provides the necessary\ninstructions to execute the transfer.\n\n**Transfer Types Supported:**\n- **Account to Account**: Transfer between internal/external accounts with currency exchange.\n- **Account to UMA**: Transfer from an internal account to an UMA address.\n- **UMA to Account or UMA to UMA**: This transfer type will only be funded by payment instructions, not from an internal account.\n\n**Key Features:**\n- **Flexible Amount Locking**: Always specify whether you want to lock the sending amount or receiving amount\n- **Currency Exchange**: Handles all cross-currency transfers with real-time exchange rates\n- **Payment Instructions**: For UMA or customer ID sources, provides banking details needed for execution\n\n**Important:** If you are transferring funds in the same currency (no exchange required),\nuse the `/transfer-in` or `/transfer-out` endpoints instead.\n\n\n### Parameters\n\n- `destination: object`\n\n- `lockedCurrencyAmount: number`\n The amount to send/receive in the smallest unit of the locked currency (eg. cents). See `lockedCurrencySide` for more information.\n\n- `lockedCurrencySide: 'SENDING' | 'RECEIVING'`\n The side of the quote which should be locked and specified in the `lockedCurrencyAmount`. For example, if I want to send exactly $5 MXN from my wallet, I would set this to \"sending\", and the `lockedCurrencyAmount` to 500 (in cents). If I want the receiver to receive exactly $10 USD, I would set this to \"receiving\" and the `lockedCurrencyAmount` to 10000 (in cents).\n\n- `source: object`\n\n- `description?: string`\n Optional description/memo for the transfer\n\n- `immediatelyExecute?: boolean`\n Whether to immediately execute the quote after creation. If true, the quote will be executed and the transaction will be created at the current exchange rate. It should only be used if you don't want to lock and view rate details before executing the quote. If you are executing a pre-existing quote, use the `/quotes/{quoteId}/execute` endpoint instead. This is false by default.\nThis can only be used for quotes with a `source` which is either an internal account, or has direct pull functionality (e.g. ACH pull with an external account).\nNot supported when the `source` is an internal account of type `EMBEDDED_WALLET`: those transfers require a `Grid-Wallet-Signature` over the `payloadToSign` returned in the quote response, which is not available in a combined create-and-execute call. Create the quote first with `immediatelyExecute: false` and then call `POST /quotes/{quoteId}/execute` with the `Grid-Wallet-Signature` stamp header.\n\n- `lookupId?: string`\n Lookup ID from a previous receiver lookup request. If provided, this can make the quote creation more efficient by reusing cached lookup data.\nNOTE: This is required for UMA destinations due to counterparty institution requirements. See `senderCustomerInfo` for more information.\n\n- `purposeOfPayment?: string`\n The purpose of the payment. This may be required when sending to certain geographies (e.g. India).\n\n- `senderCustomerInfo?: object`\n Key-value pairs of additional information about the sender which was requested by the destination. This is relevant when the destination requires more sender info than was provided during customer creation.\nAny fields specified in `requiredPayerDataFields` from the response of the `/receiver/uma/{receiverUmaAddress}` (lookupUma) or `/receiver/external-account/{accountId}` (lookupExternalAccount) endpoints MUST be provided here if they were requested. If the destination did not request any additional information, this field can be omitted.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.quotes.create({\n destination: { destinationType: 'ACCOUNT', accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n});\n\nconsole.log(quote);\n```", + "## create\n\n`client.quotes.create(destination: object, lockedCurrencyAmount: number, lockedCurrencySide: 'SENDING' | 'RECEIVING', source: object, description?: string, immediatelyExecute?: boolean, lookupId?: string, purposeOfPayment?: string, remittanceInformation?: string, senderCustomerInfo?: object, Idempotency-Key?: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }`\n\n**post** `/quotes`\n\nGenerate a quote for a cross-currency transfer between any combination of accounts\nand UMA addresses. This endpoint handles currency exchange and provides the necessary\ninstructions to execute the transfer.\n\n**Transfer Types Supported:**\n- **Account to Account**: Transfer between internal/external accounts with currency exchange.\n- **Account to UMA**: Transfer from an internal account to an UMA address.\n- **UMA to Account or UMA to UMA**: This transfer type will only be funded by payment instructions, not from an internal account.\n\n**Key Features:**\n- **Flexible Amount Locking**: Always specify whether you want to lock the sending amount or receiving amount\n- **Currency Exchange**: Handles all cross-currency transfers with real-time exchange rates\n- **Payment Instructions**: For UMA or customer ID sources, provides banking details needed for execution\n\n**Important:** If you are transferring funds in the same currency (no exchange required),\nuse the `/transfer-in` or `/transfer-out` endpoints instead.\n\n\n### Parameters\n\n- `destination: object`\n\n- `lockedCurrencyAmount: number`\n The amount to send/receive in the smallest unit of the locked currency (eg. cents). See `lockedCurrencySide` for more information.\n\n- `lockedCurrencySide: 'SENDING' | 'RECEIVING'`\n The side of the quote which should be locked and specified in the `lockedCurrencyAmount`. For example, if I want to send exactly $5 MXN from my wallet, I would set this to \"sending\", and the `lockedCurrencyAmount` to 500 (in cents). If I want the receiver to receive exactly $10 USD, I would set this to \"receiving\" and the `lockedCurrencyAmount` to 10000 (in cents).\n\n- `source: object`\n\n- `description?: string`\n Optional description/memo for the transfer\n\n- `immediatelyExecute?: boolean`\n Whether to immediately execute the quote after creation. If true, the quote will be executed and the transaction will be created at the current exchange rate. It should only be used if you don't want to lock and view rate details before executing the quote. If you are executing a pre-existing quote, use the `/quotes/{quoteId}/execute` endpoint instead. This is false by default.\nThis can only be used for quotes with a `source` which is either an internal account, or has direct pull functionality (e.g. ACH pull with an external account).\nNot supported when the `source` is an internal account of type `EMBEDDED_WALLET`: those transfers require a `Grid-Wallet-Signature` over the `payloadToSign` returned in the quote response, which is not available in a combined create-and-execute call. Create the quote first with `immediatelyExecute: false` and then call `POST /quotes/{quoteId}/execute` with the `Grid-Wallet-Signature` stamp header.\n\n- `lookupId?: string`\n Lookup ID from a previous receiver lookup request. If provided, this can make the quote creation more efficient by reusing cached lookup data.\nNOTE: This is required for UMA destinations due to counterparty institution requirements. See `senderCustomerInfo` for more information.\n\n- `purposeOfPayment?: string`\n The purpose of the payment. This may be required when sending to certain geographies (e.g. India).\n\n- `remittanceInformation?: string`\n Free-form information about the payment that travels with it to the recipient. The field this populates depends on the payment rail: for ACH it populates the Addenda record, for FedNow and RTP it populates the remittanceInformation field, and for wires it populates the OBI (Originator to Beneficiary Information) / beneficiary information.\n\n- `senderCustomerInfo?: object`\n Key-value pairs of additional information about the sender which was requested by the destination. This is relevant when the destination requires more sender info than was provided during customer creation.\nAny fields specified in `requiredPayerDataFields` from the response of the `/receiver/uma/{receiverUmaAddress}` (lookupUma) or `/receiver/external-account/{accountId}` (lookupExternalAccount) endpoints MUST be provided here if they were requested. If the destination did not request any additional information, this field can be omitted.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `remittanceInformation?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.quotes.create({\n destination: {},\n lockedCurrencyAmount: 1000,\n lockedCurrencySide: 'SENDING',\n source: {},\n});\n\nconsole.log(quote);\n```", perLanguage: { typescript: { method: 'client.quotes.create', @@ -1775,36 +1644,31 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'quotes().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder()\n .putAdditionalProperty("destinationType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"))\n .build())\n .lockedCurrencyAmount(10000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .build()\n val quote: Quote = client.quotes().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: QuoteRequest = QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\n val quote: Quote = client.quotes().create(params)\n}', }, go: { method: 'client.Quotes.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tquote, err := client.Quotes.New(context.TODO(), grid.QuoteNewParams{\n\t\tDestination: map[string]any{\n\t\t\t"destinationType": "ACCOUNT",\n\t\t\t"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tLockedCurrencyAmount: 10000,\n\t\tLockedCurrencySide: grid.QuoteNewParamsLockedCurrencySideSending,\n\t\tSource: map[string]any{\n\t\t\t"sourceType": "ACCOUNT",\n\t\t\t"accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t\tDescription: grid.String("Transfer between accounts, either internal or external."),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quote.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tquote, err := client.Quotes.New(context.TODO(), grid.QuoteNewParams{\n\t\tQuoteRequest: grid.QuoteRequestParam{\n\t\t\tDestination: map[string]any{},\n\t\t\tLockedCurrencyAmount: 1000,\n\t\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\t\tSource: map[string]any{},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quote.ID)\n}\n', }, ruby: { method: 'quotes.create', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nquote = lightspark_grid.quotes.create(\n destination: {destinationType: "ACCOUNT", accountId: "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"},\n locked_currency_amount: 10000,\n locked_currency_side: :SENDING,\n source: {sourceType: "ACCOUNT", accountId: "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"}\n)\n\nputs(quote)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nquote = lightspark_grid.quotes.create(\n destination: {},\n locked_currency_amount: 1000,\n locked_currency_side: :SENDING,\n source: {}\n)\n\nputs(quote)', }, cli: { method: 'quotes create', example: - "grid quotes create \\\n --username 'My Username' \\\n --password 'My Password' \\\n --destination '{destinationType: ACCOUNT, accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123}' \\\n --locked-currency-amount 10000 \\\n --locked-currency-side SENDING \\\n --source '{sourceType: ACCOUNT, accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965}'", + "grid quotes create \\\n --username 'My Username' \\\n --password 'My Password' \\\n --destination '{}' \\\n --locked-currency-amount 1000 \\\n --locked-currency-side SENDING \\\n --source '{}'", }, php: { method: 'quotes->create', example: - "quotes->create(\n destination: [\n 'destinationType' => 'ACCOUNT',\n 'accountId' => 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n ],\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: [\n 'sourceType' => 'ACCOUNT',\n 'accountId' => 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n ],\n description: 'Transfer between accounts, either internal or external.',\n immediatelyExecute: false,\n lookupID: 'Lookup:019542f5-b3e7-1d02-0000-000000000009',\n purposeOfPayment: 'GIFT',\n senderCustomerInfo: ['FULL_NAME' => 'bar', 'NATIONALITY' => 'bar'],\n idempotencyKey: '',\n);\n\nvar_dump($quote);", - }, - csharp: { - method: 'Quotes.Create', - example: - 'QuoteCreateParams parameters = new()\n{\n Destination = JsonSerializer.Deserialize(\n """\n {\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n }\n """\n ),\n LockedCurrencyAmount = 10000,\n LockedCurrencySide = LockedCurrencySide.Sending,\n Source = JsonSerializer.Deserialize(\n """\n {\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n }\n """\n ),\n};\n\nvar quote = await client.Quotes.Create(parameters);\n\nConsole.WriteLine(quote);', + "quotes->create(\n destination: (object) [],\n lockedCurrencyAmount: 1000,\n lockedCurrencySide: 'SENDING',\n source: (object) [],\n description: 'Invoice #1234 payment',\n immediatelyExecute: false,\n lookupID: 'Lookup:019542f5-b3e7-1d02-0000-000000000009',\n purposeOfPayment: 'GIFT',\n remittanceInformation: '12345',\n senderCustomerInfo: ['FULL_NAME' => 'bar', 'NATIONALITY' => 'bar'],\n idempotencyKey: '',\n);\n\nvar_dump($quote);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/quotes \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "destination": {\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "lockedCurrencyAmount": 10000,\n "lockedCurrencySide": "SENDING",\n "source": {\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "description": "Transfer between accounts, either internal or external.",\n "immediatelyExecute": false,\n "lookupId": "Lookup:019542f5-b3e7-1d02-0000-000000000009",\n "senderCustomerInfo": {\n "FULL_NAME": "bar",\n "NATIONALITY": "bar"\n }\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/quotes \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "destination": {},\n "lockedCurrencyAmount": 1000,\n "lockedCurrencySide": "SENDING",\n "source": {},\n "description": "Invoice #1234 payment",\n "immediatelyExecute": false,\n "lookupId": "Lookup:019542f5-b3e7-1d02-0000-000000000009",\n "remittanceInformation": "12345",\n "senderCustomerInfo": {\n "FULL_NAME": "bar",\n "NATIONALITY": "bar"\n }\n }\'', }, }, }, @@ -1814,14 +1678,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Execute a quote', description: - "Execute a quote by its ID. This endpoint initiates the transfer between\nthe source and destination accounts.\n\nThis endpoint can only be used for quotes with a `source` which is either an internal account,\nor has direct pull functionality (e.g. ACH pull with an external account).\n\nWhen the quote's `source` is an internal account of type `EMBEDDED_WALLET`,\nthe request must include a `Grid-Wallet-Signature` header. The header value\nis the full Turnkey API-key stamp built over the `payloadToSign` value from\nthe quote's `paymentInstructions[].accountOrWalletInfo` entry with the\nsession private key of a verified authentication credential on the source\nEmbedded Wallet.\n\nOnce executed, the quote cannot be cancelled and the transfer will be processed.\n", + "Execute a quote by its ID. This endpoint initiates the transfer between\nthe source and destination accounts.\n\nThis endpoint can only be used for quotes with a `source` which is either an internal account,\nor has direct pull functionality (e.g. ACH pull with an external account).\n\nWhen the quote's `source` is an internal account of type `EMBEDDED_WALLET`,\nthe request must include a `Grid-Wallet-Signature` header. The header value\nis the full Grid wallet signature built over the `payloadToSign` value from\nthe quote's `paymentInstructions[].accountOrWalletInfo` entry with the\nsession private key of a verified authentication credential on the source\nEmbedded Wallet.\n\nOnce executed, the quote cannot be cancelled and the transfer will be processed.\n", stainlessPath: '(resource) quotes > (method) execute', qualified: 'client.quotes.execute', params: ['quoteId: string;', 'Grid-Wallet-Signature?: string;', 'Idempotency-Key?: string;'], response: - "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }", + "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }", markdown: - "## execute\n\n`client.quotes.execute(quoteId: string, Grid-Wallet-Signature?: string, Idempotency-Key?: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }`\n\n**post** `/quotes/{quoteId}/execute`\n\nExecute a quote by its ID. This endpoint initiates the transfer between\nthe source and destination accounts.\n\nThis endpoint can only be used for quotes with a `source` which is either an internal account,\nor has direct pull functionality (e.g. ACH pull with an external account).\n\nWhen the quote's `source` is an internal account of type `EMBEDDED_WALLET`,\nthe request must include a `Grid-Wallet-Signature` header. The header value\nis the full Turnkey API-key stamp built over the `payloadToSign` value from\nthe quote's `paymentInstructions[].accountOrWalletInfo` entry with the\nsession private key of a verified authentication credential on the source\nEmbedded Wallet.\n\nOnce executed, the quote cannot be cancelled and the transfer will be processed.\n\n\n### Parameters\n\n- `quoteId: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.quotes.execute('Quote:019542f5-b3e7-1d02-0000-000000000001');\n\nconsole.log(quote);\n```", + "## execute\n\n`client.quotes.execute(quoteId: string, Grid-Wallet-Signature?: string, Idempotency-Key?: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }`\n\n**post** `/quotes/{quoteId}/execute`\n\nExecute a quote by its ID. This endpoint initiates the transfer between\nthe source and destination accounts.\n\nThis endpoint can only be used for quotes with a `source` which is either an internal account,\nor has direct pull functionality (e.g. ACH pull with an external account).\n\nWhen the quote's `source` is an internal account of type `EMBEDDED_WALLET`,\nthe request must include a `Grid-Wallet-Signature` header. The header value\nis the full Grid wallet signature built over the `payloadToSign` value from\nthe quote's `paymentInstructions[].accountOrWalletInfo` entry with the\nsession private key of a verified authentication credential on the source\nEmbedded Wallet.\n\nOnce executed, the quote cannot be cancelled and the transfer will be processed.\n\n\n### Parameters\n\n- `quoteId: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `remittanceInformation?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.quotes.execute('Quote:019542f5-b3e7-1d02-0000-000000000001');\n\nconsole.log(quote);\n```", perLanguage: { typescript: { method: 'client.quotes.execute', @@ -1858,11 +1722,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "quotes->execute(\n 'Quote:019542f5-b3e7-1d02-0000-000000000001',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n idempotencyKey: '',\n);\n\nvar_dump($quote);", }, - csharp: { - method: 'Quotes.Execute', - example: - 'QuoteExecuteParams parameters = new()\n{\n QuoteID = "Quote:019542f5-b3e7-1d02-0000-000000000001"\n};\n\nvar quote = await client.Quotes.Execute(parameters);\n\nConsole.WriteLine(quote);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/quotes/$QUOTE_ID/execute \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1875,7 +1734,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'get', summary: 'List transactions', description: - 'Retrieve a paginated list of transactions with optional filtering.\nThe transactions can be filtered by customer ID, platform customer ID, UMA address,\ndate range, status, and transaction type.\n', + "Retrieve a paginated list of transactions with optional filtering.\nThe transactions can be filtered by customer ID, platform customer ID, UMA address,\ndate range, status, and transaction type.\n\nCard transactions are included and identified by `type: CARD`. In Sandbox this is how\nyou discover a `CardTransaction` id after simulating an authorization — list the\ntransactions, take the card transaction's `id`, and pass it as the `cardTransactionId`\nto the clearing and return simulate endpoints.\n", stainlessPath: '(resource) transactions > (method) list', qualified: 'client.transactions.list', params: [ @@ -1893,10 +1752,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED';", "type?: 'INCOMING' | 'OUTGOING';", ], - response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }", + response: 'object | object | object', markdown: - "## list\n\n`client.transactions.list(accountIdentifier?: string, cursor?: string, customerId?: string, endDate?: string, limit?: number, platformCustomerId?: string, receiverAccountIdentifier?: string, reference?: string, senderAccountIdentifier?: string, sortOrder?: 'asc' | 'desc', startDate?: string, status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED', type?: 'INCOMING' | 'OUTGOING'): object | object`\n\n**get** `/transactions`\n\nRetrieve a paginated list of transactions with optional filtering.\nThe transactions can be filtered by customer ID, platform customer ID, UMA address,\ndate range, status, and transaction type.\n\n\n### Parameters\n\n- `accountIdentifier?: string`\n Filter by account identifier (matches either sender or receiver)\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by system customer ID. To filter to transactions made on behalf of the platform, specify the platform ID as the customer ID.\n\n- `endDate?: string`\n Filter by end date (inclusive) in ISO 8601 format\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `platformCustomerId?: string`\n Filter by platform-specific customer ID\n\n- `receiverAccountIdentifier?: string`\n Filter by receiver account identifier\n\n- `reference?: string`\n Filter by reference\n\n- `senderAccountIdentifier?: string`\n Filter by sender account identifier\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `startDate?: string`\n Filter by start date (inclusive) in ISO 8601 format\n\n- `status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n Status of a payment transaction.\n\n| Status | Description |\n|--------|-------------|\n| `CREATED` | Initial lookup has been created |\n| `PENDING` | Quote has been created |\n| `PROCESSING` | Funding has been received and payment initiated |\n| `COMPLETED` | Cross border payment has been received, converted and payment has been sent to the offramp network |\n| `REJECTED` | Receiving institution or wallet rejected payment, payment has been refunded |\n| `FAILED` | An error occurred during payment |\n| `REFUNDED` | Payment was unable to complete and refunded |\n| `EXPIRED` | Quote has expired |\n\n- `type?: 'INCOMING' | 'OUTGOING'`\n Type of transaction (incoming payment or outgoing payment)\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const transaction of client.transactions.list()) {\n console.log(transaction);\n}\n```", + "## list\n\n`client.transactions.list(accountIdentifier?: string, cursor?: string, customerId?: string, endDate?: string, limit?: number, platformCustomerId?: string, receiverAccountIdentifier?: string, reference?: string, senderAccountIdentifier?: string, sortOrder?: 'asc' | 'desc', startDate?: string, status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED', type?: 'INCOMING' | 'OUTGOING'): object | object | object`\n\n**get** `/transactions`\n\nRetrieve a paginated list of transactions with optional filtering.\nThe transactions can be filtered by customer ID, platform customer ID, UMA address,\ndate range, status, and transaction type.\n\nCard transactions are included and identified by `type: CARD`. In Sandbox this is how\nyou discover a `CardTransaction` id after simulating an authorization — list the\ntransactions, take the card transaction's `id`, and pass it as the `cardTransactionId`\nto the clearing and return simulate endpoints.\n\n\n### Parameters\n\n- `accountIdentifier?: string`\n Filter by account identifier (matches either sender or receiver)\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by system customer ID. To filter to transactions made on behalf of the platform, specify the platform ID as the customer ID.\n\n- `endDate?: string`\n Filter by end date (inclusive) in ISO 8601 format\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `platformCustomerId?: string`\n Filter by platform-specific customer ID\n\n- `receiverAccountIdentifier?: string`\n Filter by receiver account identifier\n\n- `reference?: string`\n Filter by reference\n\n- `senderAccountIdentifier?: string`\n Filter by sender account identifier\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `startDate?: string`\n Filter by start date (inclusive) in ISO 8601 format\n\n- `status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n Status of a payment transaction.\n\n| Status | Description |\n|--------|-------------|\n| `CREATED` | Initial lookup has been created |\n| `PENDING` | Quote has been created |\n| `PROCESSING` | Funding has been received and payment initiated |\n| `COMPLETED` | Cross border payment has been received, converted and payment has been sent to the offramp network |\n| `REJECTED` | Receiving institution or wallet rejected payment, payment has been refunded |\n| `FAILED` | An error occurred during payment |\n| `REFUNDED` | Payment was unable to complete and refunded |\n| `EXPIRED` | Quote has expired |\n\n- `type?: 'INCOMING' | 'OUTGOING'`\n Type of transaction (incoming payment or outgoing payment)\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\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', @@ -1932,11 +1790,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "transactions->list(\n accountIdentifier: 'accountIdentifier',\n cursor: 'cursor',\n customerID: 'customerId',\n endDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n limit: 1,\n platformCustomerID: 'platformCustomerId',\n receiverAccountIdentifier: 'receiverAccountIdentifier',\n reference: 'reference',\n senderAccountIdentifier: 'senderAccountIdentifier',\n sortOrder: 'asc',\n startDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n status: TransactionStatus::CREATED,\n type: TransactionType::INCOMING,\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Transactions.List', - example: - 'TransactionListParams parameters = new();\n\nvar page = await client.Transactions.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/transactions \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -1952,10 +1805,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) transactions > (method) retrieve', qualified: 'client.transactions.retrieve', params: ['transactionId: string;'], - response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }", + response: 'object | object | object', markdown: - "## retrieve\n\n`client.transactions.retrieve(transactionId: string): object | object`\n\n**get** `/transactions/{transactionId}`\n\nRetrieve detailed information about a specific transaction.\n\n### Parameters\n\n- `transactionId: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.transactions.retrieve('transactionId');\n\nconsole.log(transaction);\n```", + "## retrieve\n\n`client.transactions.retrieve(transactionId: string): object | object | object`\n\n**get** `/transactions/{transactionId}`\n\nRetrieve detailed information about a specific transaction.\n\n### Parameters\n\n- `transactionId: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.transactions.retrieve('transactionId');\n\nconsole.log(transaction);\n```", perLanguage: { typescript: { method: 'client.transactions.retrieve', @@ -1992,11 +1844,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "transactions->retrieve('transactionId');\n\nvar_dump($transaction);", }, - csharp: { - method: 'Transactions.Retrieve', - example: - 'TransactionRetrieveParams parameters = new()\n{\n TransactionID = "transactionId"\n};\n\nvar transaction = await client.Transactions.Retrieve(parameters);\n\nConsole.WriteLine(transaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/transactions/$TRANSACTION_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -2014,9 +1861,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.transactions.approve', params: ['transactionId: string;', 'receiverCustomerInfo?: object;'], response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }", + "{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }", markdown: - "## approve\n\n`client.transactions.approve(transactionId: string, receiverCustomerInfo?: object): { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; }`\n\n**post** `/transactions/{transactionId}/approve`\n\nApprove a pending incoming payment that was previously acknowledged with a 202 response.\nThis endpoint allows platforms to asynchronously approve payments after async processing.\n\n\n### Parameters\n\n- `transactionId: string`\n\n- `receiverCustomerInfo?: object`\n Information about the recipient, provided by the platform if requested in the original webhook via `requestedReceiverCustomerInfoFields`.\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `platformCustomerId: string`\n - `receivedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n - `type: 'INCOMING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `settledAt?: string`\n - `source?: object`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst incomingTransaction = await client.transactions.approve('transactionId');\n\nconsole.log(incomingTransaction);\n```", + "## approve\n\n`client.transactions.approve(transactionId: string, receiverCustomerInfo?: object): { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; }`\n\n**post** `/transactions/{transactionId}/approve`\n\nApprove a pending incoming payment that was previously acknowledged with a 202 response.\nThis endpoint allows platforms to asynchronously approve payments after async processing.\n\n\n### Parameters\n\n- `transactionId: string`\n\n- `receiverCustomerInfo?: object`\n Information about the recipient, provided by the platform if requested in the original webhook via `requestedReceiverCustomerInfoFields`.\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `platformCustomerId: string`\n - `receivedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n - `type: 'INCOMING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `receiptDeliveryConfirmedAt?: string`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `settledAt?: string`\n - `source?: object`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst incomingTransaction = await client.transactions.approve('transactionId');\n\nconsole.log(incomingTransaction);\n```", perLanguage: { typescript: { method: 'client.transactions.approve', @@ -2053,11 +1900,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "transactions->approve(\n 'transactionId', receiverCustomerInfo: ['foo' => 'bar']\n);\n\nvar_dump($incomingTransaction);", }, - csharp: { - method: 'Transactions.Approve', - example: - 'TransactionApproveParams parameters = new() { TransactionID = "transactionId" };\n\nvar incomingTransaction = await client.Transactions.Approve(parameters);\n\nConsole.WriteLine(incomingTransaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/transactions/$TRANSACTION_ID/approve \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -2075,9 +1917,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.transactions.reject', params: ['transactionId: string;', 'reason?: string;'], response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }", + "{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }", markdown: - "## reject\n\n`client.transactions.reject(transactionId: string, reason?: string): { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; }`\n\n**post** `/transactions/{transactionId}/reject`\n\nReject a pending incoming payment that was previously acknowledged with a 202 response.\nThis endpoint allows platforms to asynchronously reject payments after additional processing.\n\n\n### Parameters\n\n- `transactionId: string`\n\n- `reason?: string`\n Optional reason for rejecting the payment. This is just for debugging purposes or can be used for a platform's own purposes.\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `platformCustomerId: string`\n - `receivedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n - `type: 'INCOMING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `settledAt?: string`\n - `source?: object`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst incomingTransaction = await client.transactions.reject('transactionId');\n\nconsole.log(incomingTransaction);\n```", + "## reject\n\n`client.transactions.reject(transactionId: string, reason?: string): { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; }`\n\n**post** `/transactions/{transactionId}/reject`\n\nReject a pending incoming payment that was previously acknowledged with a 202 response.\nThis endpoint allows platforms to asynchronously reject payments after additional processing.\n\n\n### Parameters\n\n- `transactionId: string`\n\n- `reason?: string`\n Optional reason for rejecting the payment. This is just for debugging purposes or can be used for a platform's own purposes.\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `platformCustomerId: string`\n - `receivedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n - `type: 'INCOMING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `receiptDeliveryConfirmedAt?: string`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `settledAt?: string`\n - `source?: object`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst incomingTransaction = await client.transactions.reject('transactionId');\n\nconsole.log(incomingTransaction);\n```", perLanguage: { typescript: { method: 'client.transactions.reject', @@ -2114,11 +1956,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "transactions->reject(\n 'transactionId', reason: 'RESTRICTED_JURISDICTION'\n);\n\nvar_dump($incomingTransaction);", }, - csharp: { - method: 'Transactions.Reject', - example: - 'TransactionRejectParams parameters = new() { TransactionID = "transactionId" };\n\nvar incomingTransaction = await client.Transactions.Reject(parameters);\n\nConsole.WriteLine(incomingTransaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/transactions/$TRANSACTION_ID/reject \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -2152,12 +1989,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'invitations().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.invitations.InvitationCreateParams\nimport com.lightspark.grid.models.invitations.UmaInvitation\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: InvitationCreateParams = InvitationCreateParams.builder()\n .inviterUma("\\$inviter@uma.domain")\n .build()\n val umaInvitation: UmaInvitation = client.invitations().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.invitations.UmaInvitation\nimport com.lightspark.grid.models.invitations.UmaInvitationCreateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: UmaInvitationCreateRequest = UmaInvitationCreateRequest.builder()\n .inviterUma("\\$inviter@uma.domain")\n .build()\n val umaInvitation: UmaInvitation = client.invitations().create(params)\n}', }, go: { method: 'client.Invitations.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tumaInvitation, err := client.Invitations.New(context.TODO(), grid.InvitationNewParams{\n\t\tInviterUma: "$inviter@uma.domain",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", umaInvitation.Code)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tumaInvitation, err := client.Invitations.New(context.TODO(), grid.InvitationNewParams{\n\t\tUmaInvitationCreateRequest: grid.UmaInvitationCreateRequestParam{\n\t\t\tInviterUma: "$inviter@uma.domain",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", umaInvitation.Code)\n}\n', }, ruby: { method: 'invitations.create', @@ -2174,11 +2011,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "invitations->create(\n inviterUma: '$inviter@uma.domain',\n amountToSend: 12550,\n expiresAt: new \\DateTimeImmutable('2025-09-01T14:30:00Z'),\n firstName: 'Alice',\n);\n\nvar_dump($umaInvitation);", }, - csharp: { - method: 'Invitations.Create', - example: - 'InvitationCreateParams parameters = new()\n{\n InviterUma = "$inviter@uma.domain"\n};\n\nvar umaInvitation = await client.Invitations.Create(parameters);\n\nConsole.WriteLine(umaInvitation);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/invitations \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "inviterUma": "$inviter@uma.domain",\n "amountToSend": 12550,\n "expiresAt": "2025-09-01T14:30:00Z",\n "firstName": "Alice"\n }\'', @@ -2234,11 +2066,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "invitations->retrieve('invitationCode');\n\nvar_dump($umaInvitation);", }, - csharp: { - method: 'Invitations.Retrieve', - example: - 'InvitationRetrieveParams parameters = new()\n{\n InvitationCode = "invitationCode"\n};\n\nvar umaInvitation = await client.Invitations.Retrieve(parameters);\n\nConsole.WriteLine(umaInvitation);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/invitations/$INVITATION_CODE \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -2273,12 +2100,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'invitations().claim', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.invitations.InvitationClaimParams\nimport com.lightspark.grid.models.invitations.UmaInvitation\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: InvitationClaimParams = InvitationClaimParams.builder()\n .invitationCode("invitationCode")\n .inviteeUma("\\$invitee@uma.domain")\n .build()\n val umaInvitation: UmaInvitation = client.invitations().claim(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.invitations.InvitationClaimParams\nimport com.lightspark.grid.models.invitations.UmaInvitation\nimport com.lightspark.grid.models.invitations.UmaInvitationClaimRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: InvitationClaimParams = InvitationClaimParams.builder()\n .invitationCode("invitationCode")\n .umaInvitationClaimRequest(UmaInvitationClaimRequest.builder()\n .inviteeUma("\\$invitee@uma.domain")\n .build())\n .build()\n val umaInvitation: UmaInvitation = client.invitations().claim(params)\n}', }, go: { method: 'client.Invitations.Claim', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tumaInvitation, err := client.Invitations.Claim(\n\t\tcontext.TODO(),\n\t\t"invitationCode",\n\t\tgrid.InvitationClaimParams{\n\t\t\tInviteeUma: "$invitee@uma.domain",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", umaInvitation.Code)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tumaInvitation, err := client.Invitations.Claim(\n\t\tcontext.TODO(),\n\t\t"invitationCode",\n\t\tgrid.InvitationClaimParams{\n\t\t\tUmaInvitationClaimRequest: grid.UmaInvitationClaimRequestParam{\n\t\t\t\tInviteeUma: "$invitee@uma.domain",\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", umaInvitation.Code)\n}\n', }, ruby: { method: 'invitations.claim', @@ -2295,11 +2122,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "invitations->claim(\n 'invitationCode', inviteeUma: '$invitee@uma.domain'\n);\n\nvar_dump($umaInvitation);", }, - csharp: { - method: 'Invitations.Claim', - example: - 'InvitationClaimParams parameters = new()\n{\n InvitationCode = "invitationCode",\n InviteeUma = "$invitee@uma.domain",\n};\n\nvar umaInvitation = await client.Invitations.Claim(parameters);\n\nConsole.WriteLine(umaInvitation);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/invitations/$INVITATION_CODE/claim \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "inviteeUma": "$invitee@uma.domain"\n }\'', @@ -2356,11 +2178,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "invitations->cancel('invitationCode');\n\nvar_dump($umaInvitation);", }, - csharp: { - method: 'Invitations.Cancel', - example: - 'InvitationCancelParams parameters = new() { InvitationCode = "invitationCode" };\n\nvar umaInvitation = await client.Invitations.Cancel(parameters);\n\nConsole.WriteLine(umaInvitation);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/invitations/$INVITATION_CODE/cancel \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -2378,9 +2195,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.sandbox.sendFunds', params: ['currencyCode: string;', 'quoteId: string;', 'currencyAmount?: number;'], response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: { amount: number; currency: currency; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; quoteId?: string; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receivedAmount?: { amount: number; currency: currency; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }", + "{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; }", markdown: - "## send_funds\n\n`client.sandbox.sendFunds(currencyCode: string, quoteId: string, currencyAmount?: number): { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }`\n\n**post** `/sandbox/send`\n\nSimulate sending funds to the bank account as instructed in the quote.\nThis endpoint is only for the sandbox environment and will fail for production platforms/keys.\n\n\n### Parameters\n\n- `currencyCode: string`\n Currency code for the funds to be sent\n\n- `quoteId: string`\n The unique identifier of the quote\n\n- `currencyAmount?: number`\n The amount to send in the smallest unit of the currency (eg. cents). If not provided, the amount will be derived from the quote.\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: { amount: number; currency: currency; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; quoteId?: string; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receivedAmount?: { amount: number; currency: currency; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `platformCustomerId: string`\n - `sentAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `type: 'OUTGOING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `exchangeRate?: number`\n - `failureReason?: string`\n - `fees?: number`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `quoteId?: string`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `receivedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }`\n - `settledAt?: string`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst outgoingTransaction = await client.sandbox.sendFunds({ currencyCode: 'USD', quoteId: 'Quote:019542f5-b3e7-1d02-0000-000000000006' });\n\nconsole.log(outgoingTransaction);\n```", + "## send_funds\n\n`client.sandbox.sendFunds(currencyCode: string, quoteId: string, currencyAmount?: number): { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: outgoing_rate_details; receiptDeliveryConfirmedAt?: string; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: refund; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; }`\n\n**post** `/sandbox/send`\n\nSimulate sending funds to the bank account as instructed in the quote.\nThis endpoint is only for the sandbox environment and will fail for production platforms/keys.\n\n\n### Parameters\n\n- `currencyCode: string`\n Currency code for the funds to be sent\n\n- `quoteId: string`\n The unique identifier of the quote\n\n- `currencyAmount?: number`\n The amount to send in the smallest unit of the currency (eg. cents). If not provided, the amount will be derived from the quote.\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: { amount: number; currency: currency; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; receivedAmount?: { amount: number; currency: currency; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `platformCustomerId: string`\n - `sentAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `type: 'OUTGOING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `exchangeRate?: number`\n - `expectedSettlementAt?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `paymentRail?: string`\n - `quoteId?: string`\n - `railSelectionMode?: 'AUTO' | 'MANUAL'`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `receiptDeliveryConfirmedAt?: string`\n - `receivedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }`\n - `settledAt?: string`\n - `settlementTimelineSeconds?: number`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst outgoingTransaction = await client.sandbox.sendFunds({ currencyCode: 'USD', quoteId: 'Quote:019542f5-b3e7-1d02-0000-000000000006' });\n\nconsole.log(outgoingTransaction);\n```", perLanguage: { typescript: { method: 'client.sandbox.sendFunds', @@ -2395,12 +2212,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'sandbox().sendFunds', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.SandboxSendFundsParams\nimport com.lightspark.grid.models.transactions.OutgoingTransaction\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SandboxSendFundsParams = SandboxSendFundsParams.builder()\n .currencyCode("USD")\n .quoteId("Quote:019542f5-b3e7-1d02-0000-000000000006")\n .build()\n val outgoingTransaction: OutgoingTransaction = client.sandbox().sendFunds(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.SendRequest\nimport com.lightspark.grid.models.transactions.OutgoingTransaction\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SendRequest = SendRequest.builder()\n .currencyCode("USD")\n .quoteId("Quote:019542f5-b3e7-1d02-0000-000000000006")\n .build()\n val outgoingTransaction: OutgoingTransaction = client.sandbox().sendFunds(params)\n}', }, go: { method: 'client.Sandbox.SendFunds', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\toutgoingTransaction, err := client.Sandbox.SendFunds(context.TODO(), grid.SandboxSendFundsParams{\n\t\tCurrencyCode: "USD",\n\t\tQuoteID: "Quote:019542f5-b3e7-1d02-0000-000000000006",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", outgoingTransaction.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\toutgoingTransaction, err := client.Sandbox.SendFunds(context.TODO(), grid.SandboxSendFundsParams{\n\t\tSendRequest: grid.SendRequestParam{\n\t\t\tCurrencyCode: "USD",\n\t\t\tQuoteID: "Quote:019542f5-b3e7-1d02-0000-000000000006",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", outgoingTransaction.ID)\n}\n', }, ruby: { method: 'sandbox.send_funds', @@ -2417,11 +2234,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "sandbox->sendFunds(\n currencyCode: 'USD',\n quoteID: 'Quote:019542f5-b3e7-1d02-0000-000000000006',\n currencyAmount: 1000,\n);\n\nvar_dump($outgoingTransaction);", }, - csharp: { - method: 'Sandbox.SendFunds', - example: - 'SandboxSendFundsParams parameters = new()\n{\n CurrencyCode = "USD",\n QuoteID = "Quote:019542f5-b3e7-1d02-0000-000000000006",\n};\n\nvar outgoingTransaction = await client.Sandbox.SendFunds(parameters);\n\nConsole.WriteLine(outgoingTransaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/sandbox/send \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "currencyCode": "USD",\n "quoteId": "Quote:019542f5-b3e7-1d02-0000-000000000006",\n "currencyAmount": 1000\n }\'', @@ -2445,9 +2257,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'receiverUmaAddress?: string;', ], response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }", + "{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }", markdown: - "## receive_payment\n\n`client.sandbox.uma.receivePayment(receivingCurrencyAmount: number, receivingCurrencyCode: string, senderUmaAddress: string, customerId?: string, receiverUmaAddress?: string): { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; }`\n\n**post** `/sandbox/uma/receive`\n\nSimulate sending payment from an sandbox uma address to a platform customer to test payment receive.\nThis endpoint is only for the sandbox environment and will fail for production platforms/keys.\n\n\n### Parameters\n\n- `receivingCurrencyAmount: number`\n The amount to be received in the smallest unit of the currency (eg. cents)\n\n- `receivingCurrencyCode: string`\n The currency code for the receiving amount\n\n- `senderUmaAddress: string`\n UMA address of the sender from the sandbox\n\n- `customerId?: string`\n System ID of the receiver (optional if receiverUmaAddress is provided)\n\n- `receiverUmaAddress?: string`\n UMA address of the receiver (optional if customerId is provided)\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `platformCustomerId: string`\n - `receivedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n - `type: 'INCOMING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `settledAt?: string`\n - `source?: object`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst incomingTransaction = await client.sandbox.uma.receivePayment({\n receivingCurrencyAmount: 1000,\n receivingCurrencyCode: 'USD',\n senderUmaAddress: '$success.usd@sandbox.grid.uma.money',\n});\n\nconsole.log(incomingTransaction);\n```", + "## receive_payment\n\n`client.sandbox.uma.receivePayment(receivingCurrencyAmount: number, receivingCurrencyCode: string, senderUmaAddress: string, customerId?: string, receiverUmaAddress?: string): { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; }`\n\n**post** `/sandbox/uma/receive`\n\nSimulate sending payment from an sandbox uma address to a platform customer to test payment receive.\nThis endpoint is only for the sandbox environment and will fail for production platforms/keys.\n\n\n### Parameters\n\n- `receivingCurrencyAmount: number`\n The amount to be received in the smallest unit of the currency (eg. cents)\n\n- `receivingCurrencyCode: string`\n The currency code for the receiving amount\n\n- `senderUmaAddress: string`\n UMA address of the sender from the sandbox\n\n- `customerId?: string`\n System ID of the receiver (optional if receiverUmaAddress is provided)\n\n- `receiverUmaAddress?: string`\n UMA address of the receiver (optional if customerId is provided)\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: { amount: number; currency: currency; }; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: { reference?: string; transactionHash?: string; }; settledAt?: string; source?: object; updatedAt?: string; }`\n\n - `id: string`\n - `customerId: string`\n - `destination: object`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `platformCustomerId: string`\n - `receivedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n - `type: 'INCOMING'`\n - `agentId?: string`\n - `counterpartyInformation?: object`\n - `createdAt?: string`\n - `description?: string`\n - `failureReason?: string`\n - `fees?: number`\n - `rateDetails?: { gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `receiptDeliveryConfirmedAt?: string`\n - `reconciliationInstructions?: { reference?: string; transactionHash?: string; }`\n - `settledAt?: string`\n - `source?: object`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst incomingTransaction = await client.sandbox.uma.receivePayment({\n receivingCurrencyAmount: 1000,\n receivingCurrencyCode: 'USD',\n senderUmaAddress: '$success.usd@sandbox.grid.uma.money',\n});\n\nconsole.log(incomingTransaction);\n```", perLanguage: { typescript: { method: 'client.sandbox.uma.receivePayment', @@ -2462,12 +2274,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'sandbox().uma().receivePayment', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.uma.UmaReceivePaymentParams\nimport com.lightspark.grid.models.transactions.IncomingTransaction\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: UmaReceivePaymentParams = UmaReceivePaymentParams.builder()\n .receivingCurrencyAmount(1000L)\n .receivingCurrencyCode("USD")\n .senderUmaAddress("\\$success.usd@sandbox.grid.uma.money")\n .build()\n val incomingTransaction: IncomingTransaction = client.sandbox().uma().receivePayment(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.uma.ReceiveRequest\nimport com.lightspark.grid.models.transactions.IncomingTransaction\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: ReceiveRequest = ReceiveRequest.builder()\n .receivingCurrencyAmount(1000L)\n .receivingCurrencyCode("USD")\n .senderUmaAddress("\\$success.usd@sandbox.grid.uma.money")\n .build()\n val incomingTransaction: IncomingTransaction = client.sandbox().uma().receivePayment(params)\n}', }, go: { method: 'client.Sandbox.Uma.ReceivePayment', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tincomingTransaction, err := client.Sandbox.Uma.ReceivePayment(context.TODO(), grid.SandboxUmaReceivePaymentParams{\n\t\tReceivingCurrencyAmount: 1000,\n\t\tReceivingCurrencyCode: "USD",\n\t\tSenderUmaAddress: "$success.usd@sandbox.grid.uma.money",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", incomingTransaction.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tincomingTransaction, err := client.Sandbox.Uma.ReceivePayment(context.TODO(), grid.SandboxUmaReceivePaymentParams{\n\t\tReceiveRequest: grid.ReceiveRequestParam{\n\t\t\tReceivingCurrencyAmount: 1000,\n\t\t\tReceivingCurrencyCode: "USD",\n\t\t\tSenderUmaAddress: "$success.usd@sandbox.grid.uma.money",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", incomingTransaction.ID)\n}\n', }, ruby: { method: 'sandbox.uma.receive_payment', @@ -2484,11 +2296,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "sandbox->uma->receivePayment(\n receivingCurrencyAmount: 1000,\n receivingCurrencyCode: 'USD',\n senderUmaAddress: '$success.usd@sandbox.grid.uma.money',\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n receiverUmaAddress: '$receiver@uma.domain',\n);\n\nvar_dump($incomingTransaction);", }, - csharp: { - method: 'Sandbox.Uma.ReceivePayment', - example: - 'UmaReceivePaymentParams parameters = new()\n{\n ReceivingCurrencyAmount = 1000,\n ReceivingCurrencyCode = "USD",\n SenderUmaAddress = "$success.usd@sandbox.grid.uma.money",\n};\n\nvar incomingTransaction = await client.Sandbox.Uma.ReceivePayment(parameters);\n\nConsole.WriteLine(incomingTransaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/sandbox/uma/receive \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "receivingCurrencyAmount": 1000,\n "receivingCurrencyCode": "USD",\n "senderUmaAddress": "$success.usd@sandbox.grid.uma.money",\n "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",\n "receiverUmaAddress": "$receiver@uma.domain"\n }\'', @@ -2506,9 +2313,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.sandbox.internalAccounts.fund', params: ['accountId: string;', 'amount: number;'], response: - "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", + "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", markdown: - "## fund\n\n`client.sandbox.internalAccounts.fund(accountId: string, amount: number): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**post** `/sandbox/internal-accounts/{accountId}/fund`\n\nSimulate receiving funds into an internal account in the sandbox environment. This is useful for testing scenarios where you need to add funds to a customer's or platform's internal account without going through a real bank transfer or following payment instructions.\nThis endpoint is only for the sandbox environment and will fail for production platforms/keys.\n\n\n### Parameters\n\n- `accountId: string`\n\n- `amount: number`\n Amount to add in the smallest unit of the account's currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst internalAccount = await client.sandbox.internalAccounts.fund('InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', { amount: 100000 });\n\nconsole.log(internalAccount);\n```", + "## fund\n\n`client.sandbox.internalAccounts.fund(accountId: string, amount: number): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: currency_amount; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**post** `/sandbox/internal-accounts/{accountId}/fund`\n\nSimulate receiving funds into an internal account in the sandbox environment. This is useful for testing scenarios where you need to add funds to a customer's or platform's internal account without going through a real bank transfer or following payment instructions.\nThis endpoint is only for the sandbox environment and will fail for production platforms/keys.\n\n\n### Parameters\n\n- `accountId: string`\n\n- `amount: number`\n Amount to add in the smallest unit of the account's currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'`\n - `totalBalance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst internalAccount = await client.sandbox.internalAccounts.fund('InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', { amount: 100000 });\n\nconsole.log(internalAccount);\n```", perLanguage: { typescript: { method: 'client.sandbox.internalAccounts.fund', @@ -2523,12 +2330,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'sandbox().internalAccounts().fund', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.internalaccounts.InternalAccount\nimport com.lightspark.grid.models.sandbox.internalaccounts.InternalAccountFundParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: InternalAccountFundParams = InternalAccountFundParams.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .amount(100000L)\n .build()\n val internalAccount: InternalAccount = client.sandbox().internalAccounts().fund(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.internalaccounts.FundRequest\nimport com.lightspark.grid.models.sandbox.internalaccounts.InternalAccount\nimport com.lightspark.grid.models.sandbox.internalaccounts.InternalAccountFundParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: InternalAccountFundParams = InternalAccountFundParams.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .fundRequest(FundRequest.builder()\n .amount(100000L)\n .build())\n .build()\n val internalAccount: InternalAccount = client.sandbox().internalAccounts().fund(params)\n}', }, go: { method: 'client.Sandbox.InternalAccounts.Fund', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tinternalAccount, err := client.Sandbox.InternalAccounts.Fund(\n\t\tcontext.TODO(),\n\t\t"InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\tgrid.SandboxInternalAccountFundParams{\n\t\t\tAmount: 100000,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", internalAccount.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tinternalAccount, err := client.Sandbox.InternalAccounts.Fund(\n\t\tcontext.TODO(),\n\t\t"InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\tgrid.SandboxInternalAccountFundParams{\n\t\t\tFundRequest: grid.FundRequestParam{\n\t\t\t\tAmount: 100000,\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", internalAccount.ID)\n}\n', }, ruby: { method: 'sandbox.internal_accounts.fund', @@ -2545,11 +2352,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "sandbox->internalAccounts->fund(\n 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', amount: 100000\n);\n\nvar_dump($internalAccount);", }, - csharp: { - method: 'Sandbox.InternalAccounts.Fund', - example: - 'InternalAccountFundParams parameters = new()\n{\n AccountID = "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n Amount = 100000,\n};\n\nvar internalAccount = await client.Sandbox.InternalAccounts.Fund(parameters);\n\nConsole.WriteLine(internalAccount);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/sandbox/internal-accounts/$ACCOUNT_ID/fund \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "amount": 100000\n }\'', @@ -2566,32 +2368,32 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.sandbox.webhooks.sendTest', response: '{ response_status: number; response_body?: string; url?: string; }', markdown: - "## send_test\n\n`client.sandbox.webhooks.sendTest(): { response_status: number; response_body?: string; url?: string; }`\n\n**post** `/sandbox/webhooks/test`\n\nSend a test webhook to the configured endpoint\n\n### Returns\n\n- `{ response_status: number; response_body?: string; url?: string; }`\n\n - `response_status: number`\n - `response_body?: string`\n - `url?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.sandbox.webhooks.sendTest();\n\nconsole.log(response);\n```", + "## send_test\n\n`client.sandbox.webhooks.sendTest(): { response_status: number; response_body?: string; url?: string; }`\n\n**post** `/sandbox/webhooks/test`\n\nSend a test webhook to the configured endpoint\n\n### Returns\n\n- `{ response_status: number; response_body?: string; url?: string; }`\n\n - `response_status: number`\n - `response_body?: string`\n - `url?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst testWebhookResponse = await client.sandbox.webhooks.sendTest();\n\nconsole.log(testWebhookResponse);\n```", perLanguage: { typescript: { method: 'client.sandbox.webhooks.sendTest', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.sandbox.webhooks.sendTest();\n\nconsole.log(response.response_status);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst testWebhookResponse = await client.sandbox.webhooks.sendTest();\n\nconsole.log(testWebhookResponse.response_status);", }, python: { method: 'sandbox.webhooks.send_test', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.sandbox.webhooks.send_test()\nprint(response.response_status)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ntest_webhook_response = client.sandbox.webhooks.send_test()\nprint(test_webhook_response.response_status)', }, kotlin: { method: 'sandbox().webhooks().sendTest', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.webhooks.WebhookSendTestParams\nimport com.lightspark.grid.models.sandbox.webhooks.WebhookSendTestResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val response: WebhookSendTestResponse = client.sandbox().webhooks().sendTest()\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.webhooks.TestWebhookResponse\nimport com.lightspark.grid.models.sandbox.webhooks.WebhookSendTestParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val testWebhookResponse: TestWebhookResponse = client.sandbox().webhooks().sendTest()\n}', }, go: { method: 'client.Sandbox.Webhooks.SendTest', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Sandbox.Webhooks.SendTest(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ResponseStatus)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\ttestWebhookResponse, err := client.Sandbox.Webhooks.SendTest(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", testWebhookResponse.ResponseStatus)\n}\n', }, ruby: { method: 'sandbox.webhooks.send_test', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.sandbox.webhooks.send_test\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ntest_webhook_response = lightspark_grid.sandbox.webhooks.send_test\n\nputs(test_webhook_response)', }, cli: { method: 'webhooks send_test', @@ -2601,12 +2403,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'sandbox->webhooks->sendTest', example: - "sandbox->webhooks->sendTest();\n\nvar_dump($response);", - }, - csharp: { - method: 'Sandbox.Webhooks.SendTest', - example: - 'WebhookSendTestParams parameters = new();\n\nvar response = await client.Sandbox.Webhooks.SendTest(parameters);\n\nConsole.WriteLine(response);', + "sandbox->webhooks->sendTest();\n\nvar_dump($testWebhookResponse);", }, http: { example: @@ -2630,34 +2427,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'merchant: { descriptor: string; country?: string; mcc?: string; };', ], response: - "{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; cardId: string; createdAt: string; merchant: { descriptor: string; country?: string; mcc?: string; }; pullSummary: { count: number; totalAmount: number; pendingCount?: number; }; refundSummary: { count: number; totalAmount: number; }; settlementSummary: { count: number; totalAmount: number; }; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: { amount: number; currency: currency; }; settledAmount?: { amount: number; currency: currency; }; }", + "{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: { descriptor: string; country?: string; mcc?: string; }; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }; refundedAmount?: { amount: number; currency: currency; }; refundSummary?: { count: number; totalAmount: number; }; settledAmount?: { amount: number; currency: currency; }; settlementSummary?: { count: number; totalAmount: number; }; }", markdown: - "## authorization\n\n`client.sandbox.cards.simulate.authorization(id: string, amount: number, currency: { code?: string; decimals?: number; name?: string; symbol?: string; }, merchant: { descriptor: string; country?: string; mcc?: string; }): { id: string; accountId: string; authorizedAmount: currency_amount; authorizedAt: string; cardId: string; createdAt: string; merchant: card_merchant; pullSummary: card_pull_summary; refundSummary: card_refund_summary; settlementSummary: card_settlement_summary; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: currency_amount; settledAmount?: currency_amount; }`\n\n**post** `/sandbox/cards/{id}/simulate/authorization`\n\nSimulate an inbound card authorization in the sandbox environment. Drives the same internal `authorize` + `reconcile` paths the card issuer would call in production, so platforms can exercise Grid's decisioning + funding-source pull behavior end-to-end without an external network round-trip.\n\nThe decisioning outcome is controlled by the last three characters of `merchant.descriptor`:\n\n| Suffix | Outcome | | ------ | ------- | | `002` | Decline — `INSUFFICIENT_FUNDS` (the pull on the funding source fails) | | `003` | Decline — `CARD_PAUSED` (intended to verify a frozen card refuses auths) | | `005` | Delayed pull (~30s) — exercises the `PENDING → CONFIRMED` path | | `006` | Pull succeeds but the confirmation event reports `FAILED` — exercises the high-urgency `EXCEPTION` alert | | any other | Approved |\n\nProduction returns `404` on this path.\n\n\n### Parameters\n\n- `id: string`\n\n- `amount: number`\n Authorization amount in the smallest unit of `currency` (e.g. cents for USD).\n\n- `currency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `code?: string`\n Three-letter currency code (ISO 4217) for fiat currencies. Some cryptocurrencies may use their own ticker symbols (e.g. \"BTC\" for Bitcoin, \"USDC\" for USDC, etc.)\n - `decimals?: number`\n Number of decimal places for the currency\n - `name?: string`\n Full name of the currency\n - `symbol?: string`\n Symbol of the currency\n\n- `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `descriptor: string`\n Merchant descriptor string captured from the card network at authorization time.\n - `country?: string`\n Two-letter ISO 3166-1 alpha-2 country code of the merchant.\n - `mcc?: string`\n Merchant Category Code (ISO 18245) — four-digit numeric string.\n\n### Returns\n\n- `{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; cardId: string; createdAt: string; merchant: { descriptor: string; country?: string; mcc?: string; }; pullSummary: { count: number; totalAmount: number; pendingCount?: number; }; refundSummary: { count: number; totalAmount: number; }; settlementSummary: { count: number; totalAmount: number; }; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: { amount: number; currency: currency; }; settledAmount?: { amount: number; currency: currency; }; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n - `id: string`\n - `accountId: string`\n - `authorizedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `authorizedAt: string`\n - `cardId: string`\n - `createdAt: string`\n - `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `pullSummary: { count: number; totalAmount: number; pendingCount?: number; }`\n - `refundSummary: { count: number; totalAmount: number; }`\n - `settlementSummary: { count: number; totalAmount: number; }`\n - `status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'`\n - `updatedAt: string`\n - `issuerTransactionToken?: string`\n - `lastEventAt?: string`\n - `refundedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `settledAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.sandbox.cards.simulate.authorization('Card:019542f5-b3e7-1d02-0000-000000000010', {\n amount: 1250,\n currency: {},\n merchant: { descriptor: 'BLUE BOTTLE COFFEE SF' },\n});\n\nconsole.log(response);\n```", + "## authorization\n\n`client.sandbox.cards.simulate.authorization(id: string, amount: number, currency: { code?: string; decimals?: number; name?: string; symbol?: string; }, merchant: { descriptor: string; country?: string; mcc?: string; }): { id: string; accountId: string; authorizedAmount: currency_amount; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: card_merchant; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: card_pull_summary; refundedAmount?: currency_amount; refundSummary?: card_refund_summary; settledAmount?: currency_amount; settlementSummary?: card_settlement_summary; }`\n\n**post** `/sandbox/cards/{id}/simulate/authorization`\n\nSimulate an inbound card authorization in the sandbox environment. Drives the same internal `authorize` + `reconcile` paths the card issuer would call in production, so platforms can exercise Grid's decisioning + funding-source pull behavior end-to-end without an external network round-trip.\n\nThe decisioning outcome is controlled by the last three characters of `merchant.descriptor`:\n\n| Suffix | Outcome | | ------ | ------- | | `002` | Decline — `INSUFFICIENT_FUNDS` (the pull on the funding source fails) | | `003` | Decline — `CARD_PAUSED` (intended to verify a frozen card refuses auths) | | `005` | Delayed pull (~30s) — exercises the `PENDING → CONFIRMED` path | | `006` | Pull succeeds but the confirmation event reports `FAILED` — exercises the high-urgency `EXCEPTION` alert | | any other | Approved |\n\nProduction returns `404` on this path.\n\n\n### Parameters\n\n- `id: string`\n\n- `amount: number`\n Authorization amount in the smallest unit of `currency` (e.g. cents for USD).\n\n- `currency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `code?: string`\n Three-letter currency code (ISO 4217) for fiat currencies. Some cryptocurrencies may use their own ticker symbols (e.g. \"BTC\" for Bitcoin, \"USDC\" for USDC, etc.)\n - `decimals?: number`\n Number of decimal places for the currency\n - `name?: string`\n Full name of the currency\n - `symbol?: string`\n Symbol of the currency\n\n- `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `descriptor: string`\n Merchant descriptor string captured from the card network at authorization time.\n - `country?: string`\n Two-letter ISO 3166-1 alpha-2 country code of the merchant.\n - `mcc?: string`\n Merchant Category Code (ISO 18245) — four-digit numeric string.\n\n### Returns\n\n- `{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: { descriptor: string; country?: string; mcc?: string; }; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }; refundedAmount?: { amount: number; currency: currency; }; refundSummary?: { count: number; totalAmount: number; }; settledAmount?: { amount: number; currency: currency; }; settlementSummary?: { count: number; totalAmount: number; }; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n - `id: string`\n - `accountId: string`\n - `authorizedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `authorizedAt: string`\n - `createdAt: string`\n - `customerId: string`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `platformCustomerId: string`\n - `status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'`\n - `type: 'CARD'`\n - `updatedAt: string`\n - `cardId?: string`\n - `issuerTransactionToken?: string`\n - `lastEventAt?: string`\n - `pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }`\n - `refundedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `refundSummary?: { count: number; totalAmount: number; }`\n - `settledAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `settlementSummary?: { count: number; totalAmount: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst cardTransaction = await client.sandbox.cards.simulate.authorization('Card:019542f5-b3e7-1d02-0000-000000000010', {\n amount: 1250,\n currency: {},\n merchant: { descriptor: 'BLUE BOTTLE COFFEE SF' },\n});\n\nconsole.log(cardTransaction);\n```", perLanguage: { typescript: { method: 'client.sandbox.cards.simulate.authorization', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.sandbox.cards.simulate.authorization(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n {\n amount: 1250,\n currency: { code: 'USD' },\n merchant: {\n descriptor: 'BLUE BOTTLE COFFEE SF',\n mcc: '5814',\n country: 'US',\n },\n },\n);\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst cardTransaction = await client.sandbox.cards.simulate.authorization(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n {\n amount: 1250,\n currency: { code: 'USD' },\n merchant: {\n descriptor: 'BLUE BOTTLE COFFEE SF',\n mcc: '5814',\n country: 'US',\n },\n },\n);\n\nconsole.log(cardTransaction.id);", }, python: { method: 'sandbox.cards.simulate.authorization', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.sandbox.cards.simulate.authorization(\n id="Card:019542f5-b3e7-1d02-0000-000000000010",\n amount=1250,\n currency={\n "code": "USD"\n },\n merchant={\n "descriptor": "BLUE BOTTLE COFFEE SF",\n "mcc": "5814",\n "country": "US",\n },\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncard_transaction = client.sandbox.cards.simulate.authorization(\n id="Card:019542f5-b3e7-1d02-0000-000000000010",\n amount=1250,\n currency={\n "code": "USD"\n },\n merchant={\n "descriptor": "BLUE BOTTLE COFFEE SF",\n "mcc": "5814",\n "country": "US",\n },\n)\nprint(card_transaction.id)', }, kotlin: { method: 'sandbox().cards().simulate().authorization', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.quotes.Currency\nimport com.lightspark.grid.models.sandbox.cards.simulate.CardMerchant\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateAuthorizationParams\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateAuthorizationResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SimulateAuthorizationParams = SimulateAuthorizationParams.builder()\n .id("Card:019542f5-b3e7-1d02-0000-000000000010")\n .amount(1250L)\n .currency(Currency.builder().build())\n .merchant(CardMerchant.builder()\n .descriptor("BLUE BOTTLE COFFEE SF")\n .build())\n .build()\n val response: SimulateAuthorizationResponse = client.sandbox().cards().simulate().authorization(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.CardTransaction\nimport com.lightspark.grid.models.quotes.Currency\nimport com.lightspark.grid.models.sandbox.cards.simulate.AuthorizationRequest\nimport com.lightspark.grid.models.sandbox.cards.simulate.CardMerchant\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateAuthorizationParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SimulateAuthorizationParams = SimulateAuthorizationParams.builder()\n .id("Card:019542f5-b3e7-1d02-0000-000000000010")\n .authorizationRequest(AuthorizationRequest.builder()\n .amount(1250L)\n .currency(Currency.builder().build())\n .merchant(CardMerchant.builder()\n .descriptor("BLUE BOTTLE COFFEE SF")\n .build())\n .build())\n .build()\n val cardTransaction: CardTransaction = client.sandbox().cards().simulate().authorization(params)\n}', }, go: { method: 'client.Sandbox.Cards.Simulate.Authorization', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Sandbox.Cards.Simulate.Authorization(\n\t\tcontext.TODO(),\n\t\t"Card:019542f5-b3e7-1d02-0000-000000000010",\n\t\tgrid.SandboxCardSimulateAuthorizationParams{\n\t\t\tAmount: 1250,\n\t\t\tCurrency: grid.CurrencyParam{\n\t\t\t\tCode: grid.String("USD"),\n\t\t\t},\n\t\t\tMerchant: grid.CardMerchantParam{\n\t\t\t\tDescriptor: "BLUE BOTTLE COFFEE SF",\n\t\t\t\tMcc: grid.String("5814"),\n\t\t\t\tCountry: grid.String("US"),\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", response.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcardTransaction, err := client.Sandbox.Cards.Simulate.Authorization(\n\t\tcontext.TODO(),\n\t\t"Card:019542f5-b3e7-1d02-0000-000000000010",\n\t\tgrid.SandboxCardSimulateAuthorizationParams{\n\t\t\tAuthorizationRequest: grid.AuthorizationRequestParam{\n\t\t\t\tAmount: 1250,\n\t\t\t\tCurrency: grid.CurrencyParam{},\n\t\t\t\tMerchant: grid.CardMerchantParam{\n\t\t\t\t\tDescriptor: "BLUE BOTTLE COFFEE SF",\n\t\t\t\t},\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", cardTransaction.ID)\n}\n', }, ruby: { method: 'sandbox.cards.simulate.authorization', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.sandbox.cards.simulate.authorization(\n "Card:019542f5-b3e7-1d02-0000-000000000010",\n amount: 1250,\n currency: {},\n merchant: {descriptor: "BLUE BOTTLE COFFEE SF"}\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncard_transaction = lightspark_grid.sandbox.cards.simulate.authorization(\n "Card:019542f5-b3e7-1d02-0000-000000000010",\n amount: 1250,\n currency: {},\n merchant: {descriptor: "BLUE BOTTLE COFFEE SF"}\n)\n\nputs(card_transaction)', }, cli: { method: 'simulate authorization', @@ -2667,16 +2464,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'sandbox->cards->simulate->authorization', example: - "sandbox->cards->simulate->authorization(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n amount: 1250,\n currency: [\n 'code' => 'USD',\n 'decimals' => 2,\n 'name' => 'United States Dollar',\n 'symbol' => '$',\n ],\n merchant: [\n 'descriptor' => 'BLUE BOTTLE COFFEE SF', 'country' => 'US', 'mcc' => '5814'\n ],\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Sandbox.Cards.Simulate.Authorization', - example: - 'SimulateAuthorizationParams parameters = new()\n{\n ID = "Card:019542f5-b3e7-1d02-0000-000000000010",\n Amount = 1250,\n Currency = new()\n {\n Code = "USD",\n Decimals = 2,\n Name = "United States Dollar",\n Symbol = "$",\n },\n Merchant = new()\n {\n Descriptor = "BLUE BOTTLE COFFEE SF",\n Country = "US",\n Mcc = "5814",\n },\n};\n\nvar response = await client.Sandbox.Cards.Simulate.Authorization(parameters);\n\nConsole.WriteLine(response);', + "sandbox->cards->simulate->authorization(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n amount: 1250,\n currency: [\n 'code' => 'USD',\n 'decimals' => 2,\n 'name' => 'United States Dollar',\n 'symbol' => '$',\n ],\n merchant: [\n 'descriptor' => 'BLUE BOTTLE COFFEE SF', 'country' => 'US', 'mcc' => '5814'\n ],\n);\n\nvar_dump($cardTransaction);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/sandbox/cards/$ID/simulate/authorization \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "amount": 1250,\n "currency": {\n "code": "USD"\n },\n "merchant": {\n "descriptor": "BLUE BOTTLE COFFEE SF",\n "country": "US",\n "mcc": "5814"\n }\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/sandbox/cards/$ID/simulate/authorization \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "amount": 1250,\n "currency": {},\n "merchant": {\n "descriptor": "BLUE BOTTLE COFFEE SF"\n }\n }\'', }, }, }, @@ -2691,34 +2483,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.sandbox.cards.simulate.clearing', params: ['id: string;', 'amount: number;', 'cardTransactionId: string;'], response: - "{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; cardId: string; createdAt: string; merchant: { descriptor: string; country?: string; mcc?: string; }; pullSummary: { count: number; totalAmount: number; pendingCount?: number; }; refundSummary: { count: number; totalAmount: number; }; settlementSummary: { count: number; totalAmount: number; }; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: { amount: number; currency: currency; }; settledAmount?: { amount: number; currency: currency; }; }", + "{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: { descriptor: string; country?: string; mcc?: string; }; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }; refundedAmount?: { amount: number; currency: currency; }; refundSummary?: { count: number; totalAmount: number; }; settledAmount?: { amount: number; currency: currency; }; settlementSummary?: { count: number; totalAmount: number; }; }", markdown: - "## clearing\n\n`client.sandbox.cards.simulate.clearing(id: string, amount: number, cardTransactionId: string): { id: string; accountId: string; authorizedAmount: currency_amount; authorizedAt: string; cardId: string; createdAt: string; merchant: card_merchant; pullSummary: card_pull_summary; refundSummary: card_refund_summary; settlementSummary: card_settlement_summary; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: currency_amount; settledAmount?: currency_amount; }`\n\n**post** `/sandbox/cards/{id}/simulate/clearing`\n\nSimulate a clearing (settlement) event against an existing `CardTransaction` in the sandbox environment.\n\n- A clearing `amount` greater than the authorized amount exercises the over-auth post-hoc-pull path (e.g. restaurant tip on top of a 20% over-auth).\n- A clearing `amount` of `0` exercises the `AUTHORIZATION_EXPIRY` path — the auth expires with no clearing posted.\n- Suffix-driven outcomes on the parent transaction's id govern whether the post-hoc pull succeeds (use the suffix table from `simulate/authorization` to construct deterministic test cases).\n\nProduction returns `404` on this path.\n\n\n### Parameters\n\n- `id: string`\n\n- `amount: number`\n Clearing amount in the smallest unit of the transaction's currency. Set to `0` to simulate an authorization expiry with no clearing.\n\n- `cardTransactionId: string`\n The id of the `CardTransaction` to clear against. Must be in `AUTHORIZED` or `PARTIALLY_SETTLED` state.\n\n### Returns\n\n- `{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; cardId: string; createdAt: string; merchant: { descriptor: string; country?: string; mcc?: string; }; pullSummary: { count: number; totalAmount: number; pendingCount?: number; }; refundSummary: { count: number; totalAmount: number; }; settlementSummary: { count: number; totalAmount: number; }; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: { amount: number; currency: currency; }; settledAmount?: { amount: number; currency: currency; }; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n - `id: string`\n - `accountId: string`\n - `authorizedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `authorizedAt: string`\n - `cardId: string`\n - `createdAt: string`\n - `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `pullSummary: { count: number; totalAmount: number; pendingCount?: number; }`\n - `refundSummary: { count: number; totalAmount: number; }`\n - `settlementSummary: { count: number; totalAmount: number; }`\n - `status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'`\n - `updatedAt: string`\n - `issuerTransactionToken?: string`\n - `lastEventAt?: string`\n - `refundedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `settledAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.sandbox.cards.simulate.clearing('Card:019542f5-b3e7-1d02-0000-000000000010', { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' });\n\nconsole.log(response);\n```", + "## clearing\n\n`client.sandbox.cards.simulate.clearing(id: string, amount: number, cardTransactionId: string): { id: string; accountId: string; authorizedAmount: currency_amount; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: card_merchant; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: card_pull_summary; refundedAmount?: currency_amount; refundSummary?: card_refund_summary; settledAmount?: currency_amount; settlementSummary?: card_settlement_summary; }`\n\n**post** `/sandbox/cards/{id}/simulate/clearing`\n\nSimulate a clearing (settlement) event against an existing `CardTransaction` in the sandbox environment.\n\n- A clearing `amount` greater than the authorized amount exercises the over-auth post-hoc-pull path (e.g. restaurant tip on top of a 20% over-auth).\n- A clearing `amount` of `0` exercises the `AUTHORIZATION_EXPIRY` path — the auth expires with no clearing posted.\n- Suffix-driven outcomes on the parent transaction's id govern whether the post-hoc pull succeeds (use the suffix table from `simulate/authorization` to construct deterministic test cases).\n\nProduction returns `404` on this path.\n\n\n### Parameters\n\n- `id: string`\n\n- `amount: number`\n Clearing amount in the smallest unit of the transaction's currency. Set to `0` to simulate an authorization expiry with no clearing.\n\n- `cardTransactionId: string`\n The id of the `CardTransaction` to clear against. Must be in `AUTHORIZED` or `PARTIALLY_SETTLED` state.\n\n### Returns\n\n- `{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: { descriptor: string; country?: string; mcc?: string; }; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }; refundedAmount?: { amount: number; currency: currency; }; refundSummary?: { count: number; totalAmount: number; }; settledAmount?: { amount: number; currency: currency; }; settlementSummary?: { count: number; totalAmount: number; }; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n - `id: string`\n - `accountId: string`\n - `authorizedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `authorizedAt: string`\n - `createdAt: string`\n - `customerId: string`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `platformCustomerId: string`\n - `status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'`\n - `type: 'CARD'`\n - `updatedAt: string`\n - `cardId?: string`\n - `issuerTransactionToken?: string`\n - `lastEventAt?: string`\n - `pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }`\n - `refundedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `refundSummary?: { count: number; totalAmount: number; }`\n - `settledAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `settlementSummary?: { count: number; totalAmount: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst cardTransaction = await client.sandbox.cards.simulate.clearing('Card:019542f5-b3e7-1d02-0000-000000000010', { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' });\n\nconsole.log(cardTransaction);\n```", perLanguage: { typescript: { method: 'client.sandbox.cards.simulate.clearing', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.sandbox.cards.simulate.clearing(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' },\n);\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst cardTransaction = await client.sandbox.cards.simulate.clearing(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' },\n);\n\nconsole.log(cardTransaction.id);", }, python: { method: 'sandbox.cards.simulate.clearing', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.sandbox.cards.simulate.clearing(\n id="Card:019542f5-b3e7-1d02-0000-000000000010",\n amount=1500,\n card_transaction_id="CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncard_transaction = client.sandbox.cards.simulate.clearing(\n id="Card:019542f5-b3e7-1d02-0000-000000000010",\n amount=1500,\n card_transaction_id="CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n)\nprint(card_transaction.id)', }, kotlin: { method: 'sandbox().cards().simulate().clearing', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateClearingParams\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateClearingResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SimulateClearingParams = SimulateClearingParams.builder()\n .id("Card:019542f5-b3e7-1d02-0000-000000000010")\n .amount(1500L)\n .cardTransactionId("CardTransaction:019542f5-b3e7-1d02-0000-000000000100")\n .build()\n val response: SimulateClearingResponse = client.sandbox().cards().simulate().clearing(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.CardTransaction\nimport com.lightspark.grid.models.sandbox.cards.simulate.ClearingRequest\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateClearingParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SimulateClearingParams = SimulateClearingParams.builder()\n .id("Card:019542f5-b3e7-1d02-0000-000000000010")\n .clearingRequest(ClearingRequest.builder()\n .amount(1500L)\n .cardTransactionId("CardTransaction:019542f5-b3e7-1d02-0000-000000000100")\n .build())\n .build()\n val cardTransaction: CardTransaction = client.sandbox().cards().simulate().clearing(params)\n}', }, go: { method: 'client.Sandbox.Cards.Simulate.Clearing', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Sandbox.Cards.Simulate.Clearing(\n\t\tcontext.TODO(),\n\t\t"Card:019542f5-b3e7-1d02-0000-000000000010",\n\t\tgrid.SandboxCardSimulateClearingParams{\n\t\t\tAmount: 1500,\n\t\t\tCardTransactionID: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcardTransaction, err := client.Sandbox.Cards.Simulate.Clearing(\n\t\tcontext.TODO(),\n\t\t"Card:019542f5-b3e7-1d02-0000-000000000010",\n\t\tgrid.SandboxCardSimulateClearingParams{\n\t\t\tClearingRequest: grid.ClearingRequestParam{\n\t\t\t\tAmount: 1500,\n\t\t\t\tCardTransactionID: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\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", cardTransaction.ID)\n}\n', }, ruby: { method: 'sandbox.cards.simulate.clearing', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.sandbox.cards.simulate.clearing(\n "Card:019542f5-b3e7-1d02-0000-000000000010",\n amount: 1500,\n card_transaction_id: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100"\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncard_transaction = lightspark_grid.sandbox.cards.simulate.clearing(\n "Card:019542f5-b3e7-1d02-0000-000000000010",\n amount: 1500,\n card_transaction_id: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100"\n)\n\nputs(card_transaction)', }, cli: { method: 'simulate clearing', @@ -2728,12 +2520,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'sandbox->cards->simulate->clearing', example: - "sandbox->cards->simulate->clearing(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n amount: 1500,\n cardTransactionID: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Sandbox.Cards.Simulate.Clearing', - example: - 'SimulateClearingParams parameters = new()\n{\n ID = "Card:019542f5-b3e7-1d02-0000-000000000010",\n Amount = 1500,\n CardTransactionID = "CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n};\n\nvar response = await client.Sandbox.Cards.Simulate.Clearing(parameters);\n\nConsole.WriteLine(response);', + "sandbox->cards->simulate->clearing(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n amount: 1500,\n cardTransactionID: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100',\n);\n\nvar_dump($cardTransaction);", }, http: { example: @@ -2752,34 +2539,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.sandbox.cards.simulate.return', params: ['id: string;', 'amount: number;', 'cardTransactionId: string;'], response: - "{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; cardId: string; createdAt: string; merchant: { descriptor: string; country?: string; mcc?: string; }; pullSummary: { count: number; totalAmount: number; pendingCount?: number; }; refundSummary: { count: number; totalAmount: number; }; settlementSummary: { count: number; totalAmount: number; }; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: { amount: number; currency: currency; }; settledAmount?: { amount: number; currency: currency; }; }", + "{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: { descriptor: string; country?: string; mcc?: string; }; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }; refundedAmount?: { amount: number; currency: currency; }; refundSummary?: { count: number; totalAmount: number; }; settledAmount?: { amount: number; currency: currency; }; settlementSummary?: { count: number; totalAmount: number; }; }", markdown: - "## return\n\n`client.sandbox.cards.simulate.return(id: string, amount: number, cardTransactionId: string): { id: string; accountId: string; authorizedAmount: currency_amount; authorizedAt: string; cardId: string; createdAt: string; merchant: card_merchant; pullSummary: card_pull_summary; refundSummary: card_refund_summary; settlementSummary: card_settlement_summary; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: currency_amount; settledAmount?: currency_amount; }`\n\n**post** `/sandbox/cards/{id}/simulate/return`\n\nSimulate a merchant-initiated `RETURN` against an existing settled card transaction in the sandbox environment. Creates a `CardRefund` on the parent and either flips the parent to `REFUNDED` (full refund) or keeps it `SETTLED` with a non-zero `refundedAmount` (partial refund).\n\nProduction returns `404` on this path.\n\n\n### Parameters\n\n- `id: string`\n\n- `amount: number`\n Return amount in the smallest unit of the transaction's currency. Must be less than or equal to the net settled amount (settled minus previously-refunded).\n\n- `cardTransactionId: string`\n The id of the `CardTransaction` to refund against. Must have at least one settled clearing.\n\n### Returns\n\n- `{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; cardId: string; createdAt: string; merchant: { descriptor: string; country?: string; mcc?: string; }; pullSummary: { count: number; totalAmount: number; pendingCount?: number; }; refundSummary: { count: number; totalAmount: number; }; settlementSummary: { count: number; totalAmount: number; }; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; updatedAt: string; issuerTransactionToken?: string; lastEventAt?: string; refundedAmount?: { amount: number; currency: currency; }; settledAmount?: { amount: number; currency: currency; }; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n - `id: string`\n - `accountId: string`\n - `authorizedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `authorizedAt: string`\n - `cardId: string`\n - `createdAt: string`\n - `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `pullSummary: { count: number; totalAmount: number; pendingCount?: number; }`\n - `refundSummary: { count: number; totalAmount: number; }`\n - `settlementSummary: { count: number; totalAmount: number; }`\n - `status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'`\n - `updatedAt: string`\n - `issuerTransactionToken?: string`\n - `lastEventAt?: string`\n - `refundedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `settledAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.sandbox.cards.simulate.return('Card:019542f5-b3e7-1d02-0000-000000000010', { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' });\n\nconsole.log(response);\n```", + "## return\n\n`client.sandbox.cards.simulate.return(id: string, amount: number, cardTransactionId: string): { id: string; accountId: string; authorizedAmount: currency_amount; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: card_merchant; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: card_pull_summary; refundedAmount?: currency_amount; refundSummary?: card_refund_summary; settledAmount?: currency_amount; settlementSummary?: card_settlement_summary; }`\n\n**post** `/sandbox/cards/{id}/simulate/return`\n\nSimulate a merchant-initiated `RETURN` against an existing settled card transaction in the sandbox environment. Creates a `CardRefund` on the parent and either flips the parent to `REFUNDED` (full refund) or keeps it `SETTLED` with a non-zero `refundedAmount` (partial refund).\n\nProduction returns `404` on this path.\n\n\n### Parameters\n\n- `id: string`\n\n- `amount: number`\n Return amount in the smallest unit of the transaction's currency. Must be less than or equal to the net settled amount (settled minus previously-refunded).\n\n- `cardTransactionId: string`\n The id of the `CardTransaction` to refund against. Must have at least one settled clearing.\n\n### Returns\n\n- `{ id: string; accountId: string; authorizedAmount: { amount: number; currency: currency; }; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: { descriptor: string; country?: string; mcc?: string; }; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }; refundedAmount?: { amount: number; currency: currency; }; refundSummary?: { count: number; totalAmount: number; }; settledAmount?: { amount: number; currency: currency; }; settlementSummary?: { count: number; totalAmount: number; }; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n - `id: string`\n - `accountId: string`\n - `authorizedAmount: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `authorizedAt: string`\n - `createdAt: string`\n - `customerId: string`\n - `direction: 'CREDIT' | 'DEBIT'`\n - `merchant: { descriptor: string; country?: string; mcc?: string; }`\n - `platformCustomerId: string`\n - `status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'`\n - `type: 'CARD'`\n - `updatedAt: string`\n - `cardId?: string`\n - `issuerTransactionToken?: string`\n - `lastEventAt?: string`\n - `pullSummary?: { count: number; totalAmount: number; pendingCount?: number; }`\n - `refundedAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `refundSummary?: { count: number; totalAmount: number; }`\n - `settledAmount?: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `settlementSummary?: { count: number; totalAmount: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst cardTransaction = await client.sandbox.cards.simulate.return('Card:019542f5-b3e7-1d02-0000-000000000010', { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' });\n\nconsole.log(cardTransaction);\n```", perLanguage: { typescript: { method: 'client.sandbox.cards.simulate.return', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.sandbox.cards.simulate.return(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' },\n);\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst cardTransaction = await client.sandbox.cards.simulate.return(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n { amount: 1500, cardTransactionId: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100' },\n);\n\nconsole.log(cardTransaction.id);", }, python: { method: 'sandbox.cards.simulate.return_', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.sandbox.cards.simulate.return_(\n id="Card:019542f5-b3e7-1d02-0000-000000000010",\n amount=1500,\n card_transaction_id="CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncard_transaction = client.sandbox.cards.simulate.return_(\n id="Card:019542f5-b3e7-1d02-0000-000000000010",\n amount=1500,\n card_transaction_id="CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n)\nprint(card_transaction.id)', }, kotlin: { method: 'sandbox().cards().simulate().return_', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateReturnParams\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateReturnResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SimulateReturnParams = SimulateReturnParams.builder()\n .id("Card:019542f5-b3e7-1d02-0000-000000000010")\n .amount(1500L)\n .cardTransactionId("CardTransaction:019542f5-b3e7-1d02-0000-000000000100")\n .build()\n val response: SimulateReturnResponse = client.sandbox().cards().simulate().return_(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.CardTransaction\nimport com.lightspark.grid.models.sandbox.cards.simulate.RefundRequest\nimport com.lightspark.grid.models.sandbox.cards.simulate.SimulateReturnParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SimulateReturnParams = SimulateReturnParams.builder()\n .id("Card:019542f5-b3e7-1d02-0000-000000000010")\n .refundRequest(RefundRequest.builder()\n .amount(1500L)\n .cardTransactionId("CardTransaction:019542f5-b3e7-1d02-0000-000000000100")\n .build())\n .build()\n val cardTransaction: CardTransaction = client.sandbox().cards().simulate().return_(params)\n}', }, go: { method: 'client.Sandbox.Cards.Simulate.Return', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Sandbox.Cards.Simulate.Return(\n\t\tcontext.TODO(),\n\t\t"Card:019542f5-b3e7-1d02-0000-000000000010",\n\t\tgrid.SandboxCardSimulateReturnParams{\n\t\t\tAmount: 1500,\n\t\t\tCardTransactionID: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcardTransaction, err := client.Sandbox.Cards.Simulate.Return(\n\t\tcontext.TODO(),\n\t\t"Card:019542f5-b3e7-1d02-0000-000000000010",\n\t\tgrid.SandboxCardSimulateReturnParams{\n\t\t\tRefundRequest: grid.RefundRequestParam{\n\t\t\t\tAmount: 1500,\n\t\t\t\tCardTransactionID: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\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", cardTransaction.ID)\n}\n', }, ruby: { method: 'sandbox.cards.simulate.return_', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.sandbox.cards.simulate.return_(\n "Card:019542f5-b3e7-1d02-0000-000000000010",\n amount: 1500,\n card_transaction_id: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100"\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncard_transaction = lightspark_grid.sandbox.cards.simulate.return_(\n "Card:019542f5-b3e7-1d02-0000-000000000010",\n amount: 1500,\n card_transaction_id: "CardTransaction:019542f5-b3e7-1d02-0000-000000000100"\n)\n\nputs(card_transaction)', }, cli: { method: 'simulate return', @@ -2789,12 +2576,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'sandbox->cards->simulate->return', example: - "sandbox->cards->simulate->return(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n amount: 1500,\n cardTransactionID: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Sandbox.Cards.Simulate.Return', - example: - 'SimulateReturnParams parameters = new()\n{\n ID = "Card:019542f5-b3e7-1d02-0000-000000000010",\n Amount = 1500,\n CardTransactionID = "CardTransaction:019542f5-b3e7-1d02-0000-000000000100",\n};\n\nvar response = await client.Sandbox.Cards.Simulate.Return(parameters);\n\nConsole.WriteLine(response);', + "sandbox->cards->simulate->return(\n 'Card:019542f5-b3e7-1d02-0000-000000000010',\n amount: 1500,\n cardTransactionID: 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100',\n);\n\nvar_dump($cardTransaction);", }, http: { example: @@ -2822,12 +2604,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ allowListStatus?: boolean; domain?: string; lei?: string; logoUrl?: string; name?: string; supportedCurrencies?: { code?: string; decimals?: number; name?: string; symbol?: string; }[]; supportedRegions?: string[]; }', markdown: - "## list\n\n`client.umaProviders.list(countryCode?: string, currencyCode?: string, cursor?: string, hasBlockedProviders?: boolean, limit?: number, sortOrder?: 'asc' | 'desc'): { allowListStatus?: boolean; domain?: string; lei?: string; logoUrl?: string; name?: string; supportedCurrencies?: currency[]; supportedRegions?: string[]; }`\n\n**get** `/uma-providers`\n\nRetrieve a list of available Counterparty Providers. The response includes basic information about each provider, such as its UMA address, name, and supported currencies.\n\n\n### Parameters\n\n- `countryCode?: string`\n The alpha-2 representation of a country, as defined by the ISO 3166-1 standard.\n\n- `currencyCode?: string`\n The ISO 4217 currency code to filter providers by supported currency.\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `hasBlockedProviders?: boolean`\n Whether to include providers which are not on your allowlist in the response. By default the response will include blocked providers.\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n### Returns\n\n- `{ allowListStatus?: boolean; domain?: string; lei?: string; logoUrl?: string; name?: string; supportedCurrencies?: { code?: string; decimals?: number; name?: string; symbol?: string; }[]; supportedRegions?: string[]; }`\n\n - `allowListStatus?: boolean`\n - `domain?: string`\n - `lei?: string`\n - `logoUrl?: string`\n - `name?: string`\n - `supportedCurrencies?: { code?: string; decimals?: number; name?: string; symbol?: string; }[]`\n - `supportedRegions?: string[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const umaProviderListResponse of client.umaProviders.list()) {\n console.log(umaProviderListResponse);\n}\n```", + "## list\n\n`client.umaProviders.list(countryCode?: string, currencyCode?: string, cursor?: string, hasBlockedProviders?: boolean, limit?: number, sortOrder?: 'asc' | 'desc'): { allowListStatus?: boolean; domain?: string; lei?: string; logoUrl?: string; name?: string; supportedCurrencies?: currency[]; supportedRegions?: string[]; }`\n\n**get** `/uma-providers`\n\nRetrieve a list of available Counterparty Providers. The response includes basic information about each provider, such as its UMA address, name, and supported currencies.\n\n\n### Parameters\n\n- `countryCode?: string`\n The alpha-2 representation of a country, as defined by the ISO 3166-1 standard.\n\n- `currencyCode?: string`\n The ISO 4217 currency code to filter providers by supported currency.\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `hasBlockedProviders?: boolean`\n Whether to include providers which are not on your allowlist in the response. By default the response will include blocked providers.\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n### Returns\n\n- `{ allowListStatus?: boolean; domain?: string; lei?: string; logoUrl?: string; name?: string; supportedCurrencies?: { code?: string; decimals?: number; name?: string; symbol?: string; }[]; supportedRegions?: string[]; }`\n\n - `allowListStatus?: boolean`\n - `domain?: string`\n - `lei?: string`\n - `logoUrl?: string`\n - `name?: string`\n - `supportedCurrencies?: { code?: string; decimals?: number; name?: string; symbol?: string; }[]`\n - `supportedRegions?: string[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const umaProvider of client.umaProviders.list()) {\n console.log(umaProvider);\n}\n```", perLanguage: { typescript: { method: 'client.umaProviders.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const umaProviderListResponse of client.umaProviders.list()) {\n console.log(umaProviderListResponse.allowListStatus);\n}", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const umaProvider of client.umaProviders.list()) {\n console.log(umaProvider.allowListStatus);\n}", }, python: { method: 'uma_providers.list', @@ -2858,11 +2640,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "umaProviders->list(\n countryCode: 'US',\n currencyCode: 'USD',\n cursor: 'cursor',\n hasBlockedProviders: true,\n limit: 1,\n sortOrder: 'asc',\n);\n\nvar_dump($page);", }, - csharp: { - method: 'UmaProviders.List', - example: - 'UmaProviderListParams parameters = new();\n\nvar page = await client.UmaProviders.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/uma-providers \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -2896,12 +2673,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'tokens().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.tokens.ApiToken\nimport com.lightspark.grid.models.tokens.Permission\nimport com.lightspark.grid.models.tokens.TokenCreateParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TokenCreateParams = TokenCreateParams.builder()\n .name("Sandbox read-only")\n .addPermission(Permission.VIEW)\n .build()\n val apiToken: ApiToken = client.tokens().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.tokens.ApiToken\nimport com.lightspark.grid.models.tokens.ApiTokenCreateRequest\nimport com.lightspark.grid.models.tokens.Permission\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: ApiTokenCreateRequest = ApiTokenCreateRequest.builder()\n .name("Sandbox read-only")\n .addPermission(Permission.VIEW)\n .build()\n val apiToken: ApiToken = client.tokens().create(params)\n}', }, go: { method: 'client.Tokens.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tapiToken, err := client.Tokens.New(context.TODO(), grid.TokenNewParams{\n\t\tName: "Sandbox read-only",\n\t\tPermissions: []grid.Permission{grid.PermissionView},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiToken.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tapiToken, err := client.Tokens.New(context.TODO(), grid.TokenNewParams{\n\t\tAPITokenCreateRequest: grid.APITokenCreateRequestParam{\n\t\t\tName: "Sandbox read-only",\n\t\t\tPermissions: []grid.Permission{grid.PermissionView},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", apiToken.ID)\n}\n', }, ruby: { method: 'tokens.create', @@ -2918,11 +2695,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "tokens->create(\n name: 'Sandbox read-only', permissions: [Permission::VIEW]\n);\n\nvar_dump($apiToken);", }, - csharp: { - method: 'Tokens.Create', - example: - 'TokenCreateParams parameters = new()\n{\n Name = "Sandbox read-only",\n Permissions =\n [\n Permission.View\n ],\n};\n\nvar apiToken = await client.Tokens.Create(parameters);\n\nConsole.WriteLine(apiToken);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/tokens \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "name": "Sandbox read-only",\n "permissions": [\n "VIEW"\n ]\n }\'', @@ -2986,11 +2758,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "tokens->list(\n createdAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n cursor: 'cursor',\n limit: 1,\n name: 'name',\n updatedAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n updatedBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Tokens.List', - example: - 'TokenListParams parameters = new();\n\nvar page = await client.Tokens.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/tokens \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3046,11 +2813,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "tokens->retrieve('tokenId');\n\nvar_dump($apiToken);", }, - csharp: { - method: 'Tokens.Retrieve', - example: - 'TokenRetrieveParams parameters = new() { TokenID = "tokenId" };\n\nvar apiToken = await client.Tokens.Retrieve(parameters);\n\nConsole.WriteLine(apiToken);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/tokens/$TOKEN_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3104,11 +2866,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "tokens->delete('tokenId');\n\nvar_dump($result);", }, - csharp: { - method: 'Tokens.Delete', - example: - 'TokenDeleteParams parameters = new() { TokenID = "tokenId" };\n\nawait client.Tokens.Delete(parameters);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/tokens/$TOKEN_ID \\\n -X DELETE \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3126,34 +2883,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.exchangeRates.list', params: ['destinationCurrency?: string[];', 'sendingAmount?: number;', 'sourceCurrency?: string;'], response: - '{ data: { destinationCurrency: object; destinationPaymentRail: object; exchangeRate: number; fees: { fixed?: number; }; maxSendingAmount: number; minSendingAmount: number; receivingAmount: number; sendingAmount: number; sourceCurrency: object; updatedAt: string; }[]; }', + '{ data: { destinationCurrency: currency; destinationPaymentRail: object; exchangeRate: number; fees: object; maxSendingAmount: number; minSendingAmount: number; receivingAmount: number; sendingAmount: number; sourceCurrency: currency; updatedAt: string; }[]; }', markdown: - "## list\n\n`client.exchangeRates.list(destinationCurrency?: string[], sendingAmount?: number, sourceCurrency?: string): { data: object[]; }`\n\n**get** `/exchange-rates`\n\nRetrieve cached exchange rates for currency corridors. Returns FX rates that are cached\nfor approximately 5 minutes. Rates include fees specific to your platform for authenticated requests.\n\n**Filtering Options:**\n- Filter by source currency to get all available destination corridors\n- Filter by specific destination currency or currencies\n- Provide a sending amount to get calculated receiving amounts\n\n\n### Parameters\n\n- `destinationCurrency?: string[]`\n Filter by destination currency code(s). Can be repeated for multiple currencies (e.g., &destinationCurrency=INR&destinationCurrency=GBP)\n\n- `sendingAmount?: number`\n Sending amount in the smallest unit of the source currency (e.g., cents for USD). If no amount is provided, the default is 10000 in the sending currency smallest unit.\n\n- `sourceCurrency?: string`\n Filter by source currency code (e.g., USD)\n\n### Returns\n\n- `{ data: { destinationCurrency: object; destinationPaymentRail: object; exchangeRate: number; fees: { fixed?: number; }; maxSendingAmount: number; minSendingAmount: number; receivingAmount: number; sendingAmount: number; sourceCurrency: object; updatedAt: string; }[]; }`\n\n - `data: { destinationCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; destinationPaymentRail: object; exchangeRate: number; fees: { fixed?: number; }; maxSendingAmount: number; minSendingAmount: number; receivingAmount: number; sendingAmount: number; sourceCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; updatedAt: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst exchangeRates = await client.exchangeRates.list();\n\nconsole.log(exchangeRates);\n```", + "## list\n\n`client.exchangeRates.list(destinationCurrency?: string[], sendingAmount?: number, sourceCurrency?: string): { data: exchange_rate[]; }`\n\n**get** `/exchange-rates`\n\nRetrieve cached exchange rates for currency corridors. Returns FX rates that are cached\nfor approximately 5 minutes. Rates include fees specific to your platform for authenticated requests.\n\n**Filtering Options:**\n- Filter by source currency to get all available destination corridors\n- Filter by specific destination currency or currencies\n- Provide a sending amount to get calculated receiving amounts\n\n\n### Parameters\n\n- `destinationCurrency?: string[]`\n Filter by destination currency code(s). Can be repeated for multiple currencies (e.g., &destinationCurrency=INR&destinationCurrency=GBP)\n\n- `sendingAmount?: number`\n Sending amount in the smallest unit of the source currency (e.g., cents for USD). If no amount is provided, the default is 10000 in the sending currency smallest unit.\n\n- `sourceCurrency?: string`\n Filter by source currency code (e.g., USD)\n\n### Returns\n\n- `{ data: { destinationCurrency: currency; destinationPaymentRail: object; exchangeRate: number; fees: object; maxSendingAmount: number; minSendingAmount: number; receivingAmount: number; sendingAmount: number; sourceCurrency: currency; updatedAt: string; }[]; }`\n\n - `data: { destinationCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; destinationPaymentRail: object; exchangeRate: number; fees: { fixed?: number; total?: number; }; maxSendingAmount: number; minSendingAmount: number; receivingAmount: number; sendingAmount: number; sourceCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; updatedAt: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst exchangeRateListResponse = await client.exchangeRates.list();\n\nconsole.log(exchangeRateListResponse);\n```", perLanguage: { typescript: { method: 'client.exchangeRates.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst exchangeRates = await client.exchangeRates.list();\n\nconsole.log(exchangeRates.data);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst exchangeRateListResponse = await client.exchangeRates.list();\n\nconsole.log(exchangeRateListResponse.data);", }, python: { method: 'exchange_rates.list', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nexchange_rates = client.exchange_rates.list()\nprint(exchange_rates.data)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nexchange_rate_list_response = client.exchange_rates.list()\nprint(exchange_rate_list_response.data)', }, kotlin: { method: 'exchangeRates().list', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.exchangerates.ExchangeRateListParams\nimport com.lightspark.grid.models.exchangerates.ExchangeRateListResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val exchangeRates: ExchangeRateListResponse = client.exchangeRates().list()\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.exchangerates.ExchangeRateListParams\nimport com.lightspark.grid.models.exchangerates.ExchangeRateListResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val exchangeRateListResponse: ExchangeRateListResponse = client.exchangeRates().list()\n}', }, go: { method: 'client.ExchangeRates.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\texchangeRates, err := client.ExchangeRates.List(context.TODO(), grid.ExchangeRateListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", exchangeRates.Data)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\texchangeRateListResponse, err := client.ExchangeRates.List(context.TODO(), grid.ExchangeRateListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", exchangeRateListResponse.Data)\n}\n', }, ruby: { method: 'exchange_rates.list', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nexchange_rates = lightspark_grid.exchange_rates.list\n\nputs(exchange_rates)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nexchange_rate_list_response = lightspark_grid.exchange_rates.list\n\nputs(exchange_rate_list_response)', }, cli: { method: 'exchange_rates list', @@ -3162,12 +2919,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'exchangeRates->list', example: - "exchangeRates->list(\n destinationCurrency: ['string'],\n sendingAmount: 0,\n sourceCurrency: 'sourceCurrency',\n);\n\nvar_dump($exchangeRates);", - }, - csharp: { - method: 'ExchangeRates.List', - example: - 'ExchangeRateListParams parameters = new();\n\nvar exchangeRates = await client.ExchangeRates.List(parameters);\n\nConsole.WriteLine(exchangeRates);', + "exchangeRates->list(\n destinationCurrency: ['string'],\n sendingAmount: 0,\n sourceCurrency: 'sourceCurrency',\n);\n\nvar_dump($exchangeRateListResponse);", }, http: { example: @@ -3216,9 +2968,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "webhooks->unwrap();\n\nvar_dump($result);", }, - csharp: { - example: 'WebhookUnwrapParams parameters = new();\n\nawait client.Webhooks.Unwrap(parameters);', - }, }, }, { @@ -3240,32 +2989,32 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ applicationFee: number; netAmount: number; networkFee: number; networkFeeAsset: string; totalFee: number; }', markdown: - "## estimate_withdrawal_fee\n\n`client.crypto.estimateWithdrawalFee(amount: number, cryptoNetwork: string, currency: string, destinationAddress: string, internalAccountId: string): { applicationFee: number; netAmount: number; networkFee: number; networkFeeAsset: string; totalFee: number; }`\n\n**post** `/crypto/estimate-withdrawal-fee`\n\nEstimate the network and application fees for a cryptocurrency withdrawal from a crypto internal account to an external blockchain address. Use this to show fee information to customers before they initiate a withdrawal.\n\n\n### Parameters\n\n- `amount: number`\n The amount to withdraw in the smallest unit of the currency.\n\n- `cryptoNetwork: string`\n The blockchain network for the withdrawal. Example values: SOLANA, ETHEREUM, BASE, POLYGON, SPARK, LIGHTNING, BITCOIN.\n\n- `currency: string`\n The currency code of the asset to withdraw (e.g. USDC).\n\n- `destinationAddress: string`\n The blockchain address to withdraw funds to.\n\n- `internalAccountId: string`\n The ID of the crypto internal account to withdraw from.\n\n### Returns\n\n- `{ applicationFee: number; netAmount: number; networkFee: number; networkFeeAsset: string; totalFee: number; }`\n\n - `applicationFee: number`\n - `netAmount: number`\n - `networkFee: number`\n - `networkFeeAsset: string`\n - `totalFee: number`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.crypto.estimateWithdrawalFee({\n amount: 1000000,\n cryptoNetwork: 'SOLANA',\n currency: 'USDC',\n destinationAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',\n internalAccountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n});\n\nconsole.log(response);\n```", + "## estimate_withdrawal_fee\n\n`client.crypto.estimateWithdrawalFee(amount: number, cryptoNetwork: string, currency: string, destinationAddress: string, internalAccountId: string): { applicationFee: number; netAmount: number; networkFee: number; networkFeeAsset: string; totalFee: number; }`\n\n**post** `/crypto/estimate-withdrawal-fee`\n\nEstimate the network and application fees for a cryptocurrency withdrawal from a crypto internal account to an external blockchain address. Use this to show fee information to customers before they initiate a withdrawal.\n\n\n### Parameters\n\n- `amount: number`\n The amount to withdraw in the smallest unit of the currency.\n\n- `cryptoNetwork: string`\n The blockchain network for the withdrawal. Example values: SOLANA, ETHEREUM, BASE, POLYGON, SPARK, LIGHTNING, BITCOIN.\n\n- `currency: string`\n The currency code of the asset to withdraw (e.g. USDC).\n\n- `destinationAddress: string`\n The blockchain address to withdraw funds to.\n\n- `internalAccountId: string`\n The ID of the crypto internal account to withdraw from.\n\n### Returns\n\n- `{ applicationFee: number; netAmount: number; networkFee: number; networkFeeAsset: string; totalFee: number; }`\n\n - `applicationFee: number`\n - `netAmount: number`\n - `networkFee: number`\n - `networkFeeAsset: string`\n - `totalFee: number`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst estimateCryptoWithdrawalFeeResponse = await client.crypto.estimateWithdrawalFee({\n amount: 1000000,\n cryptoNetwork: 'SOLANA',\n currency: 'USDC',\n destinationAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',\n internalAccountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n});\n\nconsole.log(estimateCryptoWithdrawalFeeResponse);\n```", perLanguage: { typescript: { method: 'client.crypto.estimateWithdrawalFee', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.crypto.estimateWithdrawalFee({\n amount: 1000000,\n cryptoNetwork: 'SOLANA',\n currency: 'USDC',\n destinationAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',\n internalAccountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n});\n\nconsole.log(response.applicationFee);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst estimateCryptoWithdrawalFeeResponse = await client.crypto.estimateWithdrawalFee({\n amount: 1000000,\n cryptoNetwork: 'SOLANA',\n currency: 'USDC',\n destinationAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',\n internalAccountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n});\n\nconsole.log(estimateCryptoWithdrawalFeeResponse.applicationFee);", }, python: { method: 'crypto.estimate_withdrawal_fee', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.crypto.estimate_withdrawal_fee(\n amount=1000000,\n crypto_network="SOLANA",\n currency="USDC",\n destination_address="7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n internal_account_id="InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n)\nprint(response.application_fee)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nestimate_crypto_withdrawal_fee_response = client.crypto.estimate_withdrawal_fee(\n amount=1000000,\n crypto_network="SOLANA",\n currency="USDC",\n destination_address="7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n internal_account_id="InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n)\nprint(estimate_crypto_withdrawal_fee_response.application_fee)', }, kotlin: { method: 'crypto().estimateWithdrawalFee', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.crypto.CryptoEstimateWithdrawalFeeParams\nimport com.lightspark.grid.models.crypto.CryptoEstimateWithdrawalFeeResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CryptoEstimateWithdrawalFeeParams = CryptoEstimateWithdrawalFeeParams.builder()\n .amount(1000000L)\n .cryptoNetwork("SOLANA")\n .currency("USDC")\n .destinationAddress("7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU")\n .internalAccountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build()\n val response: CryptoEstimateWithdrawalFeeResponse = client.crypto().estimateWithdrawalFee(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.crypto.EstimateCryptoWithdrawalFeeRequest\nimport com.lightspark.grid.models.crypto.EstimateCryptoWithdrawalFeeResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: EstimateCryptoWithdrawalFeeRequest = EstimateCryptoWithdrawalFeeRequest.builder()\n .amount(1000000L)\n .cryptoNetwork("SOLANA")\n .currency("USDC")\n .destinationAddress("7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU")\n .internalAccountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build()\n val estimateCryptoWithdrawalFeeResponse: EstimateCryptoWithdrawalFeeResponse = client.crypto().estimateWithdrawalFee(params)\n}', }, go: { method: 'client.Crypto.EstimateWithdrawalFee', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Crypto.EstimateWithdrawalFee(context.TODO(), grid.CryptoEstimateWithdrawalFeeParams{\n\t\tAmount: 1000000,\n\t\tCryptoNetwork: "SOLANA",\n\t\tCurrency: "USDC",\n\t\tDestinationAddress: "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n\t\tInternalAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ApplicationFee)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\testimateCryptoWithdrawalFeeResponse, err := client.Crypto.EstimateWithdrawalFee(context.TODO(), grid.CryptoEstimateWithdrawalFeeParams{\n\t\tEstimateCryptoWithdrawalFeeRequest: grid.EstimateCryptoWithdrawalFeeRequestParam{\n\t\t\tAmount: 1000000,\n\t\t\tCryptoNetwork: "SOLANA",\n\t\t\tCurrency: "USDC",\n\t\t\tDestinationAddress: "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n\t\t\tInternalAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", estimateCryptoWithdrawalFeeResponse.ApplicationFee)\n}\n', }, ruby: { method: 'crypto.estimate_withdrawal_fee', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.crypto.estimate_withdrawal_fee(\n amount: 1000000,\n crypto_network: "SOLANA",\n currency: "USDC",\n destination_address: "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n internal_account_id: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nestimate_crypto_withdrawal_fee_response = lightspark_grid.crypto.estimate_withdrawal_fee(\n amount: 1000000,\n crypto_network: "SOLANA",\n currency: "USDC",\n destination_address: "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n internal_account_id: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n)\n\nputs(estimate_crypto_withdrawal_fee_response)', }, cli: { method: 'crypto estimate_withdrawal_fee', @@ -3275,12 +3024,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'crypto->estimateWithdrawalFee', example: - "crypto->estimateWithdrawalFee(\n amount: 1000000,\n cryptoNetwork: 'SOLANA',\n currency: 'USDC',\n destinationAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',\n internalAccountID: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Crypto.EstimateWithdrawalFee', - example: - 'CryptoEstimateWithdrawalFeeParams parameters = new()\n{\n Amount = 1000000,\n CryptoNetwork = "SOLANA",\n Currency = "USDC",\n DestinationAddress = "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",\n InternalAccountID = "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n};\n\nvar response = await client.Crypto.EstimateWithdrawalFee(parameters);\n\nConsole.WriteLine(response);', + "crypto->estimateWithdrawalFee(\n amount: 1000000,\n cryptoNetwork: 'SOLANA',\n currency: 'USDC',\n destinationAddress: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',\n internalAccountID: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n);\n\nvar_dump($estimateCryptoWithdrawalFeeResponse);", }, http: { example: @@ -3304,9 +3048,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[];", ], response: - "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", + "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", markdown: - "## create\n\n`client.beneficialOwners.create(customerId: string, ownershipPercentage: number, personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }, roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**post** `/beneficial-owners`\n\nAdd a beneficial owner, director, or company officer to a business customer. The beneficial owner will go through KYC verification automatically.\n\n\n### Parameters\n\n- `customerId: string`\n The ID of the business customer this beneficial owner is associated with\n\n- `ownershipPercentage: number`\n Percentage of ownership in the business (0-100). Relevant when role includes UBO.\n\n- `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }`\n - `birthDate: string`\n Date of birth in ISO 8601 format (YYYY-MM-DD)\n - `firstName: string`\n First name of the individual\n - `identifier: string`\n The identification number or value\n - `idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'`\n Type of tax identification\n - `lastName: string`\n Last name of the individual\n - `nationality: string`\n Country of nationality (ISO 3166-1 alpha-2)\n - `countryOfIssuance?: string`\n Country that issued the identification (ISO 3166-1 alpha-2)\n - `email?: string`\n Email address of the individual\n - `middleName?: string`\n Middle name of the individual\n - `phoneNumber?: string`\n Phone number in E.164 format\n\n- `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n Roles of this person within the business\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst beneficialOwner = await client.beneficialOwners.create({\n customerId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n ownershipPercentage: 51,\n personalInfo: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n birthDate: '1978-06-15',\n firstName: 'Jane',\n identifier: '123-45-6789',\n idType: 'SSN',\n lastName: 'Smith',\n nationality: 'US',\n},\n roles: ['UBO', 'DIRECTOR'],\n});\n\nconsole.log(beneficialOwner);\n```", + "## create\n\n`client.beneficialOwners.create(customerId: string, ownershipPercentage: number, personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }, roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**post** `/beneficial-owners`\n\nAdd a beneficial owner, director, or company officer to a business customer. The beneficial owner will go through KYC verification automatically.\n\n\n### Parameters\n\n- `customerId: string`\n The ID of the business customer this beneficial owner is associated with\n\n- `ownershipPercentage: number`\n Percentage of ownership in the business (0-100). Relevant when role includes UBO.\n\n- `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }`\n - `birthDate: string`\n Date of birth in ISO 8601 format (YYYY-MM-DD)\n - `firstName: string`\n First name of the individual\n - `identifier: string`\n The identification number or value\n - `idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'`\n Type of tax identification\n - `lastName: string`\n Last name of the individual\n - `nationality: string`\n Country of nationality (ISO 3166-1 alpha-2)\n - `countryOfIssuance?: string`\n Country that issued the identification (ISO 3166-1 alpha-2)\n - `email?: string`\n Email address of the individual\n - `middleName?: string`\n Middle name of the individual\n - `phoneNumber?: string`\n Phone number in E.164 format\n\n- `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n Roles of this person within the business\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst beneficialOwner = await client.beneficialOwners.create({\n customerId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n ownershipPercentage: 51,\n personalInfo: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n birthDate: '1978-06-15',\n firstName: 'Jane',\n identifier: '123-45-6789',\n idType: 'SSN',\n lastName: 'Smith',\n nationality: 'US',\n},\n roles: ['UBO', 'DIRECTOR'],\n});\n\nconsole.log(beneficialOwner);\n```", perLanguage: { typescript: { method: 'client.beneficialOwners.create', @@ -3321,12 +3065,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'beneficialOwners().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.BeneficialOwner\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerCreateParams\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerPersonalInfo\nimport com.lightspark.grid.models.customers.externalaccounts.Address\nimport java.time.LocalDate\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: BeneficialOwnerCreateParams = BeneficialOwnerCreateParams.builder()\n .customerId("Customer:019542f5-b3e7-1d02-0000-000000000001")\n .ownershipPercentage(51L)\n .personalInfo(BeneficialOwnerPersonalInfo.builder()\n .address(Address.builder()\n .country("US")\n .line1("123 Main Street")\n .postalCode("94105")\n .build())\n .birthDate(LocalDate.parse("1978-06-15"))\n .firstName("Jane")\n .identifier("123-45-6789")\n .idType(BeneficialOwnerPersonalInfo.IdType.SSN)\n .lastName("Smith")\n .nationality("US")\n .build())\n .addRole(BeneficialOwnerCreateParams.Role.UBO)\n .addRole(BeneficialOwnerCreateParams.Role.DIRECTOR)\n .build()\n val beneficialOwner: BeneficialOwner = client.beneficialOwners().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.BeneficialOwner\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerCreateRequest\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerPersonalInfo\nimport com.lightspark.grid.models.customers.externalaccounts.Address\nimport java.time.LocalDate\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: BeneficialOwnerCreateRequest = BeneficialOwnerCreateRequest.builder()\n .customerId("Customer:019542f5-b3e7-1d02-0000-000000000001")\n .ownershipPercentage(51L)\n .personalInfo(BeneficialOwnerPersonalInfo.builder()\n .address(Address.builder()\n .country("US")\n .line1("123 Main Street")\n .postalCode("94105")\n .build())\n .birthDate(LocalDate.parse("1978-06-15"))\n .firstName("Jane")\n .identifier("123-45-6789")\n .idType(BeneficialOwnerPersonalInfo.IdType.SSN)\n .lastName("Smith")\n .nationality("US")\n .build())\n .addRole(BeneficialOwnerCreateRequest.Role.UBO)\n .addRole(BeneficialOwnerCreateRequest.Role.DIRECTOR)\n .build()\n val beneficialOwner: BeneficialOwner = client.beneficialOwners().create(params)\n}', }, go: { method: 'client.BeneficialOwners.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tbeneficialOwner, err := client.BeneficialOwners.New(context.TODO(), grid.BeneficialOwnerNewParams{\n\t\tCustomerID: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n\t\tOwnershipPercentage: 51,\n\t\tPersonalInfo: grid.BeneficialOwnerPersonalInfoParam{\n\t\t\tAddress: grid.AddressParam{\n\t\t\t\tCountry: "US",\n\t\t\t\tLine1: "123 Main Street",\n\t\t\t\tPostalCode: "94105",\n\t\t\t},\n\t\t\tBirthDate: time.Now(),\n\t\t\tFirstName: "Jane",\n\t\t\tIdentifier: "123-45-6789",\n\t\t\tIDType: grid.BeneficialOwnerPersonalInfoIDTypeSsn,\n\t\t\tLastName: "Smith",\n\t\t\tNationality: "US",\n\t\t},\n\t\tRoles: []string{"UBO", "DIRECTOR"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", beneficialOwner.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tbeneficialOwner, err := client.BeneficialOwners.New(context.TODO(), grid.BeneficialOwnerNewParams{\n\t\tBeneficialOwnerCreateRequest: grid.BeneficialOwnerCreateRequestParam{\n\t\t\tCustomerID: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n\t\t\tOwnershipPercentage: 51,\n\t\t\tPersonalInfo: grid.BeneficialOwnerPersonalInfoParam{\n\t\t\t\tAddress: grid.AddressParam{\n\t\t\t\t\tCountry: "US",\n\t\t\t\t\tLine1: "123 Main Street",\n\t\t\t\t\tPostalCode: "94105",\n\t\t\t\t},\n\t\t\t\tBirthDate: time.Now(),\n\t\t\t\tFirstName: "Jane",\n\t\t\t\tIdentifier: "123-45-6789",\n\t\t\t\tIDType: grid.BeneficialOwnerPersonalInfoIDTypeSsn,\n\t\t\t\tLastName: "Smith",\n\t\t\t\tNationality: "US",\n\t\t\t},\n\t\t\tRoles: []string{"UBO", "DIRECTOR"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", beneficialOwner.ID)\n}\n', }, ruby: { method: 'beneficial_owners.create', @@ -3343,11 +3087,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "beneficialOwners->create(\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n ownershipPercentage: 51,\n personalInfo: [\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1978-06-15',\n 'firstName' => 'Jane',\n 'identifier' => '123-45-6789',\n 'idType' => 'SSN',\n 'lastName' => 'Smith',\n 'nationality' => 'US',\n 'countryOfIssuance' => 'US',\n 'email' => 'jane.smith@acmecorp.com',\n 'middleName' => 'Marie',\n 'phoneNumber' => '+14155550192',\n ],\n roles: ['UBO', 'DIRECTOR'],\n);\n\nvar_dump($beneficialOwner);", }, - csharp: { - method: 'BeneficialOwners.Create', - example: - 'BeneficialOwnerCreateParams parameters = new()\n{\n CustomerID = "Customer:019542f5-b3e7-1d02-0000-000000000001",\n OwnershipPercentage = 51,\n PersonalInfo = new()\n {\n Address = new()\n {\n Country = "US",\n Line1 = "123 Main Street",\n PostalCode = "94105",\n City = "San Francisco",\n Line2 = "Apt 4B",\n State = "CA",\n },\n BirthDate = "1978-06-15",\n FirstName = "Jane",\n Identifier = "123-45-6789",\n IDType = IDType.Ssn,\n LastName = "Smith",\n Nationality = "US",\n CountryOfIssuance = "US",\n Email = "jane.smith@acmecorp.com",\n MiddleName = "Marie",\n PhoneNumber = "+14155550192",\n },\n Roles =\n [\n Role.Ubo, Role.Director\n ],\n};\n\nvar beneficialOwner = await client.BeneficialOwners.Create(parameters);\n\nConsole.WriteLine(beneficialOwner);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/beneficial-owners \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",\n "ownershipPercentage": 51,\n "personalInfo": {\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105"\n },\n "birthDate": "1978-06-15",\n "firstName": "Jane",\n "identifier": "123-45-6789",\n "idType": "SSN",\n "lastName": "Smith",\n "nationality": "US"\n },\n "roles": [\n "UBO",\n "DIRECTOR"\n ]\n }\'', @@ -3364,9 +3103,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.beneficialOwners.list', params: ['customerId: string;', 'cursor?: string;', 'limit?: number;'], response: - "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", + "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", markdown: - "## list\n\n`client.beneficialOwners.list(customerId: string, cursor?: string, limit?: number): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**get** `/beneficial-owners`\n\nRetrieve a list of beneficial owners for a business customer.\n\n\n### Parameters\n\n- `customerId: string`\n The business customer ID\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const beneficialOwner of client.beneficialOwners.list({ customerId: 'customerId' })) {\n console.log(beneficialOwner);\n}\n```", + "## list\n\n`client.beneficialOwners.list(customerId: string, cursor?: string, limit?: number): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**get** `/beneficial-owners`\n\nRetrieve a list of beneficial owners for a business customer.\n\n\n### Parameters\n\n- `customerId: string`\n The business customer ID\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const beneficialOwner of client.beneficialOwners.list({ customerId: 'customerId' })) {\n console.log(beneficialOwner);\n}\n```", perLanguage: { typescript: { method: 'client.beneficialOwners.list', @@ -3403,11 +3142,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "beneficialOwners->list(\n customerID: 'customerId', cursor: 'cursor', limit: 1\n);\n\nvar_dump($page);", }, - csharp: { - method: 'BeneficialOwners.List', - example: - 'BeneficialOwnerListParams parameters = new() { CustomerID = "customerId" };\n\nvar page = await client.BeneficialOwners.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/beneficial-owners \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3424,9 +3158,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.beneficialOwners.retrieve', params: ['beneficialOwnerId: string;'], response: - "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", + "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", markdown: - "## retrieve\n\n`client.beneficialOwners.retrieve(beneficialOwnerId: string): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**get** `/beneficial-owners/{beneficialOwnerId}`\n\nRetrieve details of a specific beneficial owner by ID.\n\n### Parameters\n\n- `beneficialOwnerId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst beneficialOwner = await client.beneficialOwners.retrieve('beneficialOwnerId');\n\nconsole.log(beneficialOwner);\n```", + "## retrieve\n\n`client.beneficialOwners.retrieve(beneficialOwnerId: string): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**get** `/beneficial-owners/{beneficialOwnerId}`\n\nRetrieve details of a specific beneficial owner by ID.\n\n### Parameters\n\n- `beneficialOwnerId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst beneficialOwner = await client.beneficialOwners.retrieve('beneficialOwnerId');\n\nconsole.log(beneficialOwner);\n```", perLanguage: { typescript: { method: 'client.beneficialOwners.retrieve', @@ -3463,11 +3197,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "beneficialOwners->retrieve('beneficialOwnerId');\n\nvar_dump($beneficialOwner);", }, - csharp: { - method: 'BeneficialOwners.Retrieve', - example: - 'BeneficialOwnerRetrieveParams parameters = new()\n{\n BeneficialOwnerID = "beneficialOwnerId"\n};\n\nvar beneficialOwner = await client.BeneficialOwners.Retrieve(parameters);\n\nConsole.WriteLine(beneficialOwner);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/beneficial-owners/$BENEFICIAL_OWNER_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3489,9 +3218,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "roles?: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[];", ], response: - "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", + "{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }", markdown: - "## update\n\n`client.beneficialOwners.update(beneficialOwnerId: string, ownershipPercentage?: number, personalInfo?: { address?: object; birthDate?: string; countryOfIssuance?: string; email?: string; firstName?: string; identifier?: string; idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName?: string; middleName?: string; nationality?: string; phoneNumber?: string; }, roles?: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**patch** `/beneficial-owners/{beneficialOwnerId}`\n\nUpdate details of a specific beneficial owner. Only provided fields are updated.\n\n### Parameters\n\n- `beneficialOwnerId: string`\n\n- `ownershipPercentage?: number`\n Percentage of ownership in the business (0-100)\n\n- `personalInfo?: { address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfIssuance?: string; email?: string; firstName?: string; identifier?: string; idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName?: string; middleName?: string; nationality?: string; phoneNumber?: string; }`\n Partial update for beneficial owner personal information. Only provided fields are updated.\n - `address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }`\n - `birthDate?: string`\n Date of birth in ISO 8601 format (YYYY-MM-DD)\n - `countryOfIssuance?: string`\n Country that issued the identification (ISO 3166-1 alpha-2)\n - `email?: string`\n Email address of the individual\n - `firstName?: string`\n First name of the individual\n - `identifier?: string`\n The identification number or value\n - `idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'`\n Type of tax identification\n - `lastName?: string`\n Last name of the individual\n - `middleName?: string`\n Middle name of the individual\n - `nationality?: string`\n Country of nationality (ISO 3166-1 alpha-2)\n - `phoneNumber?: string`\n Phone number in E.164 format\n\n- `roles?: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n Roles of this person within the business\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst beneficialOwner = await client.beneficialOwners.update('beneficialOwnerId');\n\nconsole.log(beneficialOwner);\n```", + "## update\n\n`client.beneficialOwners.update(beneficialOwnerId: string, ownershipPercentage?: number, personalInfo?: { address?: object; birthDate?: string; countryOfIssuance?: string; email?: string; firstName?: string; identifier?: string; idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName?: string; middleName?: string; nationality?: string; phoneNumber?: string; }, roles?: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]): { id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: beneficial_owner_personal_info; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n**patch** `/beneficial-owners/{beneficialOwnerId}`\n\nUpdate details of a specific beneficial owner. Only provided fields are updated.\n\n### Parameters\n\n- `beneficialOwnerId: string`\n\n- `ownershipPercentage?: number`\n Percentage of ownership in the business (0-100)\n\n- `personalInfo?: { address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfIssuance?: string; email?: string; firstName?: string; identifier?: string; idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName?: string; middleName?: string; nationality?: string; phoneNumber?: string; }`\n Partial update for beneficial owner personal information. Only provided fields are updated.\n - `address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }`\n - `birthDate?: string`\n Date of birth in ISO 8601 format (YYYY-MM-DD)\n - `countryOfIssuance?: string`\n Country that issued the identification (ISO 3166-1 alpha-2)\n - `email?: string`\n Email address of the individual\n - `firstName?: string`\n First name of the individual\n - `identifier?: string`\n The identification number or value\n - `idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'`\n Type of tax identification\n - `lastName?: string`\n Last name of the individual\n - `middleName?: string`\n Middle name of the individual\n - `nationality?: string`\n Country of nationality (ISO 3166-1 alpha-2)\n - `phoneNumber?: string`\n Phone number in E.164 format\n\n- `roles?: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n Roles of this person within the business\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; ownershipPercentage: number; personalInfo: { address: address; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }; roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'`\n - `ownershipPercentage: number`\n - `personalInfo: { address: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate: string; firstName: string; identifier: string; idType: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; lastName: string; nationality: string; countryOfIssuance?: string; email?: string; middleName?: string; phoneNumber?: string; }`\n - `roles: 'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'[]`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst beneficialOwner = await client.beneficialOwners.update('beneficialOwnerId');\n\nconsole.log(beneficialOwner);\n```", perLanguage: { typescript: { method: 'client.beneficialOwners.update', @@ -3506,12 +3235,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'beneficialOwners().update', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.BeneficialOwner\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerUpdateParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val beneficialOwner: BeneficialOwner = client.beneficialOwners().update("beneficialOwnerId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.BeneficialOwner\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerUpdateParams\nimport com.lightspark.grid.models.beneficialowners.BeneficialOwnerUpdateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: BeneficialOwnerUpdateParams = BeneficialOwnerUpdateParams.builder()\n .beneficialOwnerId("beneficialOwnerId")\n .beneficialOwnerUpdateRequest(BeneficialOwnerUpdateRequest.builder().build())\n .build()\n val beneficialOwner: BeneficialOwner = client.beneficialOwners().update(params)\n}', }, go: { method: 'client.BeneficialOwners.Update', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tbeneficialOwner, err := client.BeneficialOwners.Update(\n\t\tcontext.TODO(),\n\t\t"beneficialOwnerId",\n\t\tgrid.BeneficialOwnerUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", beneficialOwner.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tbeneficialOwner, err := client.BeneficialOwners.Update(\n\t\tcontext.TODO(),\n\t\t"beneficialOwnerId",\n\t\tgrid.BeneficialOwnerUpdateParams{\n\t\t\tBeneficialOwnerUpdateRequest: grid.BeneficialOwnerUpdateRequestParam{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", beneficialOwner.ID)\n}\n', }, ruby: { method: 'beneficial_owners.update', @@ -3528,11 +3257,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "beneficialOwners->update(\n 'beneficialOwnerId',\n ownershipPercentage: 51,\n personalInfo: [\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'birthDate' => '1978-06-15',\n 'countryOfIssuance' => 'US',\n 'email' => 'jane.smith@acmecorp.com',\n 'firstName' => 'Jane',\n 'identifier' => '123-45-6789',\n 'idType' => 'SSN',\n 'lastName' => 'Smith',\n 'middleName' => 'Marie',\n 'nationality' => 'US',\n 'phoneNumber' => '+14155550192',\n ],\n roles: ['UBO', 'DIRECTOR'],\n);\n\nvar_dump($beneficialOwner);", }, - csharp: { - method: 'BeneficialOwners.Update', - example: - 'BeneficialOwnerUpdateParams parameters = new()\n{\n BeneficialOwnerID = "beneficialOwnerId"\n};\n\nvar beneficialOwner = await client.BeneficialOwners.Update(parameters);\n\nConsole.WriteLine(beneficialOwner);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/beneficial-owners/$BENEFICIAL_OWNER_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "ownershipPercentage": 51,\n "roles": [\n "UBO",\n "DIRECTOR"\n ]\n }\'', @@ -3549,62 +3273,51 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) documents > (method) upload', qualified: 'client.documents.upload', params: [ - 'country: string;', - 'documentHolder: string;', - 'documentType: string;', - 'file: string;', - 'documentNumber?: string;', - 'issuingAuthority?: string;', - "side?: 'FRONT' | 'BACK';", + "DocumentUploadRequest: { country: string; documentHolder: string; documentType: string; file: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; };", ], response: "{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }", markdown: - "## upload\n\n`client.documents.upload(country: string, documentHolder: string, documentType: string, file: string, documentNumber?: string, issuingAuthority?: string, side?: 'FRONT' | 'BACK'): { id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n**post** `/documents`\n\nUpload a verification document for a customer or beneficial owner. The request must use multipart/form-data with the file in the `file` field and metadata in the remaining fields.\n\nSupported file types: PDF, JPEG, PNG. Maximum file size: 10 MB.\n\n\n### Parameters\n\n- `country: string`\n Country that issued the document (ISO 3166-1 alpha-2)\n\n- `documentHolder: string`\n ID of the entity that owns this document. Can be a Customer ID or a BeneficialOwner ID.\n\n- `documentType: string`\n Type of identity or business verification document. Document types are grouped by verification category:\n**Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID\n**Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT\n**Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT\n**Business — Ownership structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT\n**Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, BANK_STATEMENT, TAX_RETURN\n\n- `file: string`\n The document file (PDF, JPEG, or PNG, max 10 MB)\n\n- `documentNumber?: string`\n Document identification number (e.g., passport number)\n\n- `issuingAuthority?: string`\n Name of the government agency or organization that issued the document\n\n- `side?: 'FRONT' | 'BACK'`\n Which side of the document (for two-sided documents like driver's licenses)\n\n### Returns\n\n- `{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n - `id: string`\n - `country: string`\n - `createdAt: string`\n - `documentHolder: string`\n - `documentType: string`\n - `fileName: string`\n - `documentNumber?: string`\n - `issuingAuthority?: string`\n - `side?: 'FRONT' | 'BACK'`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.documents.upload({\n country: 'US',\n documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response);\n```", + "## upload\n\n`client.documents.upload(DocumentUploadRequest: { country: string; documentHolder: string; documentType: string; file: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; }): { id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n**post** `/documents`\n\nUpload a verification document for a customer or beneficial owner. The request must use multipart/form-data with the file in the `file` field and metadata in the remaining fields.\n\nSupported file types: PDF, JPEG, PNG. Maximum file size: 10 MB.\n\n\n### Parameters\n\n- `DocumentUploadRequest: { country: string; documentHolder: string; documentType: string; file: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; }`\n - `country: string`\n Country that issued the document (ISO 3166-1 alpha-2)\n - `documentHolder: string`\n ID of the entity that owns this document. Can be a Customer ID or a BeneficialOwner ID.\n - `documentType: string`\n Type of identity or business verification document. Document types are grouped by verification category:\n**Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID\n**Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT\n**Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT\n**Business — Ownership structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT\n**Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, BANK_STATEMENT, TAX_RETURN\n - `file: string`\n The document file (PDF, JPEG, or PNG, max 10 MB)\n - `documentNumber?: string`\n Document identification number (e.g., passport number)\n - `issuingAuthority?: string`\n Name of the government agency or organization that issued the document\n - `side?: 'FRONT' | 'BACK'`\n Which side of the document (for two-sided documents like driver's licenses)\n\n### Returns\n\n- `{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n - `id: string`\n - `country: string`\n - `createdAt: string`\n - `documentHolder: string`\n - `documentType: string`\n - `fileName: string`\n - `documentNumber?: string`\n - `issuingAuthority?: string`\n - `side?: 'FRONT' | 'BACK'`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst document = await client.documents.upload({ DocumentUploadRequest: {\n country: 'US',\n documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n} });\n\nconsole.log(document);\n```", perLanguage: { typescript: { method: 'client.documents.upload', example: - "import fs from 'fs';\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.documents.upload({\n country: 'US',\n documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst document = await client.documents.upload({\n DocumentUploadRequest: {\n country: 'US',\n documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n },\n});\n\nconsole.log(document.id);", }, python: { method: 'documents.upload', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.documents.upload(\n country="US",\n document_holder="BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n document_type="PASSPORT",\n file=b"Example data",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ndocument = client.documents.upload(\n document_upload_request={\n "country": "US",\n "document_holder": "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n "document_type": "PASSPORT",\n "file": b"Example data",\n },\n)\nprint(document.id)', }, kotlin: { method: 'documents().upload', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.documents.DocumentUploadParams\nimport com.lightspark.grid.models.documents.DocumentUploadResponse\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: DocumentUploadParams = DocumentUploadParams.builder()\n .country("US")\n .documentHolder("BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001")\n .documentType(DocumentUploadParams.DocumentType.PASSPORT)\n .file("Example data".byteInputStream())\n .build()\n val response: DocumentUploadResponse = client.documents().upload(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.documents.Document\nimport com.lightspark.grid.models.documents.DocumentUploadParams\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: DocumentUploadParams = DocumentUploadParams.builder()\n .country("US")\n .documentHolder("BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001")\n .documentType(DocumentUploadParams.DocumentType.PASSPORT)\n .file("Example data".byteInputStream())\n .build()\n val document: Document = client.documents().upload(params)\n}', }, go: { method: 'client.Documents.Upload', example: - 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Documents.Upload(context.TODO(), grid.DocumentUploadParams{\n\t\tCountry: "US",\n\t\tDocumentHolder: "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n\t\tDocumentType: grid.DocumentUploadParamsDocumentTypePassport,\n\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tdocument, err := client.Documents.Upload(context.TODO(), grid.DocumentUploadParams{\n\t\tDocumentUploadRequest: grid.DocumentUploadParamsDocumentUploadRequest{\n\t\t\tCountry: "US",\n\t\t\tDocumentHolder: "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n\t\t\tDocumentType: "PASSPORT",\n\t\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", document.ID)\n}\n', }, ruby: { method: 'documents.upload', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.documents.upload(\n country: "US",\n document_holder: "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n document_type: :PASSPORT,\n file: StringIO.new("Example data")\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ndocument = lightspark_grid.documents.upload(\n document_upload_request: {\n country: "US",\n documentHolder: "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n documentType: :PASSPORT,\n file: StringIO.new("Example data")\n }\n)\n\nputs(document)', }, cli: { method: 'documents upload', example: - "grid documents upload \\\n --username 'My Username' \\\n --password 'My Password' \\\n --country US \\\n --document-holder BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001 \\\n --document-type PASSPORT \\\n --file 'Example data'", + "grid documents upload \\\n --username 'My Username' \\\n --password 'My Password' \\\n --document-upload-request '{country: US, documentHolder: BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001, documentType: PASSPORT, file: Example data}'", }, php: { method: 'documents->upload', example: - "documents->upload(\n country: 'US',\n documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001',\n documentType: 'PASSPORT',\n file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n documentNumber: 'A12345678',\n issuingAuthority: 'U.S. Department of State',\n side: 'FRONT',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Documents.Upload', - example: - 'DocumentUploadParams parameters = new()\n{\n Country = "US",\n DocumentHolder = "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",\n DocumentType = DocumentType.Passport,\n File = Encoding.UTF8.GetBytes("Example data"),\n};\n\nvar response = await client.Documents.Upload(parameters);\n\nConsole.WriteLine(response);', + "documents->upload(\n documentUploadRequest: [\n 'country' => 'US',\n 'documentHolder' => 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001',\n 'documentType' => 'PASSPORT',\n 'file' => FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n 'documentNumber' => 'A12345678',\n 'issuingAuthority' => 'U.S. Department of State',\n 'side' => 'FRONT',\n ],\n);\n\nvar_dump($document);", }, http: { example: - "curl https://api.lightspark.com/grid/2025-10-13/documents \\\n -H 'Content-Type: multipart/form-data' \\\n -u \"$GRID_CLIENT_ID:GRID_CLIENT_SECRET\" \\\n -F country=US \\\n -F documentHolder=BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001 \\\n -F documentType=PASSPORT \\\n -F 'file=@/path/to/file' \\\n -F documentNumber=A12345678 \\\n -F issuingAuthority='U.S. Department of State' \\\n -F side=FRONT", + 'curl https://api.lightspark.com/grid/2025-10-13/documents \\\n -H \'Content-Type: multipart/form-data\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -F DocumentUploadRequest=\'{"country":"US","documentHolder":"BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001","documentType":"PASSPORT","file":"Example data"}\'', }, }, }, @@ -3620,12 +3333,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: "{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }", markdown: - "## list\n\n`client.documents.list(cursor?: string, documentHolder?: string, limit?: number): { id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n**get** `/documents`\n\nRetrieve a list of documents with optional filtering by document holder.\n\n\n### Parameters\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `documentHolder?: string`\n Filter by document holder ID (Customer or BeneficialOwner)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n - `id: string`\n - `country: string`\n - `createdAt: string`\n - `documentHolder: string`\n - `documentType: string`\n - `fileName: string`\n - `documentNumber?: string`\n - `issuingAuthority?: string`\n - `side?: 'FRONT' | 'BACK'`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const documentListResponse of client.documents.list()) {\n console.log(documentListResponse);\n}\n```", + "## list\n\n`client.documents.list(cursor?: string, documentHolder?: string, limit?: number): { id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n**get** `/documents`\n\nRetrieve a list of documents with optional filtering by document holder.\n\n\n### Parameters\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `documentHolder?: string`\n Filter by document holder ID (Customer or BeneficialOwner)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n - `id: string`\n - `country: string`\n - `createdAt: string`\n - `documentHolder: string`\n - `documentType: string`\n - `fileName: string`\n - `documentNumber?: string`\n - `issuingAuthority?: string`\n - `side?: 'FRONT' | 'BACK'`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const document of client.documents.list()) {\n console.log(document);\n}\n```", perLanguage: { typescript: { method: 'client.documents.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const documentListResponse of client.documents.list()) {\n console.log(documentListResponse.id);\n}", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const document of client.documents.list()) {\n console.log(document.id);\n}", }, python: { method: 'documents.list', @@ -3656,11 +3369,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "documents->list(\n cursor: 'cursor', documentHolder: 'documentHolder', limit: 1\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Documents.List', - example: - 'DocumentListParams parameters = new();\n\nvar page = await client.Documents.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/documents \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3694,7 +3402,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'documents().retrieve', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.documents.DocumentRetrieveParams\nimport com.lightspark.grid.models.documents.DocumentRetrieveResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val document: DocumentRetrieveResponse = client.documents().retrieve("documentId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.documents.Document\nimport com.lightspark.grid.models.documents.DocumentRetrieveParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val document: Document = client.documents().retrieve("documentId")\n}', }, go: { method: 'client.Documents.Get', @@ -3716,11 +3424,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "documents->retrieve('documentId');\n\nvar_dump($document);", }, - csharp: { - method: 'Documents.Retrieve', - example: - 'DocumentRetrieveParams parameters = new() { DocumentID = "documentId" };\n\nvar document = await client.Documents.Retrieve(parameters);\n\nConsole.WriteLine(document);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/documents/$DOCUMENT_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3738,61 +3441,51 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.documents.replace', params: [ 'documentId: string;', - 'country: string;', - 'documentType: string;', - 'file: string;', - 'documentNumber?: string;', - 'issuingAuthority?: string;', - "side?: 'FRONT' | 'BACK';", + "DocumentReplaceRequest: { country: string; documentType: string; file: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; };", ], response: "{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }", markdown: - "## replace\n\n`client.documents.replace(documentId: string, country: string, documentType: string, file: string, documentNumber?: string, issuingAuthority?: string, side?: 'FRONT' | 'BACK'): { id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n**put** `/documents/{documentId}`\n\nReplace an existing document with a new file and/or updated metadata. This is useful when a document was rejected and needs to be re-uploaded. The request must use multipart/form-data.\n\n\n### Parameters\n\n- `documentId: string`\n\n- `country: string`\n Country that issued the document (ISO 3166-1 alpha-2)\n\n- `documentType: string`\n Type of identity or business verification document. Document types are grouped by verification category:\n**Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID\n**Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT\n**Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT\n**Business — Ownership structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT\n**Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, BANK_STATEMENT, TAX_RETURN\n\n- `file: string`\n The document file (PDF, JPEG, or PNG, max 10 MB)\n\n- `documentNumber?: string`\n Document identification number (e.g., passport number)\n\n- `issuingAuthority?: string`\n Name of the government agency or organization that issued the document\n\n- `side?: 'FRONT' | 'BACK'`\n Which side of the document (for two-sided documents like driver's licenses)\n\n### Returns\n\n- `{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n - `id: string`\n - `country: string`\n - `createdAt: string`\n - `documentHolder: string`\n - `documentType: string`\n - `fileName: string`\n - `documentNumber?: string`\n - `issuingAuthority?: string`\n - `side?: 'FRONT' | 'BACK'`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.documents.replace('documentId', {\n country: 'US',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response);\n```", + "## replace\n\n`client.documents.replace(documentId: string, DocumentReplaceRequest: { country: string; documentType: string; file: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; }): { id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n**put** `/documents/{documentId}`\n\nReplace an existing document with a new file and/or updated metadata. This is useful when a document was rejected and needs to be re-uploaded. The request must use multipart/form-data.\n\n\n### Parameters\n\n- `documentId: string`\n\n- `DocumentReplaceRequest: { country: string; documentType: string; file: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; }`\n - `country: string`\n Country that issued the document (ISO 3166-1 alpha-2)\n - `documentType: string`\n Type of identity or business verification document. Document types are grouped by verification category:\n**Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID\n**Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT\n**Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT\n**Business — Ownership structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT\n**Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, BANK_STATEMENT, TAX_RETURN\n - `file: string`\n The document file (PDF, JPEG, or PNG, max 10 MB)\n - `documentNumber?: string`\n Document identification number (e.g., passport number)\n - `issuingAuthority?: string`\n Name of the government agency or organization that issued the document\n - `side?: 'FRONT' | 'BACK'`\n Which side of the document (for two-sided documents like driver's licenses)\n\n### Returns\n\n- `{ id: string; country: string; createdAt: string; documentHolder: string; documentType: string; fileName: string; documentNumber?: string; issuingAuthority?: string; side?: 'FRONT' | 'BACK'; updatedAt?: string; }`\n\n - `id: string`\n - `country: string`\n - `createdAt: string`\n - `documentHolder: string`\n - `documentType: string`\n - `fileName: string`\n - `documentNumber?: string`\n - `issuingAuthority?: string`\n - `side?: 'FRONT' | 'BACK'`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst document = await client.documents.replace('documentId', { DocumentReplaceRequest: {\n country: 'US',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n} });\n\nconsole.log(document);\n```", perLanguage: { typescript: { method: 'client.documents.replace', example: - "import fs from 'fs';\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.documents.replace('documentId', {\n country: 'US',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst document = await client.documents.replace('documentId', {\n DocumentReplaceRequest: {\n country: 'US',\n documentType: 'PASSPORT',\n file: fs.createReadStream('path/to/file'),\n },\n});\n\nconsole.log(document.id);", }, python: { method: 'documents.replace', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.documents.replace(\n document_id="documentId",\n country="US",\n document_type="PASSPORT",\n file=b"Example data",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ndocument = client.documents.replace(\n document_id="documentId",\n document_replace_request={\n "country": "US",\n "document_type": "PASSPORT",\n "file": b"Example data",\n },\n)\nprint(document.id)', }, kotlin: { method: 'documents().replace', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.documents.DocumentReplaceParams\nimport com.lightspark.grid.models.documents.DocumentReplaceResponse\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: DocumentReplaceParams = DocumentReplaceParams.builder()\n .documentId("documentId")\n .country("US")\n .documentType(DocumentReplaceParams.DocumentType.PASSPORT)\n .file("Example data".byteInputStream())\n .build()\n val response: DocumentReplaceResponse = client.documents().replace(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.documents.Document\nimport com.lightspark.grid.models.documents.DocumentReplaceParams\nimport java.io.ByteArrayInputStream\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: DocumentReplaceParams = DocumentReplaceParams.builder()\n .documentId("documentId")\n .country("US")\n .documentType(DocumentReplaceParams.DocumentType.PASSPORT)\n .file("Example data".byteInputStream())\n .build()\n val document: Document = client.documents().replace(params)\n}', }, go: { method: 'client.Documents.Replace', example: - 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Documents.Replace(\n\t\tcontext.TODO(),\n\t\t"documentId",\n\t\tgrid.DocumentReplaceParams{\n\t\t\tCountry: "US",\n\t\t\tDocumentType: grid.DocumentReplaceParamsDocumentTypePassport,\n\t\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tdocument, err := client.Documents.Replace(\n\t\tcontext.TODO(),\n\t\t"documentId",\n\t\tgrid.DocumentReplaceParams{\n\t\t\tDocumentReplaceRequest: grid.DocumentReplaceParamsDocumentReplaceRequest{\n\t\t\t\tCountry: "US",\n\t\t\t\tDocumentType: "PASSPORT",\n\t\t\t\tFile: io.Reader(bytes.NewBuffer([]byte("Example data"))),\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", document.ID)\n}\n', }, ruby: { method: 'documents.replace', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.documents.replace(\n "documentId",\n country: "US",\n document_type: :PASSPORT,\n file: StringIO.new("Example data")\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ndocument = lightspark_grid.documents.replace(\n "documentId",\n document_replace_request: {country: "US", documentType: :PASSPORT, file: StringIO.new("Example data")}\n)\n\nputs(document)', }, cli: { method: 'documents replace', example: - "grid documents replace \\\n --username 'My Username' \\\n --password 'My Password' \\\n --document-id documentId \\\n --country US \\\n --document-type PASSPORT \\\n --file 'Example data'", + "grid documents replace \\\n --username 'My Username' \\\n --password 'My Password' \\\n --document-id documentId \\\n --document-replace-request '{country: US, documentType: PASSPORT, file: Example data}'", }, php: { method: 'documents->replace', example: - "documents->replace(\n 'documentId',\n country: 'US',\n documentType: 'PASSPORT',\n file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n documentNumber: 'A12345678',\n issuingAuthority: 'U.S. Department of State',\n side: 'FRONT',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Documents.Replace', - example: - 'DocumentReplaceParams parameters = new()\n{\n DocumentID = "documentId",\n Country = "US",\n DocumentType = DocumentType.Passport,\n File = Encoding.UTF8.GetBytes("Example data"),\n};\n\nvar response = await client.Documents.Replace(parameters);\n\nConsole.WriteLine(response);', + "documents->replace(\n 'documentId',\n documentReplaceRequest: [\n 'country' => 'US',\n 'documentType' => 'PASSPORT',\n 'file' => FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n 'documentNumber' => 'A12345678',\n 'issuingAuthority' => 'U.S. Department of State',\n 'side' => 'FRONT',\n ],\n);\n\nvar_dump($document);", }, http: { example: - "curl https://api.lightspark.com/grid/2025-10-13/documents/$DOCUMENT_ID \\\n -X PUT \\\n -H 'Content-Type: multipart/form-data' \\\n -u \"$GRID_CLIENT_ID:GRID_CLIENT_SECRET\" \\\n -F country=US \\\n -F documentType=PASSPORT \\\n -F 'file=@/path/to/file' \\\n -F documentNumber=A12345678 \\\n -F issuingAuthority='U.S. Department of State' \\\n -F side=FRONT", + 'curl https://api.lightspark.com/grid/2025-10-13/documents/$DOCUMENT_ID \\\n -X PUT \\\n -H \'Content-Type: multipart/form-data\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -F DocumentReplaceRequest=\'{"country":"US","documentType":"PASSPORT","file":"Example data"}\'', }, }, }, @@ -3844,11 +3537,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "documents->delete('documentId');\n\nvar_dump($result);", }, - csharp: { - method: 'Documents.Delete', - example: - 'DocumentDeleteParams parameters = new() { DocumentID = "documentId" };\n\nawait client.Documents.Delete(parameters);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/documents/$DOCUMENT_ID \\\n -X DELETE \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -3861,39 +3549,39 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Submit customer for verification', description: - 'Trigger KYC (individual) or KYB (business) verification for a customer. The response indicates whether all required information has been provided. If data is missing, the `errors` array describes exactly what needs to be supplied before verification can proceed.\n\nCall this endpoint again after resolving errors to re-submit.\n', + 'Trigger KYC (individual) or KYB (business) verification for a customer.\nThe response indicates whether all required information has been provided.\nIf data is missing, the `errors` array describes exactly what needs to be\nsupplied before verification can proceed.\n\nCall this endpoint again after resolving errors to re-submit.\n\n### What to collect for KYB\n\nBefore submitting a `BUSINESS` customer, collect the following via\n`POST /customers`, `POST /beneficial-owners`, and `POST /documents`:\n\n**Business identifying information**\n- Entity full legal name\n- Doing Business As (DBA) name, if applicable\n- Physical address — principal place of business\n- Countries of operation\n- Identification number — U.S. taxpayer identification number, or, for a\n foreign business without one, alternative government-issued documentation\n certifying the existence of the business\n\n**Ownership and control structure** — collected for **one control person**\n(an individual with significant responsibility to control, manage, or\ndirect the legal entity) **and all beneficial owners** (every individual\nwho owns 25% or more, directly or indirectly). For each, provide:\n- Full name\n- Date of birth\n- Address\n- Identification number:\n - U.S. persons — SSN or ITIN\n - Non-U.S. persons — one or more of: ITIN, passport (with country of\n issuance), alien identification card, or another government-issued\n photo ID evidencing nationality or residence\n\n**Required documents**\n- Company formation and existence documents (certificate of incorporation,\n articles of association, etc.)\n- Proof of ownership and control structure (organization and ownership\n chart, shareholder agreements, operating agreements, register of members,\n or certification of controlling person and beneficial owners)\n- Proof of address dated within the last 3 months (utility bill, bank\n statement, lease agreement, or official correspondence)\n- Tax ID or equivalent identifying-number documents\n- For non-U.S. beneficial owners — passport plus one additional\n government-issued ID\n', stainlessPath: '(resource) verifications > (method) submit', qualified: 'client.verifications.submit', params: ['customerId: string;'], response: '{ id: string; createdAt: string; customerId: string; errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]; verificationStatus: string; updatedAt?: string; }', markdown: - "## submit\n\n`client.verifications.submit(customerId: string): { id: string; createdAt: string; customerId: string; errors: verification_error[]; verificationStatus: string; updatedAt?: string; }`\n\n**post** `/verifications`\n\nTrigger KYC (individual) or KYB (business) verification for a customer. The response indicates whether all required information has been provided. If data is missing, the `errors` array describes exactly what needs to be supplied before verification can proceed.\n\nCall this endpoint again after resolving errors to re-submit.\n\n\n### Parameters\n\n- `customerId: string`\n The ID of the customer to verify\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]; verificationStatus: string; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]`\n - `verificationStatus: string`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.verifications.submit({ customerId: 'Customer:019542f5-b3e7-1d02-0000-000000000001' });\n\nconsole.log(response);\n```", + "## submit\n\n`client.verifications.submit(customerId: string): { id: string; createdAt: string; customerId: string; errors: verification_error[]; verificationStatus: string; updatedAt?: string; }`\n\n**post** `/verifications`\n\nTrigger KYC (individual) or KYB (business) verification for a customer.\nThe response indicates whether all required information has been provided.\nIf data is missing, the `errors` array describes exactly what needs to be\nsupplied before verification can proceed.\n\nCall this endpoint again after resolving errors to re-submit.\n\n### What to collect for KYB\n\nBefore submitting a `BUSINESS` customer, collect the following via\n`POST /customers`, `POST /beneficial-owners`, and `POST /documents`:\n\n**Business identifying information**\n- Entity full legal name\n- Doing Business As (DBA) name, if applicable\n- Physical address — principal place of business\n- Countries of operation\n- Identification number — U.S. taxpayer identification number, or, for a\n foreign business without one, alternative government-issued documentation\n certifying the existence of the business\n\n**Ownership and control structure** — collected for **one control person**\n(an individual with significant responsibility to control, manage, or\ndirect the legal entity) **and all beneficial owners** (every individual\nwho owns 25% or more, directly or indirectly). For each, provide:\n- Full name\n- Date of birth\n- Address\n- Identification number:\n - U.S. persons — SSN or ITIN\n - Non-U.S. persons — one or more of: ITIN, passport (with country of\n issuance), alien identification card, or another government-issued\n photo ID evidencing nationality or residence\n\n**Required documents**\n- Company formation and existence documents (certificate of incorporation,\n articles of association, etc.)\n- Proof of ownership and control structure (organization and ownership\n chart, shareholder agreements, operating agreements, register of members,\n or certification of controlling person and beneficial owners)\n- Proof of address dated within the last 3 months (utility bill, bank\n statement, lease agreement, or official correspondence)\n- Tax ID or equivalent identifying-number documents\n- For non-U.S. beneficial owners — passport plus one additional\n government-issued ID\n\n\n### Parameters\n\n- `customerId: string`\n The ID of the customer to verify\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]; verificationStatus: string; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]`\n - `verificationStatus: string`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst verification = await client.verifications.submit({ customerId: 'Customer:019542f5-b3e7-1d02-0000-000000000001' });\n\nconsole.log(verification);\n```", perLanguage: { typescript: { method: 'client.verifications.submit', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.verifications.submit({\n customerId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n});\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst verification = await client.verifications.submit({\n customerId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n});\n\nconsole.log(verification.id);", }, python: { method: 'verifications.submit', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.verifications.submit(\n customer_id="Customer:019542f5-b3e7-1d02-0000-000000000001",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nverification = client.verifications.submit(\n customer_id="Customer:019542f5-b3e7-1d02-0000-000000000001",\n)\nprint(verification.id)', }, kotlin: { method: 'verifications().submit', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.verifications.VerificationSubmitParams\nimport com.lightspark.grid.models.verifications.VerificationSubmitResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: VerificationSubmitParams = VerificationSubmitParams.builder()\n .customerId("Customer:019542f5-b3e7-1d02-0000-000000000001")\n .build()\n val response: VerificationSubmitResponse = client.verifications().submit(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.verifications.Verification\nimport com.lightspark.grid.models.verifications.VerificationRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: VerificationRequest = VerificationRequest.builder()\n .customerId("Customer:019542f5-b3e7-1d02-0000-000000000001")\n .build()\n val verification: Verification = client.verifications().submit(params)\n}', }, go: { method: 'client.Verifications.Submit', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Verifications.Submit(context.TODO(), grid.VerificationSubmitParams{\n\t\tCustomerID: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tverification, err := client.Verifications.Submit(context.TODO(), grid.VerificationSubmitParams{\n\t\tVerificationRequest: grid.VerificationRequestParam{\n\t\t\tCustomerID: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", verification.ID)\n}\n', }, ruby: { method: 'verifications.submit', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.verifications.submit(customer_id: "Customer:019542f5-b3e7-1d02-0000-000000000001")\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nverification = lightspark_grid.verifications.submit(customer_id: "Customer:019542f5-b3e7-1d02-0000-000000000001")\n\nputs(verification)', }, cli: { method: 'verifications submit', @@ -3903,12 +3591,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'verifications->submit', example: - "verifications->submit(\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001'\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Verifications.Submit', - example: - 'VerificationSubmitParams parameters = new()\n{\n CustomerID = "Customer:019542f5-b3e7-1d02-0000-000000000001"\n};\n\nvar response = await client.Verifications.Submit(parameters);\n\nConsole.WriteLine(response);', + "verifications->submit(\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001'\n);\n\nvar_dump($verification);", }, http: { example: @@ -3928,12 +3611,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ id: string; createdAt: string; customerId: string; errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]; verificationStatus: string; updatedAt?: string; }', markdown: - "## list\n\n`client.verifications.list(cursor?: string, customerId?: string, limit?: number, verificationStatus?: string): { id: string; createdAt: string; customerId: string; errors: verification_error[]; verificationStatus: string; updatedAt?: string; }`\n\n**get** `/verifications`\n\nRetrieve a list of verifications with optional filtering by customer ID and status.\n\n\n### Parameters\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by customer ID\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `verificationStatus?: string`\n Filter by verification status\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]; verificationStatus: string; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]`\n - `verificationStatus: string`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const verificationListResponse of client.verifications.list()) {\n console.log(verificationListResponse);\n}\n```", + "## list\n\n`client.verifications.list(cursor?: string, customerId?: string, limit?: number, verificationStatus?: string): { id: string; createdAt: string; customerId: string; errors: verification_error[]; verificationStatus: string; updatedAt?: string; }`\n\n**get** `/verifications`\n\nRetrieve a list of verifications with optional filtering by customer ID and status.\n\n\n### Parameters\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by customer ID\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `verificationStatus?: string`\n Filter by verification status\n\n### Returns\n\n- `{ id: string; createdAt: string; customerId: string; errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]; verificationStatus: string; updatedAt?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `customerId: string`\n - `errors: { reason: string; resourceId: string; type: string; acceptedDocumentTypes?: string[]; field?: string; }[]`\n - `verificationStatus: string`\n - `updatedAt?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const verification of client.verifications.list()) {\n console.log(verification);\n}\n```", perLanguage: { typescript: { method: 'client.verifications.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const verificationListResponse of client.verifications.list()) {\n console.log(verificationListResponse.id);\n}", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const verification of client.verifications.list()) {\n console.log(verification.id);\n}", }, python: { method: 'verifications.list', @@ -3964,11 +3647,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "verifications->list(\n cursor: 'cursor',\n customerID: 'customerId',\n limit: 1,\n verificationStatus: 'RESOLVE_ERRORS',\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Verifications.List', - example: - 'VerificationListParams parameters = new();\n\nvar page = await client.Verifications.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/verifications \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4002,7 +3680,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'verifications().retrieve', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.verifications.VerificationRetrieveParams\nimport com.lightspark.grid.models.verifications.VerificationRetrieveResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val verification: VerificationRetrieveResponse = client.verifications().retrieve("verificationId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.verifications.Verification\nimport com.lightspark.grid.models.verifications.VerificationRetrieveParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val verification: Verification = client.verifications().retrieve("verificationId")\n}', }, go: { method: 'client.Verifications.Get', @@ -4024,11 +3702,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "verifications->retrieve('verificationId');\n\nvar_dump($verification);", }, - csharp: { - method: 'Verifications.Retrieve', - example: - 'VerificationRetrieveParams parameters = new()\n{\n VerificationID = "verificationId"\n};\n\nvar verification = await client.Verifications.Retrieve(parameters);\n\nConsole.WriteLine(verification);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/verifications/$VERIFICATION_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4047,32 +3720,32 @@ const EMBEDDED_METHODS: MethodEntry[] = [ params: ['country?: string;', 'currency?: string;'], response: '{ data?: { bankName: string; country: string; currency: string; displayName: string; }[]; }', markdown: - "## list\n\n`client.discoveries.list(country?: string, currency?: string): { data?: object[]; }`\n\n**get** `/discoveries`\n\nRetrieve available payment institution names for a given country and currency. Use this endpoint\nto look up supported banks and payment providers for a specific corridor.\nIf no country and currency parameter are provided, all payment institutions will be returned\n\nThe `bankName` field in each result is the value to pass as `bankName` when\ncreating an external account via `POST /customers/external-accounts`.\n\n\n### Parameters\n\n- `country?: string`\n ISO 3166-1 alpha-2 country code (e.g. PH)\n\n- `currency?: string`\n ISO 4217 currency code (e.g. PHP)\n\n### Returns\n\n- `{ data?: { bankName: string; country: string; currency: string; displayName: string; }[]; }`\n\n - `data?: { bankName: string; country: string; currency: string; displayName: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst discoveries = await client.discoveries.list();\n\nconsole.log(discoveries);\n```", + "## list\n\n`client.discoveries.list(country?: string, currency?: string): { data?: object[]; }`\n\n**get** `/discoveries`\n\nRetrieve available payment institution names for a given country and currency. Use this endpoint\nto look up supported banks and payment providers for a specific corridor.\nIf no country and currency parameter are provided, all payment institutions will be returned\n\nThe `bankName` field in each result is the value to pass as `bankName` when\ncreating an external account via `POST /customers/external-accounts`.\n\n\n### Parameters\n\n- `country?: string`\n ISO 3166-1 alpha-2 country code (e.g. PH)\n\n- `currency?: string`\n ISO 4217 currency code (e.g. PHP)\n\n### Returns\n\n- `{ data?: { bankName: string; country: string; currency: string; displayName: string; }[]; }`\n\n - `data?: { bankName: string; country: string; currency: string; displayName: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst discoveryListResponse = await client.discoveries.list();\n\nconsole.log(discoveryListResponse);\n```", perLanguage: { typescript: { method: 'client.discoveries.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst discoveries = await client.discoveries.list();\n\nconsole.log(discoveries.data);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst discoveryListResponse = await client.discoveries.list();\n\nconsole.log(discoveryListResponse.data);", }, python: { method: 'discoveries.list', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ndiscoveries = client.discoveries.list()\nprint(discoveries.data)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ndiscovery_list_response = client.discoveries.list()\nprint(discovery_list_response.data)', }, kotlin: { method: 'discoveries().list', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.discoveries.DiscoveryListParams\nimport com.lightspark.grid.models.discoveries.DiscoveryListResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val discoveries: DiscoveryListResponse = client.discoveries().list()\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.discoveries.DiscoveryListParams\nimport com.lightspark.grid.models.discoveries.DiscoveryListResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val discoveryListResponse: DiscoveryListResponse = client.discoveries().list()\n}', }, go: { method: 'client.Discoveries.List', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tdiscoveries, err := client.Discoveries.List(context.TODO(), grid.DiscoveryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", discoveries.Data)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tdiscoveryListResponse, err := client.Discoveries.List(context.TODO(), grid.DiscoveryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", discoveryListResponse.Data)\n}\n', }, ruby: { method: 'discoveries.list', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ndiscoveries = lightspark_grid.discoveries.list\n\nputs(discoveries)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ndiscovery_list_response = lightspark_grid.discoveries.list\n\nputs(discovery_list_response)', }, cli: { method: 'discoveries list', @@ -4081,12 +3754,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'discoveries->list', example: - "discoveries->list(\n country: 'country', currency: 'currency'\n);\n\nvar_dump($discoveries);", - }, - csharp: { - method: 'Discoveries.List', - example: - 'DiscoveryListParams parameters = new();\n\nvar discoveries = await client.Discoveries.List(parameters);\n\nConsole.WriteLine(discoveries);', + "discoveries->list(\n country: 'country', currency: 'currency'\n);\n\nvar_dump($discoveryListResponse);", }, http: { example: @@ -4100,38 +3768,38 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Create an authentication credential', description: - "Register an authentication credential for an Embedded Wallet customer.\n\nEmbedded Wallet internal accounts are initialized with an `EMAIL_OTP` credential tied to the customer email on the account. Use this endpoint to add another credential (`OAUTH` or `PASSKEY`), or to add `EMAIL_OTP` back after it has been removed. Only one `EMAIL_OTP` credential is supported per internal account; multiple distinct `PASSKEY` credentials may be registered.\n\nAdding a credential requires a signature from an existing verified credential on the same account. Call this endpoint with the new credential's details to receive `202` with `payloadToSign` and `requestId`. Use the session API keypair of an existing verified credential (decrypted client-side from its `encryptedSessionSigningKey`) to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `201` with the created `AuthMethod`. For `EMAIL_OTP`, the OTP email is triggered on the signed retry, and the credential must then be activated via `POST /auth/credentials/{id}/verify`.\n", + "Register an authentication credential for an Embedded Wallet customer.\n\nEmbedded Wallet internal accounts are initialized with an `EMAIL_OTP` credential tied to the customer email on the account. Use this endpoint to add another credential (`SMS_OTP`, `OAUTH`, or `PASSKEY`), or to add `EMAIL_OTP` / `SMS_OTP` back after it has been removed. Only one `EMAIL_OTP` and one `SMS_OTP` credential are supported per internal account; multiple distinct `PASSKEY` credentials may be registered.\n\nAdding a credential requires a signature from an existing verified credential on the same account. Call this endpoint with the new credential's details to receive `202` with `payloadToSign` and `requestId`. Use the session API keypair of an existing verified credential (decrypted client-side from its `encryptedSessionSigningKey`) to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `201` with the created `AuthMethod`. For OTP credentials, the one-time password is triggered on the signed retry, and the credential must then be activated via `POST /auth/credentials/{id}/verify`.\n", stainlessPath: '(resource) auth.credentials > (method) create', qualified: 'client.auth.credentials.create', params: [ - 'AuthCredentialCreateRequest: { accountId: string; type: object; } | { accountId: string; type: object; } | { accountId: string; type: object; };', + 'AuthCredentialCreateRequest: { accountId: string; type: object; } | { accountId: string; type: object; } | { accountId: string; type: object; } | { accountId: string; type: object; };', 'Grid-Wallet-Signature?: string;', 'Request-Id?: string;', ], response: - "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }", + "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }", markdown: - "## create\n\n`client.auth.credentials.create(AuthCredentialCreateRequest: auth_credential_create_request | auth_credential_create_request | auth_credential_create_request, Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }`\n\n**post** `/auth/credentials`\n\nRegister an authentication credential for an Embedded Wallet customer.\n\nEmbedded Wallet internal accounts are initialized with an `EMAIL_OTP` credential tied to the customer email on the account. Use this endpoint to add another credential (`OAUTH` or `PASSKEY`), or to add `EMAIL_OTP` back after it has been removed. Only one `EMAIL_OTP` credential is supported per internal account; multiple distinct `PASSKEY` credentials may be registered.\n\nAdding a credential requires a signature from an existing verified credential on the same account. Call this endpoint with the new credential's details to receive `202` with `payloadToSign` and `requestId`. Use the session API keypair of an existing verified credential (decrypted client-side from its `encryptedSessionSigningKey`) to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `201` with the created `AuthMethod`. For `EMAIL_OTP`, the OTP email is triggered on the signed retry, and the credential must then be activated via `POST /auth/credentials/{id}/verify`.\n\n\n### Parameters\n\n- `AuthCredentialCreateRequest: { accountId: string; type: object; } | { accountId: string; type: object; } | { accountId: string; type: object; }`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }`\n Strict wrapper around `AuthMethod`. Used directly as the registration response on `POST /auth/credentials` (all three credential types) and inside `AuthCredentialResponseOneOf` for the `EMAIL_OTP` branch of `POST /auth/credentials/{id}/challenge`. The only difference from `AuthMethod` is `unevaluatedProperties: false`, which disambiguates the oneOf against `PasskeyAuthChallenge` — without the strictness, an `AuthMethod` with extra fields would ambiguously match both branches.\n\n - `id: string`\n - `accountId: string`\n - `createdAt: string`\n - `nickname: string`\n - `type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'`\n - `updatedAt: string`\n - `credentialId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authMethodResponse = await client.auth.credentials.create({ AuthCredentialCreateRequest: { accountId: 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002', type: 'EMAIL_OTP' } });\n\nconsole.log(authMethodResponse);\n```", + "## create\n\n`client.auth.credentials.create(AuthCredentialCreateRequest: auth_credential_create_request | object | auth_credential_create_request | auth_credential_create_request, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**post** `/auth/credentials`\n\nRegister an authentication credential for an Embedded Wallet customer.\n\nEmbedded Wallet internal accounts are initialized with an `EMAIL_OTP` credential tied to the customer email on the account. Use this endpoint to add another credential (`SMS_OTP`, `OAUTH`, or `PASSKEY`), or to add `EMAIL_OTP` / `SMS_OTP` back after it has been removed. Only one `EMAIL_OTP` and one `SMS_OTP` credential are supported per internal account; multiple distinct `PASSKEY` credentials may be registered.\n\nAdding a credential requires a signature from an existing verified credential on the same account. Call this endpoint with the new credential's details to receive `202` with `payloadToSign` and `requestId`. Use the session API keypair of an existing verified credential (decrypted client-side from its `encryptedSessionSigningKey`) to build an API-key stamp over `payloadToSign`, then retry the same request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `201` with the created `AuthMethod`. For OTP credentials, the one-time password is triggered on the signed retry, and the credential must then be activated via `POST /auth/credentials/{id}/verify`.\n\n\n### Parameters\n\n- `AuthCredentialCreateRequest: { accountId: string; type: object; } | { accountId: string; type: object; } | { accountId: string; type: object; } | { accountId: string; type: object; }`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }`\n Strict wrapper around `AuthMethod`. Used directly as the registration response on `POST /auth/credentials` and inside `AuthCredentialResponseOneOf` for the `EMAIL_OTP` / `SMS_OTP` branches of `POST /auth/credentials/{id}/challenge`. The only difference from `AuthMethod` is `unevaluatedProperties: false`, which disambiguates the oneOf against `PasskeyAuthChallenge` — without the strictness, an `AuthMethod` with extra fields would ambiguously match both branches.\n\nFor `EMAIL_OTP` and `SMS_OTP` credentials, responses that initiate or reissue an OTP challenge carry `otpEncryptionTargetBundle` so the client can HPKE-encrypt the OTP code in the subsequent `POST /auth/credentials/{id}/verify` call without the plaintext code ever transiting the server. First-time EMAIL_OTP wallet bootstrap registration can omit it; call `POST /auth/credentials/{id}/challenge` if it is absent.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authMethodResponse = await client.auth.credentials.create({ AuthCredentialCreateRequest: { accountId: 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002', type: 'EMAIL_OTP' } });\n\nconsole.log(authMethodResponse);\n```", perLanguage: { typescript: { method: 'client.auth.credentials.create', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst authMethodResponse = await client.auth.credentials.create({\n AuthCredentialCreateRequest: {\n accountId: 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n type: 'EMAIL_OTP',\n },\n});\n\nconsole.log(authMethodResponse.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst authMethodResponse = await client.auth.credentials.create({\n AuthCredentialCreateRequest: {\n accountId: 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n type: 'EMAIL_OTP',\n },\n});\n\nconsole.log(authMethodResponse);", }, python: { method: 'auth.credentials.create', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nauth_method_response = client.auth.credentials.create(\n auth_credential_create_request={\n "account_id": "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n "type": "EMAIL_OTP",\n },\n)\nprint(auth_method_response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nauth_method_response = client.auth.credentials.create(\n auth_credential_create_request={\n "account_id": "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n "type": "EMAIL_OTP",\n },\n)\nprint(auth_method_response)', }, kotlin: { method: 'auth().credentials().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.auth.credentials.AuthMethodResponse\nimport com.lightspark.grid.models.auth.credentials.EmailOtpCredentialCreateRequest\nimport com.lightspark.grid.models.auth.credentials.OAuthCredentialCreateRequest\nimport com.lightspark.grid.models.auth.credentials.PasskeyCredentialCreateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: EmailOtpCredentialCreateRequest = EmailOtpCredentialCreateRequest.builder()\n .accountId("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n .type(JsonValue.from("EMAIL_OTP"))\n .build()\n val authMethodResponse: AuthMethodResponse = client.auth().credentials().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.auth.credentials.AuthCredentialCreateRequestOneOf\nimport com.lightspark.grid.models.auth.credentials.AuthMethodResponse\nimport com.lightspark.grid.models.auth.credentials.EmailOtpCredentialCreateRequest\nimport com.lightspark.grid.models.auth.credentials.OAuthCredentialCreateRequest\nimport com.lightspark.grid.models.auth.credentials.PasskeyCredentialCreateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: EmailOtpCredentialCreateRequest = EmailOtpCredentialCreateRequest.builder()\n .accountId("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n .type(JsonValue.from("EMAIL_OTP"))\n .build()\n val authMethodResponse: AuthMethodResponse = client.auth().credentials().create(params)\n}', }, go: { method: 'client.Auth.Credentials.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthMethodResponse, err := client.Auth.Credentials.New(context.TODO(), grid.AuthCredentialNewParams{\n\t\tAuthCredentialCreateRequest: grid.AuthCredentialCreateRequestOneOfUnionParam{\n\t\t\tOfEmailOtpCredentialCreateRequest: &grid.EmailOtpCredentialCreateRequestParam{\n\t\t\t\tAuthCredentialCreateRequestParam: grid.AuthCredentialCreateRequestParam{\n\t\t\t\t\tAccountID: "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n\t\t\t\t\tType: "EMAIL_OTP",\n\t\t\t\t},\n\t\t\t\tType: "EMAIL_OTP",\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", authMethodResponse.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthMethodResponse, err := client.Auth.Credentials.New(context.TODO(), grid.AuthCredentialNewParams{\n\t\tAuthCredentialCreateRequest: grid.AuthCredentialCreateRequestOneOfUnionParam{\n\t\t\tOfEmailOtpCredentialCreateRequest: &grid.EmailOtpCredentialCreateRequestParam{\n\t\t\t\tAuthCredentialCreateRequestParam: grid.AuthCredentialCreateRequestParam{\n\t\t\t\t\tAccountID: "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n\t\t\t\t\tType: "EMAIL_OTP",\n\t\t\t\t},\n\t\t\t\tType: "EMAIL_OTP",\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", authMethodResponse)\n}\n', }, ruby: { method: 'auth.credentials.create', @@ -4146,12 +3814,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'auth->credentials->create', example: - "auth->credentials->create(\n authCredentialCreateRequest: [\n 'accountID' => 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n 'type' => 'EMAIL_OTP',\n ],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authMethodResponse);", - }, - csharp: { - method: 'Auth.Credentials.Create', - example: - 'CredentialCreateParams parameters = new()\n{\n AuthCredentialCreateRequest = new EmailOtpCredentialCreateRequest()\n {\n AccountID = "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n Type = JsonSerializer.SerializeToElement("EMAIL_OTP"),\n },\n};\n\nvar authMethodResponse = await client.Auth.Credentials.Create(parameters);\n\nConsole.WriteLine(authMethodResponse);', + "auth->credentials->create(\n authCredentialCreateRequest: [\n 'accountID' => 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n 'type' => 'EMAIL_OTP',\n ],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authMethodResponse);", }, http: { example: @@ -4165,58 +3828,58 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Verify an authentication credential', description: - "Complete the verification step for a previously created authentication credential and issue a session signing key.\n\nFor `EMAIL_OTP` credentials, supply the one-time password that was emailed to the user along with a client-generated public key. For `OAUTH` credentials, supply a fresh OIDC token (`iat` must be less than 60 seconds before the request) along with the client-generated public key; this is also the reauthentication path after a prior session expired. The token identity (`iss`, `aud`, and `sub`) must match the OAuth credential being verified. In sandbox, the token's `nonce` must equal `sha256(clientPublicKey)`. For `PASSKEY` credentials, the client completes a WebAuthn assertion (`navigator.credentials.get()`) against the Grid-issued `challenge` returned from `POST /auth/credentials/{id}/challenge`, and submits the resulting `assertion` with the `Request-Id` header. The `clientPublicKey` for `PASSKEY` credentials is supplied on the challenge call, where it is bound into the pending session-creation request.\n\nOn success, the response contains an `encryptedSessionSigningKey` that is encrypted to the supplied `clientPublicKey`, along with an `expiresAt` timestamp marking when the session expires. The `clientPublicKey` is ephemeral and one-time-use per verification request.\n", + 'Complete the verification step for a previously created authentication credential and issue a session.\n\nFor `EMAIL_OTP` and `SMS_OTP` credentials, submit the `encryptedOtpBundle` produced by HPKE-encrypting `{otp_code, public_key}` under the `otpEncryptionTargetBundle` returned from registration when present, or from `POST /auth/credentials/{id}/challenge` when registration omitted it or the OTP must be reissued. The server is a pass-through and never sees the plaintext OTP code. On success the response is `202` with a `payloadToSign` carrying the `verificationToken` bound to the client\'s TEK public key — sign that token with the matching TEK private key, then retry the same request with the full stamp in `Grid-Wallet-Signature` and the `requestId` echoed in `Request-Id`. The signed retry returns `200` with the issued `AuthSession`. The TEK public key becomes the session API key on successful completion.\nIn sandbox mode, the OTP flow runs real HPKE end-to-end against a sandbox enclave keypair — clients build a real `encryptedOtpBundle` against the sandbox `otpEncryptionTargetBundle` and sign a real `verificationToken` with their TEK keypair. The only sandbox shortcut is the magic OTP code (`"000000"`) the user "receives" instead of a real email or SMS delivery.\n\nFor `OAUTH` credentials, supply a fresh OIDC token (`iat` must be less than 60 seconds before the request) along with the client-generated public key; this is also the reauthentication path after a prior session expired. The token identity (`iss`, `aud`, and `sub`) must match the OAuth credential being verified. In sandbox, the token\'s `nonce` must equal `sha256(clientPublicKey)`. For `PASSKEY` credentials, the client completes a WebAuthn assertion (`navigator.credentials.get()`) against the Grid-issued `challenge` returned from `POST /auth/credentials/{id}/challenge`, and submits the resulting `assertion` with the `Request-Id` header. The `clientPublicKey` for `PASSKEY` credentials is supplied on the challenge call, where it is bound into the pending session-creation request.\n\nOn success for `OAUTH` and `PASSKEY`, and on the signed retry for OTP credentials, the response contains an `AuthSession`. For `OAUTH` and `PASSKEY` the session signing key is delivered as `encryptedSessionSigningKey` (HPKE-sealed to the supplied `clientPublicKey`); for OTP credentials the client already holds the session signing key (the TEK private key it generated) and that field is omitted from the response. The `expiresAt` timestamp marks when the session expires.\n', stainlessPath: '(resource) auth.credentials > (method) verify', qualified: 'client.auth.credentials.verify', - params: ['id: string;', 'AuthCredentialVerifyRequest: object;', 'Request-Id?: string;'], + params: [ + 'id: string;', + 'AuthCredentialVerifyRequest: { type: object; };', + 'Grid-Wallet-Signature?: string;', + 'Request-Id?: string;', + ], response: - "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }", + "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }", markdown: - "## verify\n\n`client.auth.credentials.verify(id: string, AuthCredentialVerifyRequest: object, Request-Id?: string): object`\n\n**post** `/auth/credentials/{id}/verify`\n\nComplete the verification step for a previously created authentication credential and issue a session signing key.\n\nFor `EMAIL_OTP` credentials, supply the one-time password that was emailed to the user along with a client-generated public key. For `OAUTH` credentials, supply a fresh OIDC token (`iat` must be less than 60 seconds before the request) along with the client-generated public key; this is also the reauthentication path after a prior session expired. The token identity (`iss`, `aud`, and `sub`) must match the OAuth credential being verified. In sandbox, the token's `nonce` must equal `sha256(clientPublicKey)`. For `PASSKEY` credentials, the client completes a WebAuthn assertion (`navigator.credentials.get()`) against the Grid-issued `challenge` returned from `POST /auth/credentials/{id}/challenge`, and submits the resulting `assertion` with the `Request-Id` header. The `clientPublicKey` for `PASSKEY` credentials is supplied on the challenge call, where it is bound into the pending session-creation request.\n\nOn success, the response contains an `encryptedSessionSigningKey` that is encrypted to the supplied `clientPublicKey`, along with an `expiresAt` timestamp marking when the session expires. The `clientPublicKey` is ephemeral and one-time-use per verification request.\n\n\n### Parameters\n\n- `id: string`\n\n- `AuthCredentialVerifyRequest: object`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }`\n An authentication session on an Embedded Wallet internal account. Returned from `GET /auth/sessions` (list) and `POST /auth/credentials/{id}/verify` (on credential verification) or `POST /auth/sessions/{id}/refresh` (on mid-session refresh). Only session-issuing responses include `encryptedSessionSigningKey` — it is delivered exactly once at the moment the session is issued and is never returned by the list endpoint.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSession = await client.auth.credentials.verify('id', { AuthCredentialVerifyRequest: {} });\n\nconsole.log(authSession);\n```", + "## verify\n\n`client.auth.credentials.verify(id: string, AuthCredentialVerifyRequest: object, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**post** `/auth/credentials/{id}/verify`\n\nComplete the verification step for a previously created authentication credential and issue a session.\n\nFor `EMAIL_OTP` and `SMS_OTP` credentials, submit the `encryptedOtpBundle` produced by HPKE-encrypting `{otp_code, public_key}` under the `otpEncryptionTargetBundle` returned from registration when present, or from `POST /auth/credentials/{id}/challenge` when registration omitted it or the OTP must be reissued. The server is a pass-through and never sees the plaintext OTP code. On success the response is `202` with a `payloadToSign` carrying the `verificationToken` bound to the client's TEK public key — sign that token with the matching TEK private key, then retry the same request with the full stamp in `Grid-Wallet-Signature` and the `requestId` echoed in `Request-Id`. The signed retry returns `200` with the issued `AuthSession`. The TEK public key becomes the session API key on successful completion.\nIn sandbox mode, the OTP flow runs real HPKE end-to-end against a sandbox enclave keypair — clients build a real `encryptedOtpBundle` against the sandbox `otpEncryptionTargetBundle` and sign a real `verificationToken` with their TEK keypair. The only sandbox shortcut is the magic OTP code (`\"000000\"`) the user \"receives\" instead of a real email or SMS delivery.\n\nFor `OAUTH` credentials, supply a fresh OIDC token (`iat` must be less than 60 seconds before the request) along with the client-generated public key; this is also the reauthentication path after a prior session expired. The token identity (`iss`, `aud`, and `sub`) must match the OAuth credential being verified. In sandbox, the token's `nonce` must equal `sha256(clientPublicKey)`. For `PASSKEY` credentials, the client completes a WebAuthn assertion (`navigator.credentials.get()`) against the Grid-issued `challenge` returned from `POST /auth/credentials/{id}/challenge`, and submits the resulting `assertion` with the `Request-Id` header. The `clientPublicKey` for `PASSKEY` credentials is supplied on the challenge call, where it is bound into the pending session-creation request.\n\nOn success for `OAUTH` and `PASSKEY`, and on the signed retry for OTP credentials, the response contains an `AuthSession`. For `OAUTH` and `PASSKEY` the session signing key is delivered as `encryptedSessionSigningKey` (HPKE-sealed to the supplied `clientPublicKey`); for OTP credentials the client already holds the session signing key (the TEK private key it generated) and that field is omitted from the response. The `expiresAt` timestamp marks when the session expires.\n\n\n### Parameters\n\n- `id: string`\n\n- `AuthCredentialVerifyRequest: { type: object; }`\n Verify an SMS-OTP credential via the same secure two-leg flow as email OTP. The client HPKE-encrypts the OTP code (together with its public key) under the `otpEncryptionTargetBundle` returned from registration or `POST /auth/credentials/{id}/challenge`, submits the result here, and receives `202` with a `payloadToSign` carrying a `verificationToken` bound to the client's public key. The client signs that token with the matching private key and retries this request with `Grid-Wallet-Signature` + `Request-Id` headers to obtain the session. Plaintext OTP codes are never sent over the wire.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }`\n An authentication session on an Embedded Wallet internal account. Returned from `GET /auth/sessions` (list) and `POST /auth/credentials/{id}/verify` (on credential verification) or `POST /auth/sessions/{id}/refresh` (on mid-session refresh). Only session-issuing responses include `encryptedSessionSigningKey` — it is delivered exactly once at the moment the session is issued and is never returned by the list endpoint.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSession = await client.auth.credentials.verify('id', { AuthCredentialVerifyRequest: { type: 'SMS_OTP', encryptedOtpBundle: '{\"encappedPublic\":\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\",\"ciphertext\":\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\"}' } });\n\nconsole.log(authSession);\n```", perLanguage: { typescript: { method: 'client.auth.credentials.verify', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst authSession = await client.auth.credentials.verify('id', { AuthCredentialVerifyRequest: {} });\n\nconsole.log(authSession);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst authSession = await client.auth.credentials.verify('id', {\n AuthCredentialVerifyRequest: {\n type: 'SMS_OTP',\n encryptedOtpBundle:\n '{\"encappedPublic\":\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\",\"ciphertext\":\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\"}',\n },\n});\n\nconsole.log(authSession);", }, python: { method: 'auth.credentials.verify', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nauth_session = client.auth.credentials.verify(\n id="id",\n auth_credential_verify_request={},\n)\nprint(auth_session)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nauth_session = client.auth.credentials.verify(\n id="id",\n auth_credential_verify_request={\n "type": "SMS_OTP",\n "encrypted_otp_bundle": "{\\"encappedPublic\\":\\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\\",\\"ciphertext\\":\\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\\"}",\n },\n)\nprint(auth_session)', }, kotlin: { method: 'auth().credentials().verify', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.auth.credentials.AuthCredentialVerifyRequestOneOf\nimport com.lightspark.grid.models.auth.credentials.AuthSession\nimport com.lightspark.grid.models.auth.credentials.CredentialVerifyParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CredentialVerifyParams = CredentialVerifyParams.builder()\n .id("id")\n .authCredentialVerifyRequest(AuthCredentialVerifyRequestOneOf.builder().build())\n .build()\n val authSession: AuthSession = client.auth().credentials().verify(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.auth.credentials.AuthCredentialVerifyRequestOneOf\nimport com.lightspark.grid.models.auth.credentials.AuthSession\nimport com.lightspark.grid.models.auth.credentials.CredentialVerifyParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CredentialVerifyParams = CredentialVerifyParams.builder()\n .id("id")\n .authCredentialVerifyRequest(AuthCredentialVerifyRequestOneOf.builder()\n .type(JsonValue.from("SMS_OTP"))\n .encryptedOtpBundle("{\\"encappedPublic\\":\\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\\",\\"ciphertext\\":\\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\\"}")\n .build())\n .build()\n val authSession: AuthSession = client.auth().credentials().verify(params)\n}', }, go: { method: 'client.Auth.Credentials.Verify', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthSession, err := client.Auth.Credentials.Verify(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.AuthCredentialVerifyParams{\n\t\t\tAuthCredentialVerifyRequest: map[string]any{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authSession)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthSession, err := client.Auth.Credentials.Verify(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.AuthCredentialVerifyParams{\n\t\t\tAuthCredentialVerifyRequest: grid.AuthCredentialVerifyRequestOneOfParam{\n\t\t\t\tAuthCredentialVerifyRequestParam: grid.AuthCredentialVerifyRequestParam{\n\t\t\t\t\tType: "SMS_OTP",\n\t\t\t\t},\n\t\t\t\tType: "SMS_OTP",\n\t\t\t\tEncryptedOtpBundle: `{"encappedPublic":"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838","ciphertext":"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc"}`,\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", authSession)\n}\n', }, ruby: { method: 'auth.credentials.verify', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nauth_session = lightspark_grid.auth.credentials.verify("id", auth_credential_verify_request: {})\n\nputs(auth_session)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nauth_session = lightspark_grid.auth.credentials.verify(\n "id",\n auth_credential_verify_request: {\n type: "SMS_OTP",\n encryptedOtpBundle: "{\\"encappedPublic\\":\\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\\",\\"ciphertext\\":\\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\\"}"\n }\n)\n\nputs(auth_session)', }, cli: { method: 'credentials verify', example: - "grid auth:credentials verify \\\n --username 'My Username' \\\n --password 'My Password' \\\n --id id \\\n --auth-credential-verify-request '{}'", + 'grid auth:credentials verify \\\n --username \'My Username\' \\\n --password \'My Password\' \\\n --id id \\\n --auth-credential-verify-request "{type: SMS_OTP, encryptedOtpBundle: \'{\\"encappedPublic\\":\\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\\",\\"ciphertext\\":\\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\\"}\'}"', }, php: { method: 'auth->credentials->verify', example: - "auth->credentials->verify(\n 'id',\n authCredentialVerifyRequest: (object) [],\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authSession);", - }, - csharp: { - method: 'Auth.Credentials.Verify', - example: - 'CredentialVerifyParams parameters = new()\n{\n ID = "id",\n AuthCredentialVerifyRequest = JsonSerializer.Deserialize("{}"),\n};\n\nvar authSession = await client.Auth.Credentials.Verify(parameters);\n\nConsole.WriteLine(authSession);', + "auth->credentials->verify(\n 'id',\n authCredentialVerifyRequest: [\n 'type' => 'SMS_OTP',\n 'encryptedOtpBundle' => '{\"encappedPublic\":\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\",\"ciphertext\":\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\"}',\n ],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authSession);", }, http: { example: - "curl https://api.lightspark.com/grid/2025-10-13/auth/credentials/$ID/verify \\\n -H 'Content-Type: application/json' \\\n -u \"$GRID_CLIENT_ID:GRID_CLIENT_SECRET\" \\\n -d '{}'", + 'curl https://api.lightspark.com/grid/2025-10-13/auth/credentials/$ID/verify \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "type": "SMS_OTP",\n "encryptedOtpBundle": "{\\\\"encappedPublic\\\\":\\\\"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838\\\\",\\\\"ciphertext\\\\":\\\\"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc\\\\"}"\n }\'', }, }, }, @@ -4226,14 +3889,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Re-issue an authentication credential challenge', description: - "Re-issue the challenge for an existing authentication credential.\n\nFor `EMAIL_OTP` credentials, this triggers a new one-time password email to the address on file. The response is a plain `AuthMethod`; there is no challenge body to surface because the OTP is delivered out-of-band via email. After the user receives the new OTP, call `POST /auth/credentials/{id}/verify` to complete verification and issue a session.\n\n`OAUTH` credentials do not have a challenge step. To authenticate or reauthenticate an OAuth credential, call `POST /auth/credentials/{id}/verify` with a fresh OIDC token and a `clientPublicKey`.\n\nFor `PASSKEY` credentials, this issues a fresh Grid-generated WebAuthn challenge for reauthentication. The request body must carry the client's ephemeral `clientPublicKey` so Grid can bake it into the Turnkey session-creation payload the returned challenge is computed from — this seals the resulting session signing key to the client. The response is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn `credentialId`, new `challenge`, `requestId`, and `expiresAt`. The client passes `credentialId` as `allowCredentials[].id` and `challenge` as the WebAuthn challenge in `navigator.credentials.get()`, then submits the resulting assertion to `POST /auth/credentials/{id}/verify` with `Request-Id: ` to receive a session.\n", + "Re-issue the challenge for an existing authentication credential.\n\nFor `EMAIL_OTP` and `SMS_OTP` credentials, this triggers a new one-time password to the contact on file and returns a fresh `otpEncryptionTargetBundle` for the client to HPKE-encrypt the OTP attempt against. After the user receives the new OTP, build the `encryptedOtpBundle` under the new target bundle and call `POST /auth/credentials/{id}/verify` to begin the secure OTP login flow.\n\n`OAUTH` credentials do not have a challenge step. To authenticate or reauthenticate an OAuth credential, call `POST /auth/credentials/{id}/verify` with a fresh OIDC token and a `clientPublicKey`.\n\nFor `PASSKEY` credentials, this issues a fresh Grid reauthentication challenge. The request body must carry the client's ephemeral `clientPublicKey` so Grid can bake it into the session-creation payload the returned challenge is computed from — this seals the resulting session signing key to the client. The response is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn `credentialId`, new `challenge`, `requestId`, and `expiresAt`. The `challenge` value is the lowercase hex-encoded SHA-256 digest of the canonical session-creation body, not a base64url string. The client base64url-decodes `credentialId` for `allowCredentials[].id` and UTF-8 encodes `challenge` (for example, `new TextEncoder().encode(challenge)`) as the WebAuthn challenge in `navigator.credentials.get()`, then submits the resulting assertion to `POST /auth/credentials/{id}/verify` with `Request-Id: ` to receive a session.\n", stainlessPath: '(resource) auth.credentials > (method) challenge', qualified: 'client.auth.credentials.challenge', params: ['id: string;', 'clientPublicKey?: string;'], response: - "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; } | { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }", + '{ id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; } | { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }', markdown: - "## challenge\n\n`client.auth.credentials.challenge(id: string, clientPublicKey?: string): object | auth_method`\n\n**post** `/auth/credentials/{id}/challenge`\n\nRe-issue the challenge for an existing authentication credential.\n\nFor `EMAIL_OTP` credentials, this triggers a new one-time password email to the address on file. The response is a plain `AuthMethod`; there is no challenge body to surface because the OTP is delivered out-of-band via email. After the user receives the new OTP, call `POST /auth/credentials/{id}/verify` to complete verification and issue a session.\n\n`OAUTH` credentials do not have a challenge step. To authenticate or reauthenticate an OAuth credential, call `POST /auth/credentials/{id}/verify` with a fresh OIDC token and a `clientPublicKey`.\n\nFor `PASSKEY` credentials, this issues a fresh Grid-generated WebAuthn challenge for reauthentication. The request body must carry the client's ephemeral `clientPublicKey` so Grid can bake it into the Turnkey session-creation payload the returned challenge is computed from — this seals the resulting session signing key to the client. The response is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn `credentialId`, new `challenge`, `requestId`, and `expiresAt`. The client passes `credentialId` as `allowCredentials[].id` and `challenge` as the WebAuthn challenge in `navigator.credentials.get()`, then submits the resulting assertion to `POST /auth/credentials/{id}/verify` with `Request-Id: ` to receive a session.\n\n\n### Parameters\n\n- `id: string`\n\n- `clientPublicKey?: string`\n Required for `PASSKEY` credentials. Client-generated P-256 public key, hex-encoded in uncompressed SEC1 format (`04` prefix followed by the 32-byte X and 32-byte Y coordinates; 130 hex characters total). The matching private key must remain on the client. Grid bakes this key into the Turnkey session-creation payload that the returned `challenge` is computed from, so the resulting session signing key is sealed to the client. Ignored for `EMAIL_OTP`.\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; } | { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }`\n Discriminated response shape returned from `POST /auth/credentials/{id}/challenge`. For `EMAIL_OTP` credentials the body is a plain `AuthMethod` (wrapped as `AuthMethodResponse` to disambiguate the oneOf). For `PASSKEY` credentials the body is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn `credentialId`, Grid-issued `challenge`, `requestId`, and `expiresAt` that drive the subsequent assertion. OAuth credentials do not use the challenge endpoint. Registration responses from `POST /auth/credentials` use the simpler `AuthMethodResponse` shape directly for all three credential types.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authCredentialResponseOneOf = await client.auth.credentials.challenge('id');\n\nconsole.log(authCredentialResponseOneOf);\n```", + "## challenge\n\n`client.auth.credentials.challenge(id: string, clientPublicKey?: string): auth_method | auth_method`\n\n**post** `/auth/credentials/{id}/challenge`\n\nRe-issue the challenge for an existing authentication credential.\n\nFor `EMAIL_OTP` and `SMS_OTP` credentials, this triggers a new one-time password to the contact on file and returns a fresh `otpEncryptionTargetBundle` for the client to HPKE-encrypt the OTP attempt against. After the user receives the new OTP, build the `encryptedOtpBundle` under the new target bundle and call `POST /auth/credentials/{id}/verify` to begin the secure OTP login flow.\n\n`OAUTH` credentials do not have a challenge step. To authenticate or reauthenticate an OAuth credential, call `POST /auth/credentials/{id}/verify` with a fresh OIDC token and a `clientPublicKey`.\n\nFor `PASSKEY` credentials, this issues a fresh Grid reauthentication challenge. The request body must carry the client's ephemeral `clientPublicKey` so Grid can bake it into the session-creation payload the returned challenge is computed from — this seals the resulting session signing key to the client. The response is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn `credentialId`, new `challenge`, `requestId`, and `expiresAt`. The `challenge` value is the lowercase hex-encoded SHA-256 digest of the canonical session-creation body, not a base64url string. The client base64url-decodes `credentialId` for `allowCredentials[].id` and UTF-8 encodes `challenge` (for example, `new TextEncoder().encode(challenge)`) as the WebAuthn challenge in `navigator.credentials.get()`, then submits the resulting assertion to `POST /auth/credentials/{id}/verify` with `Request-Id: ` to receive a session.\n\n\n### Parameters\n\n- `id: string`\n\n- `clientPublicKey?: string`\n Required for `PASSKEY` credentials. Client-generated P-256 public key, hex-encoded in uncompressed SEC1 format (`04` prefix followed by the 32-byte X and 32-byte Y coordinates; 130 hex characters total). The matching private key must remain on the client. Grid bakes this key into the session-creation payload that the returned `challenge` is computed from, so the resulting session signing key is sealed to the client. Ignored for `EMAIL_OTP` and `SMS_OTP`.\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; } | { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }`\n Discriminated response shape returned from `POST /auth/credentials/{id}/challenge`. For `EMAIL_OTP` and `SMS_OTP` credentials the body is a plain `AuthMethod` (wrapped as `AuthMethodResponse` to disambiguate the oneOf). For `PASSKEY` credentials the body is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn `credentialId`, Grid-issued `challenge`, `requestId`, and `expiresAt` that drive the subsequent assertion. OAuth credentials do not use the challenge endpoint. Registration responses from `POST /auth/credentials` use the simpler `AuthMethodResponse` shape directly for all credential types.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authCredentialResponseOneOf = await client.auth.credentials.challenge('id');\n\nconsole.log(authCredentialResponseOneOf);\n```", perLanguage: { typescript: { method: 'client.auth.credentials.challenge', @@ -4253,7 +3916,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Auth.Credentials.Challenge', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthCredentialResponseOneOf, err := client.Auth.Credentials.Challenge(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.AuthCredentialChallengeParams{\n\t\t\tClientPublicKey: grid.String("04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authCredentialResponseOneOf)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthCredentialResponseOneOf, err := client.Auth.Credentials.Challenge(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.AuthCredentialChallengeParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authCredentialResponseOneOf)\n}\n', }, ruby: { method: 'auth.credentials.challenge', @@ -4270,11 +3933,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "auth->credentials->challenge(\n 'id',\n clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n);\n\nvar_dump($authCredentialResponseOneOf);", }, - csharp: { - method: 'Auth.Credentials.Challenge', - example: - 'CredentialChallengeParams parameters = new() { ID = "id" };\n\nvar authCredentialResponseOneOf = await client.Auth.Credentials.Challenge(parameters);\n\nConsole.WriteLine(authCredentialResponseOneOf);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/auth/credentials/$ID/challenge \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4294,7 +3952,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ data: { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }[]; }', markdown: - "## list\n\n`client.auth.credentials.list(accountId: string): { data: auth_method[]; }`\n\n**get** `/auth/credentials`\n\nRetrieve all authentication credentials registered on an Embedded Wallet internal account.\n\nThe response is not paginated: an internal account is expected to have a small, bounded number of credentials (typically 1–5), so all results are returned inline. Additional per-credential detail (such as active session expiry) is available on `GET /auth/sessions`.\n\n### Parameters\n\n- `accountId: string`\n Internal account id whose authentication credentials to list.\n\n### Returns\n\n- `{ data: { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }[]; }`\n\n - `data: { id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authCredentialListResponse = await client.auth.credentials.list({ accountId: 'accountId' });\n\nconsole.log(authCredentialListResponse);\n```", + "## list\n\n`client.auth.credentials.list(accountId: string): { data: auth_method[]; }`\n\n**get** `/auth/credentials`\n\nRetrieve all authentication credentials registered on an Embedded Wallet internal account.\n\nThe response is not paginated: an internal account is expected to have a small, bounded number of credentials (typically 1–5), so all results are returned inline. Additional per-credential detail (such as active session expiry) is available on `GET /auth/sessions`.\n\n### Parameters\n\n- `accountId: string`\n Internal account id whose authentication credentials to list.\n\n### Returns\n\n- `{ data: { id: string; accountId: string; createdAt: string; nickname: string; type: auth_method_type; updatedAt: string; credentialId?: string; }[]; }`\n\n - `data: { id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authCredentialListResponse = await client.auth.credentials.list({ accountId: 'accountId' });\n\nconsole.log(authCredentialListResponse);\n```", perLanguage: { typescript: { method: 'client.auth.credentials.list', @@ -4331,11 +3989,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "auth->credentials->list(\n accountID: 'accountId'\n);\n\nvar_dump($authCredentialListResponse);", }, - csharp: { - method: 'Auth.Credentials.List', - example: - 'CredentialListParams parameters = new() { AccountID = "accountId" };\n\nvar authCredentialListResponse = await client.Auth.Credentials.List(parameters);\n\nConsole.WriteLine(authCredentialListResponse);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/auth/credentials \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4354,7 +4007,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ params: ['id: string;', 'Grid-Wallet-Signature?: string;', 'Request-Id?: string;'], response: '{ expiresAt: string; payloadToSign: string; requestId: string; }', markdown: - "## delete\n\n`client.auth.credentials.delete(id: string, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**delete** `/auth/credentials/{id}`\n\nRevoke an authentication credential on an Embedded Wallet internal account.\n\nRevocation is a two-step flow because it must be authorized by a session on a *different* credential on the same internal account:\n\n1. Call `DELETE /auth/credentials/{id}` with no headers. The response is `202` with a `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of an existing verified credential on the same internal account — other than the one being revoked — to build an API-key stamp over `payloadToSign`, then retry the same `DELETE` request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `204`.\n\nThe account must retain at least one authentication credential; an account with only a single credential cannot use this endpoint to revoke it.\n\n\n### Parameters\n\n- `id: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ expiresAt: string; payloadToSign: string; requestId: string; }`\n 202 response returned from Embedded Wallet Auth endpoints that require a signed retry — `POST /auth/credentials` (adding an additional credential), `DELETE /auth/credentials/{id}` (revoking a credential), and `DELETE /auth/sessions/{id}` (revoking a session). Carries the signing fields from `SignedRequestChallenge` plus the `type` of the authentication credential involved (being added, revoked, or that issued the session being revoked). The client already knows the target resource id from the request path / body it just sent, so nothing beyond `type` is echoed in the response.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSignedRequestChallenge = await client.auth.credentials.delete('id');\n\nconsole.log(authSignedRequestChallenge);\n```", + "## delete\n\n`client.auth.credentials.delete(id: string, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**delete** `/auth/credentials/{id}`\n\nRevoke an authentication credential on an Embedded Wallet internal account.\n\nRevocation is a two-step flow because it must be authorized by a session on a *different* credential on the same internal account:\n\n1. Call `DELETE /auth/credentials/{id}` with no headers. The response is `202` with a `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of an existing verified credential on the same internal account — other than the one being revoked — to build an API-key stamp over `payloadToSign`, then retry the same `DELETE` request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `204`.\n\nThe account must retain at least one authentication credential; an account with only a single credential cannot use this endpoint to revoke it.\n\n\n### Parameters\n\n- `id: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ expiresAt: string; payloadToSign: string; requestId: string; }`\n 202 response returned from Embedded Wallet Auth endpoints that require a signed retry — `POST /auth/credentials` (adding an additional credential), `DELETE /auth/credentials/{id}` (revoking a credential), `DELETE /auth/sessions/{id}` (revoking a session), and the `EMAIL_OTP` / `SMS_OTP` branch of `POST /auth/credentials/{id}/verify` (the secure OTP login flow, where the client submits an `encryptedOtpBundle` and receives a `verificationToken` to sign for the second-leg session issuance). Carries the signing fields from `SignedRequestChallenge` plus the `type` of the authentication credential involved (being added, revoked, that issued the session being revoked, or being authenticated). The client already knows the target resource id from the request path / body it just sent, so nothing beyond `type` is echoed in the response.\n\nThe keypair used to compute the stamp depends on the operation. For credential / session management retries, sign with the session API keypair of an existing verified credential on the same internal account. For OTP verify retries, sign with the ephemeral Target Encryption Key (TEK) the client generated for this login — its public key is the one carried inside the `encryptedOtpBundle` and bound into the `verificationToken`, and it becomes the client's session API key on successful completion.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSignedRequestChallenge = await client.auth.credentials.delete('id');\n\nconsole.log(authSignedRequestChallenge);\n```", perLanguage: { typescript: { method: 'client.auth.credentials.delete', @@ -4389,12 +4042,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'auth->credentials->delete', example: - "auth->credentials->delete(\n 'id',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authSignedRequestChallenge);", - }, - csharp: { - method: 'Auth.Credentials.Delete', - example: - 'CredentialDeleteParams parameters = new() { ID = "id" };\n\nvar authSignedRequestChallenge = await client.Auth.Credentials.Delete(parameters);\n\nConsole.WriteLine(authSignedRequestChallenge);', + "auth->credentials->delete(\n 'id',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authSignedRequestChallenge);", }, http: { example: @@ -4414,7 +4062,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ params: ['accountId: string;'], response: '{ data: object[]; }', markdown: - "## list\n\n`client.auth.sessions.list(accountId: string): { data: auth_session[]; }`\n\n**get** `/auth/sessions`\n\nRetrieve all active authentication sessions on an Embedded Wallet internal account. A session is created each time a credential is verified via `POST /auth/credentials/{id}/verify`, and remains active until its `expiresAt` passes or it is revoked via `DELETE /auth/sessions/{id}`.\n\nThe response is not paginated: an internal account is expected to have a small, bounded number of concurrent sessions (one per signed-in device, typically 1–4), so all results are returned inline.\n\n### Parameters\n\n- `accountId: string`\n Internal account id whose sessions to list.\n\n### Returns\n\n- `{ data: object[]; }`\n\n - `data: { id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst sessionListResponse = await client.auth.sessions.list({ accountId: 'accountId' });\n\nconsole.log(sessionListResponse);\n```", + "## list\n\n`client.auth.sessions.list(accountId: string): { data: auth_session[]; }`\n\n**get** `/auth/sessions`\n\nRetrieve all active authentication sessions on an Embedded Wallet internal account. A session is created each time a credential is verified via `POST /auth/credentials/{id}/verify`, and remains active until its `expiresAt` passes or it is revoked via `DELETE /auth/sessions/{id}`.\n\nThe response is not paginated: an internal account is expected to have a small, bounded number of concurrent sessions (one per signed-in device, typically 1–4), so all results are returned inline.\n\n### Parameters\n\n- `accountId: string`\n Internal account id whose sessions to list.\n\n### Returns\n\n- `{ data: object[]; }`\n\n - `data: { id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }[]`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst sessionListResponse = await client.auth.sessions.list({ accountId: 'accountId' });\n\nconsole.log(sessionListResponse);\n```", perLanguage: { typescript: { method: 'client.auth.sessions.list', @@ -4451,11 +4099,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "auth->sessions->list(accountID: 'accountId');\n\nvar_dump($sessionListResponse);", }, - csharp: { - method: 'Auth.Sessions.List', - example: - 'SessionListParams parameters = new() { AccountID = "accountId" };\n\nvar sessionListResponse = await client.Auth.Sessions.List(parameters);\n\nConsole.WriteLine(sessionListResponse);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/auth/sessions \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4474,7 +4117,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ params: ['id: string;', 'Grid-Wallet-Signature?: string;', 'Request-Id?: string;'], response: '{ expiresAt: string; payloadToSign: string; requestId: string; }', markdown: - "## delete\n\n`client.auth.sessions.delete(id: string, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**delete** `/auth/sessions/{id}`\n\nRevoke an authentication session on an Embedded Wallet internal account. Revocation is a two-step signed-retry flow:\n\n1. Call `DELETE /auth/sessions/{id}` with no headers. The response is `202` with a `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of a verified session on the same internal account (this can be the session being revoked, for self-logout) to build an API-key stamp over `payloadToSign`, then retry the same `DELETE` request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `204`.\n\nSessions also expire on their own. `404` is returned whenever the `id` does not match an active session — whether the session was never issued, was already revoked by a prior call, or has expired past its `expiresAt`. The response code reflects the resource state, not an error in the client's flow: re-revoking an already-revoked or expired session is safe and idempotent at the user intent level.\n\n\n### Parameters\n\n- `id: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ expiresAt: string; payloadToSign: string; requestId: string; }`\n 202 response returned from Embedded Wallet Auth endpoints that require a signed retry — `POST /auth/credentials` (adding an additional credential), `DELETE /auth/credentials/{id}` (revoking a credential), and `DELETE /auth/sessions/{id}` (revoking a session). Carries the signing fields from `SignedRequestChallenge` plus the `type` of the authentication credential involved (being added, revoked, or that issued the session being revoked). The client already knows the target resource id from the request path / body it just sent, so nothing beyond `type` is echoed in the response.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSignedRequestChallenge = await client.auth.sessions.delete('id');\n\nconsole.log(authSignedRequestChallenge);\n```", + "## delete\n\n`client.auth.sessions.delete(id: string, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**delete** `/auth/sessions/{id}`\n\nRevoke an authentication session on an Embedded Wallet internal account. Revocation is a two-step signed-retry flow:\n\n1. Call `DELETE /auth/sessions/{id}` with no headers. The response is `202` with a `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Use the session API keypair of a verified session on the same internal account (this can be the session being revoked, for self-logout) to build an API-key stamp over `payloadToSign`, then retry the same `DELETE` request with that full stamp as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `204`.\n\nSessions also expire on their own. `404` is returned whenever the `id` does not match an active session — whether the session was never issued, was already revoked by a prior call, or has expired past its `expiresAt`. The response code reflects the resource state, not an error in the client's flow: re-revoking an already-revoked or expired session is safe and idempotent at the user intent level.\n\n\n### Parameters\n\n- `id: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ expiresAt: string; payloadToSign: string; requestId: string; }`\n 202 response returned from Embedded Wallet Auth endpoints that require a signed retry — `POST /auth/credentials` (adding an additional credential), `DELETE /auth/credentials/{id}` (revoking a credential), `DELETE /auth/sessions/{id}` (revoking a session), and the `EMAIL_OTP` / `SMS_OTP` branch of `POST /auth/credentials/{id}/verify` (the secure OTP login flow, where the client submits an `encryptedOtpBundle` and receives a `verificationToken` to sign for the second-leg session issuance). Carries the signing fields from `SignedRequestChallenge` plus the `type` of the authentication credential involved (being added, revoked, that issued the session being revoked, or being authenticated). The client already knows the target resource id from the request path / body it just sent, so nothing beyond `type` is echoed in the response.\n\nThe keypair used to compute the stamp depends on the operation. For credential / session management retries, sign with the session API keypair of an existing verified credential on the same internal account. For OTP verify retries, sign with the ephemeral Target Encryption Key (TEK) the client generated for this login — its public key is the one carried inside the `encryptedOtpBundle` and bound into the `verificationToken`, and it becomes the client's session API key on successful completion.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSignedRequestChallenge = await client.auth.sessions.delete('id');\n\nconsole.log(authSignedRequestChallenge);\n```", perLanguage: { typescript: { method: 'client.auth.sessions.delete', @@ -4509,12 +4152,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'auth->sessions->delete', example: - "auth->sessions->delete(\n 'id',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authSignedRequestChallenge);", - }, - csharp: { - method: 'Auth.Sessions.Delete', - example: - 'SessionDeleteParams parameters = new() { ID = "id" };\n\nvar authSignedRequestChallenge = await client.Auth.Sessions.Delete(parameters);\n\nConsole.WriteLine(authSignedRequestChallenge);', + "auth->sessions->delete(\n 'id',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($authSignedRequestChallenge);", }, http: { example: @@ -4528,59 +4166,54 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Refresh an authentication session', description: - 'Refresh an active Embedded Wallet auth session and create a new session signing key. Session refresh is a two-step signed-retry flow:\n\n1. Call `POST /auth/sessions/{id}/refresh` with the request body `{ "clientPublicKey": "04..." }` and no signature headers. Grid builds a Turnkey create-read-write-session payload, binds the supplied `clientPublicKey` into that payload, persists it as a pending request, and returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Sign `payloadToSign` with the current session signing key, then retry the same request with the full API-key stamp as `Grid-Wallet-Signature`, the `requestId` echoed back as `Request-Id`, and the same `clientPublicKey` in the request body. On success, Grid returns a new `AuthSession` with an `encryptedSessionSigningKey` sealed to that client public key.\n\nThe original session must still be active on both steps so it can authorize the refresh. If the session has already expired, use the credential reauthentication flow instead.\n', + 'Refresh an active Embedded Wallet auth session and create a new session signing key. Session refresh is a two-step signed-retry flow:\n\n1. Call `POST /auth/sessions/{id}/refresh` with the request body `{ "clientPublicKey": "04..." }` and no signature headers. Grid builds a Grid session-refresh payload, binds the supplied `clientPublicKey` into that payload, persists it as a pending request, and returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Sign `payloadToSign` with the current session signing key, then retry the same request with the full API-key stamp as `Grid-Wallet-Signature`, the `requestId` echoed back as `Request-Id`, and the same `clientPublicKey` in the request body. On success, Grid returns a new `AuthSession` with an `encryptedSessionSigningKey` sealed to that client public key.\n\nThe original session must still be active on both steps so it can authorize the refresh. If the session has already expired, use the credential reauthentication flow instead.\n', stainlessPath: '(resource) auth.sessions > (method) refresh', qualified: 'client.auth.sessions.refresh', params: [ 'id: string;', - 'clientPublicKey: string;', + 'AuthSessionRefreshRequest: { clientPublicKey: string; };', 'Grid-Wallet-Signature?: string;', 'Request-Id?: string;', ], response: - "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }", + "{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }", markdown: - "## refresh\n\n`client.auth.sessions.refresh(id: string, clientPublicKey: string, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**post** `/auth/sessions/{id}/refresh`\n\nRefresh an active Embedded Wallet auth session and create a new session signing key. Session refresh is a two-step signed-retry flow:\n\n1. Call `POST /auth/sessions/{id}/refresh` with the request body `{ \"clientPublicKey\": \"04...\" }` and no signature headers. Grid builds a Turnkey create-read-write-session payload, binds the supplied `clientPublicKey` into that payload, persists it as a pending request, and returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Sign `payloadToSign` with the current session signing key, then retry the same request with the full API-key stamp as `Grid-Wallet-Signature`, the `requestId` echoed back as `Request-Id`, and the same `clientPublicKey` in the request body. On success, Grid returns a new `AuthSession` with an `encryptedSessionSigningKey` sealed to that client public key.\n\nThe original session must still be active on both steps so it can authorize the refresh. If the session has already expired, use the credential reauthentication flow instead.\n\n\n### Parameters\n\n- `id: string`\n\n- `clientPublicKey: string`\n Client-generated P-256 public key, hex-encoded in uncompressed SEC1 format (`04` prefix followed by the 32-byte X and 32-byte Y coordinates; 130 hex characters total). The matching private key must remain on the client. Grid binds this key into the session-creation payload on the initial call and seals the returned `encryptedSessionSigningKey` to it on the signed retry.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }`\n An authentication session on an Embedded Wallet internal account. Returned from `GET /auth/sessions` (list) and `POST /auth/credentials/{id}/verify` (on credential verification) or `POST /auth/sessions/{id}/refresh` (on mid-session refresh). Only session-issuing responses include `encryptedSessionSigningKey` — it is delivered exactly once at the moment the session is issued and is never returned by the list endpoint.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSession = await client.auth.sessions.refresh('Session:019542f5-b3e7-1d02-0000-000000000003', { clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2' });\n\nconsole.log(authSession);\n```", + "## refresh\n\n`client.auth.sessions.refresh(id: string, AuthSessionRefreshRequest: { clientPublicKey: string; }, Grid-Wallet-Signature?: string, Request-Id?: string): object`\n\n**post** `/auth/sessions/{id}/refresh`\n\nRefresh an active Embedded Wallet auth session and create a new session signing key. Session refresh is a two-step signed-retry flow:\n\n1. Call `POST /auth/sessions/{id}/refresh` with the request body `{ \"clientPublicKey\": \"04...\" }` and no signature headers. Grid builds a Grid session-refresh payload, binds the supplied `clientPublicKey` into that payload, persists it as a pending request, and returns `202` with `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Sign `payloadToSign` with the current session signing key, then retry the same request with the full API-key stamp as `Grid-Wallet-Signature`, the `requestId` echoed back as `Request-Id`, and the same `clientPublicKey` in the request body. On success, Grid returns a new `AuthSession` with an `encryptedSessionSigningKey` sealed to that client public key.\n\nThe original session must still be active on both steps so it can authorize the refresh. If the session has already expired, use the credential reauthentication flow instead.\n\n\n### Parameters\n\n- `id: string`\n\n- `AuthSessionRefreshRequest: { clientPublicKey: string; }`\n Request body for refreshing an active authentication session. The `clientPublicKey` is required on both steps of the signed-retry flow. On the initial call, Grid binds this key into the session-creation payload returned as `payloadToSign`; on the signed retry, the client echoes the same key back and Grid uses it to encrypt the newly issued session signing key.\n - `clientPublicKey: string`\n Client-generated P-256 public key, hex-encoded in uncompressed SEC1 format (`04` prefix followed by the 32-byte X and 32-byte Y coordinates; 130 hex characters total). The matching private key must remain on the client. Grid binds this key into the session-creation payload on the initial call and seals the returned `encryptedSessionSigningKey` to it on the signed retry.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; accountId: string; createdAt: string; nickname: string; type: 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; updatedAt: string; credentialId?: string; }`\n An authentication session on an Embedded Wallet internal account. Returned from `GET /auth/sessions` (list) and `POST /auth/credentials/{id}/verify` (on credential verification) or `POST /auth/sessions/{id}/refresh` (on mid-session refresh). Only session-issuing responses include `encryptedSessionSigningKey` — it is delivered exactly once at the moment the session is issued and is never returned by the list endpoint.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst authSession = await client.auth.sessions.refresh('Session:019542f5-b3e7-1d02-0000-000000000003', { AuthSessionRefreshRequest: { clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2' } });\n\nconsole.log(authSession);\n```", perLanguage: { typescript: { method: 'client.auth.sessions.refresh', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst authSession = await client.auth.sessions.refresh(\n 'Session:019542f5-b3e7-1d02-0000-000000000003',\n {\n clientPublicKey:\n '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n },\n);\n\nconsole.log(authSession);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst authSession = await client.auth.sessions.refresh(\n 'Session:019542f5-b3e7-1d02-0000-000000000003',\n {\n AuthSessionRefreshRequest: {\n clientPublicKey:\n '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n },\n },\n);\n\nconsole.log(authSession);", }, python: { method: 'auth.sessions.refresh', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nauth_session = client.auth.sessions.refresh(\n id="Session:019542f5-b3e7-1d02-0000-000000000003",\n client_public_key="04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n)\nprint(auth_session)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nauth_session = client.auth.sessions.refresh(\n id="Session:019542f5-b3e7-1d02-0000-000000000003",\n auth_session_refresh_request={\n "client_public_key": "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2"\n },\n)\nprint(auth_session)', }, kotlin: { method: 'auth().sessions().refresh', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.auth.credentials.AuthSession\nimport com.lightspark.grid.models.auth.sessions.SessionRefreshParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SessionRefreshParams = SessionRefreshParams.builder()\n .id("Session:019542f5-b3e7-1d02-0000-000000000003")\n .clientPublicKey("04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2")\n .build()\n val authSession: AuthSession = client.auth().sessions().refresh(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.auth.credentials.AuthSession\nimport com.lightspark.grid.models.auth.sessions.AuthSessionRefreshRequest\nimport com.lightspark.grid.models.auth.sessions.SessionRefreshParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: SessionRefreshParams = SessionRefreshParams.builder()\n .id("Session:019542f5-b3e7-1d02-0000-000000000003")\n .authSessionRefreshRequest(AuthSessionRefreshRequest.builder()\n .clientPublicKey("04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2")\n .build())\n .build()\n val authSession: AuthSession = client.auth().sessions().refresh(params)\n}', }, go: { method: 'client.Auth.Sessions.Refresh', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthSession, err := client.Auth.Sessions.Refresh(\n\t\tcontext.TODO(),\n\t\t"Session:019542f5-b3e7-1d02-0000-000000000003",\n\t\tgrid.AuthSessionRefreshParams{\n\t\t\tClientPublicKey: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", authSession)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tauthSession, err := client.Auth.Sessions.Refresh(\n\t\tcontext.TODO(),\n\t\t"Session:019542f5-b3e7-1d02-0000-000000000003",\n\t\tgrid.AuthSessionRefreshParams{\n\t\t\tAuthSessionRefreshRequest: grid.AuthSessionRefreshRequestParam{\n\t\t\t\tClientPublicKey: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\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", authSession)\n}\n', }, ruby: { method: 'auth.sessions.refresh', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nauth_session = lightspark_grid.auth.sessions.refresh(\n "Session:019542f5-b3e7-1d02-0000-000000000003",\n client_public_key: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2"\n)\n\nputs(auth_session)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nauth_session = lightspark_grid.auth.sessions.refresh(\n "Session:019542f5-b3e7-1d02-0000-000000000003",\n auth_session_refresh_request: {\n clientPublicKey: "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2"\n }\n)\n\nputs(auth_session)', }, cli: { method: 'sessions refresh', example: - "grid auth:sessions refresh \\\n --username 'My Username' \\\n --password 'My Password' \\\n --id Session:019542f5-b3e7-1d02-0000-000000000003 \\\n --client-public-key 04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2", + "grid auth:sessions refresh \\\n --username 'My Username' \\\n --password 'My Password' \\\n --id Session:019542f5-b3e7-1d02-0000-000000000003 \\\n --auth-session-refresh-request '{clientPublicKey: 04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2}'", }, php: { method: 'auth->sessions->refresh', example: - "auth->sessions->refresh(\n 'Session:019542f5-b3e7-1d02-0000-000000000003',\n clientPublicKey: '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ',\n requestID: 'Request:019542f5-b3e7-1d02-0000-000000000010',\n);\n\nvar_dump($authSession);", - }, - csharp: { - method: 'Auth.Sessions.Refresh', - example: - 'SessionRefreshParams parameters = new()\n{\n ID = "Session:019542f5-b3e7-1d02-0000-000000000003",\n ClientPublicKey = "04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2",\n};\n\nvar authSession = await client.Auth.Sessions.Refresh(parameters);\n\nConsole.WriteLine(authSession);', + "auth->sessions->refresh(\n 'Session:019542f5-b3e7-1d02-0000-000000000003',\n authSessionRefreshRequest: [\n 'clientPublicKey' => '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2',\n ],\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n requestID: 'Request:019542f5-b3e7-1d02-0000-000000000010',\n);\n\nvar_dump($authSession);", }, http: { example: @@ -4642,11 +4275,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->create(\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n name: 'Payroll Automation Agent',\n policy: [\n 'defaultExecutionMode' => 'AUTO',\n 'permissions' => ['VIEW_TRANSACTIONS'],\n 'spendingLimits' => [\n 'currency' => 'USD',\n 'perTransactionLimit' => 50000,\n 'dailyLimit' => 500000,\n 'dailyTransactionLimit' => 10,\n 'monthlyLimit' => 5000000,\n ],\n 'accountRestrictions' => [\n 'accountRules' => [\n [\n 'accountID' => 'Account:019542f5-b3e7-1d02-0000-000000000001',\n 'executionMode' => 'AUTO',\n 'perTransactionLimit' => 10000,\n ],\n ],\n 'allowedAccountIDs' => ['Account:019542f5-b3e7-1d02-0000-000000000001'],\n ],\n 'approvalThresholds' => ['amount' => 100000, 'currency' => 'USD'],\n ],\n);\n\nvar_dump($agentCreateResponse);", }, - csharp: { - method: 'Agents.Create', - example: - 'AgentCreateParams parameters = new()\n{\n CustomerID = "Customer:019542f5-b3e7-1d02-0000-000000000001",\n Name = "Payroll Automation Agent",\n Policy = new()\n {\n DefaultExecutionMode = DefaultExecutionMode.Auto,\n Permissions =\n [\n Permission.ViewTransactions\n ],\n SpendingLimits = new()\n {\n Currency = "USD",\n PerTransactionLimit = 50000,\n DailyLimit = 500000,\n DailyTransactionLimit = 10,\n MonthlyLimit = 5000000,\n },\n AccountRestrictions = new()\n {\n AccountRules =\n [\n new()\n {\n AccountID = "Account:019542f5-b3e7-1d02-0000-000000000001",\n ExecutionMode = ExecutionMode.Auto,\n PerTransactionLimit = 10000,\n },\n ],\n AllowedAccountIds =\n [\n "Account:019542f5-b3e7-1d02-0000-000000000001"\n ],\n },\n ApprovalThresholds = new()\n {\n Amount = 100000,\n Currency = "USD",\n },\n },\n};\n\nvar agentCreateResponse = await client.Agents.Create(parameters);\n\nConsole.WriteLine(agentCreateResponse);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",\n "name": "Payroll Automation Agent",\n "policy": {\n "defaultExecutionMode": "AUTO",\n "permissions": [\n "VIEW_TRANSACTIONS"\n ],\n "spendingLimits": {\n "currency": "USD",\n "perTransactionLimit": 50000\n }\n }\n }\'', @@ -4711,11 +4339,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->list(\n createdAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n createdBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n cursor: 'cursor',\n customerID: 'customerId',\n isConnected: true,\n isPaused: true,\n limit: 1,\n updatedAfter: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n updatedBefore: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Agents.List', - example: - 'AgentListParams parameters = new();\n\nvar page = await client.Agents.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4741,9 +4364,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'startDate?: string;', ], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## list_approvals\n\n`client.agents.listApprovals(agentId?: string, cursor?: string, customerId?: string, endDate?: string, limit?: number, sortOrder?: 'asc' | 'desc', startDate?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**get** `/agents/approvals`\n\nRetrieve a paginated list of agent actions that require platform approval. Filter by `agentId` or `customerId` to scope results to a specific agent or customer. Approve or reject individual actions via `POST /agents/{agentId}/actions/{actionId}/approve` or `POST /agents/{agentId}/actions/{actionId}/reject`.\n\n\n### Parameters\n\n- `agentId?: string`\n Filter by agent ID\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by customer ID\n\n- `endDate?: string`\n Filter by end date (inclusive) in ISO 8601 format\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `startDate?: string`\n Filter by start date (inclusive) in ISO 8601 format\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const agentAction of client.agents.listApprovals()) {\n console.log(agentAction);\n}\n```", + "## list_approvals\n\n`client.agents.listApprovals(agentId?: string, cursor?: string, customerId?: string, endDate?: string, limit?: number, sortOrder?: 'asc' | 'desc', startDate?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**get** `/agents/approvals`\n\nRetrieve a paginated list of agent actions that require platform approval. Filter by `agentId` or `customerId` to scope results to a specific agent or customer. Approve or reject individual actions via `POST /agents/{agentId}/actions/{actionId}/approve` or `POST /agents/{agentId}/actions/{actionId}/reject`.\n\n\n### Parameters\n\n- `agentId?: string`\n Filter by agent ID\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `customerId?: string`\n Filter by customer ID\n\n- `endDate?: string`\n Filter by end date (inclusive) in ISO 8601 format\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `startDate?: string`\n Filter by start date (inclusive) in ISO 8601 format\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const agentAction of client.agents.listApprovals()) {\n console.log(agentAction);\n}\n```", perLanguage: { typescript: { method: 'client.agents.listApprovals', @@ -4779,11 +4402,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->listApprovals(\n agentID: 'agentId',\n cursor: 'cursor',\n customerID: 'customerId',\n endDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n limit: 1,\n sortOrder: 'asc',\n startDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Agents.ListApprovals', - example: - 'AgentListApprovalsParams parameters = new();\n\nvar page = await client.Agents.ListApprovals(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/approvals \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4839,11 +4457,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->retrieve('agentId');\n\nvar_dump($agent);", }, - csharp: { - method: 'Agents.Retrieve', - example: - 'AgentRetrieveParams parameters = new() { AgentID = "agentId" };\n\nvar agent = await client.Agents.Retrieve(parameters);\n\nConsole.WriteLine(agent);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -4899,11 +4512,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->update(\n 'agentId', isPaused: true, name: 'Updated Payroll Agent'\n);\n\nvar_dump($agent);", }, - csharp: { - method: 'Agents.Update', - example: - 'AgentUpdateParams parameters = new() { AgentID = "agentId" };\n\nvar agent = await client.Agents.Update(parameters);\n\nConsole.WriteLine(agent);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "isPaused": true,\n "name": "Updated Payroll Agent"\n }\'', @@ -4957,11 +4565,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->delete('agentId');\n\nvar_dump($result);", }, - csharp: { - method: 'Agents.Delete', - example: - 'AgentDeleteParams parameters = new() { AgentID = "agentId" };\n\nawait client.Agents.Delete(parameters);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID \\\n -X DELETE \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -5003,12 +4606,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'agents().updatePolicy', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.Agent\nimport com.lightspark.grid.models.agents.AgentUpdatePolicyParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val agent: Agent = client.agents().updatePolicy("agentId")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.Agent\nimport com.lightspark.grid.models.agents.AgentPolicyUpdateRequest\nimport com.lightspark.grid.models.agents.AgentUpdatePolicyParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: AgentUpdatePolicyParams = AgentUpdatePolicyParams.builder()\n .agentId("agentId")\n .agentPolicyUpdateRequest(AgentPolicyUpdateRequest.builder().build())\n .build()\n val agent: Agent = client.agents().updatePolicy(params)\n}', }, go: { method: 'client.Agents.UpdatePolicy', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tagent, err := client.Agents.UpdatePolicy(\n\t\tcontext.TODO(),\n\t\t"agentId",\n\t\tgrid.AgentUpdatePolicyParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", agent.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tagent, err := client.Agents.UpdatePolicy(\n\t\tcontext.TODO(),\n\t\t"agentId",\n\t\tgrid.AgentUpdatePolicyParams{\n\t\t\tAgentPolicyUpdateRequest: grid.AgentPolicyUpdateRequestParam{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", agent.ID)\n}\n', }, ruby: { method: 'agents.update_policy', @@ -5025,11 +4628,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->updatePolicy(\n 'agentId',\n accountRestrictions: [\n 'accountRules' => [\n [\n 'accountID' => 'Account:019542f5-b3e7-1d02-0000-000000000001',\n 'executionMode' => 'AUTO',\n 'perTransactionLimit' => 10000,\n ],\n ],\n 'allowedAccountIDs' => ['Account:019542f5-b3e7-1d02-0000-000000000001'],\n ],\n approvalThresholds: ['amount' => 100000, 'currency' => 'USD'],\n defaultExecutionMode: 'AUTO',\n permissions: ['VIEW_TRANSACTIONS'],\n spendingLimits: [\n 'currency' => 'USD',\n 'dailyLimit' => 500000,\n 'dailyTransactionLimit' => 10,\n 'monthlyLimit' => 5000000,\n 'perTransactionLimit' => 50000,\n ],\n);\n\nvar_dump($agent);", }, - csharp: { - method: 'Agents.UpdatePolicy', - example: - 'AgentUpdatePolicyParams parameters = new() { AgentID = "agentId" };\n\nvar agent = await client.Agents.UpdatePolicy(parameters);\n\nConsole.WriteLine(agent);', - }, http: { example: "curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID/policy \\\n -X PATCH \\\n -H 'Content-Type: application/json' \\\n -u \"$GRID_CLIENT_ID:GRID_CLIENT_SECRET\" \\\n -d '{}'", @@ -5084,11 +4682,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->retrieve();\n\nvar_dump($agent);", }, - csharp: { - method: 'Agents.Me.Retrieve', - example: - 'MeRetrieveParams parameters = new();\n\nvar agent = await client.Agents.Me.Retrieve(parameters);\n\nConsole.WriteLine(agent);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5111,9 +4704,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'Idempotency-Key?: string;', ], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## create_transfer_in\n\n`client.agents.me.createTransferIn(destination: { accountId: string; }, source: { accountId: string; }, amount?: number, Idempotency-Key?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/me/transfer-in`\n\nTransfer funds from an external account to an internal account for the authenticated agent's customer. Accounts must belong to the agent's customer. Requires the CREATE_TRANSFERS permission in the agent's policy.\nIf the agent's policy requires approval for this amount, the transaction will be created in a pending state and must be approved by the platform via `POST /agents/{agentId}/actions/{actionId}/approve`.\nThis endpoint should only be used for external account sources with pull functionality (e.g. ACH Pull). Otherwise, use the payment instructions on the internal account to deposit funds.\n\n\n### Parameters\n\n- `destination: { accountId: string; }`\n Destination internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `source: { accountId: string; }`\n Source external account details\n - `accountId: string`\n Reference to an external account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.createTransferIn({\n destination: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n source: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n});\n\nconsole.log(agentAction);\n```", + "## create_transfer_in\n\n`client.agents.me.createTransferIn(destination: { accountId: string; }, source: { accountId: string; }, amount?: number, Idempotency-Key?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/me/transfer-in`\n\nTransfer funds from an external account to an internal account for the authenticated agent's customer. Accounts must belong to the agent's customer. Requires the CREATE_TRANSFERS permission in the agent's policy.\nIf the agent's policy requires approval for this amount, the transaction will be created in a pending state and must be approved by the platform via `POST /agents/{agentId}/actions/{actionId}/approve`.\nThis endpoint should only be used for external account sources with pull functionality (e.g. ACH Pull). Otherwise, use the payment instructions on the internal account to deposit funds.\n\n\n### Parameters\n\n- `destination: { accountId: string; }`\n Destination internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `source: { accountId: string; }`\n Source external account details\n - `accountId: string`\n Reference to an external account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.createTransferIn({\n destination: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n source: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n});\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.me.createTransferIn', @@ -5128,12 +4721,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'agents().me().createTransferIn', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.AgentAction\nimport com.lightspark.grid.models.agents.me.MeCreateTransferInParams\nimport com.lightspark.grid.models.transferin.ExternalAccountReference\nimport com.lightspark.grid.models.transferin.InternalAccountReference\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: MeCreateTransferInParams = MeCreateTransferInParams.builder()\n .destination(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .source(ExternalAccountReference.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .build()\n val agentAction: AgentAction = client.agents().me().createTransferIn(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.AgentAction\nimport com.lightspark.grid.models.transferin.ExternalAccountReference\nimport com.lightspark.grid.models.transferin.InternalAccountReference\nimport com.lightspark.grid.models.transferin.TransferInRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TransferInRequest = TransferInRequest.builder()\n .destination(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .source(ExternalAccountReference.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .build()\n val agentAction: AgentAction = client.agents().me().createTransferIn(params)\n}', }, go: { method: 'client.Agents.Me.NewTransferIn', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithAgentAccessToken("My Agent Access Token"),\n\t)\n\tagentAction, err := client.Agents.Me.NewTransferIn(context.TODO(), grid.AgentMeNewTransferInParams{\n\t\tDestination: grid.InternalAccountReferenceParam{\n\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tSource: grid.ExternalAccountReferenceParam{\n\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t\tAmount: grid.Int(12550),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", agentAction.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithAgentAccessToken("My Agent Access Token"),\n\t)\n\tagentAction, err := client.Agents.Me.NewTransferIn(context.TODO(), grid.AgentMeNewTransferInParams{\n\t\tTransferInRequest: grid.TransferInRequestParam{\n\t\t\tDestination: grid.InternalAccountReferenceParam{\n\t\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t\t},\n\t\t\tSource: grid.ExternalAccountReferenceParam{\n\t\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\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", agentAction.ID)\n}\n', }, ruby: { method: 'agents.me.create_transfer_in', @@ -5150,11 +4743,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->createTransferIn(\n destination: [\n 'accountID' => 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123'\n ],\n source: [\n 'accountID' => 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965'\n ],\n amount: 12550,\n idempotencyKey: '550e8400-e29b-41d4-a716-446655440000',\n);\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Me.CreateTransferIn', - example: - 'MeCreateTransferInParams parameters = new()\n{\n Destination = new("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"),\n Source = new("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"),\n};\n\nvar agentAction = await client.Agents.Me.CreateTransferIn(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/transfer-in \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN" \\\n -d \'{\n "destination": {\n "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "source": {\n "accountId": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "amount": 12550\n }\'', @@ -5171,15 +4759,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) agents.me > (method) create_transfer_out', qualified: 'client.agents.me.createTransferOut', params: [ - 'destination: { accountId: string; };', + 'destination: { accountId: string; paymentRail?: string; };', 'source: { accountId: string; };', 'amount?: number;', + 'remittanceInformation?: string;', 'Idempotency-Key?: string;', ], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## create_transfer_out\n\n`client.agents.me.createTransferOut(destination: { accountId: string; }, source: { accountId: string; }, amount?: number, Idempotency-Key?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/me/transfer-out`\n\nTransfer funds from an internal account to an external account for the authenticated agent's customer. Accounts must belong to the agent's customer. Requires the CREATE_TRANSFERS permission in the agent's policy.\nIf the agent's policy requires approval for this amount, the transaction will be created in a pending state and must be approved by the platform via `POST /agents/{agentId}/actions/{actionId}/approve`.\n\n\n### Parameters\n\n- `destination: { accountId: string; }`\n Destination external account details\n - `accountId: string`\n Reference to an external account ID\n\n- `source: { accountId: string; }`\n Source internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.createTransferOut({\n destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n});\n\nconsole.log(agentAction);\n```", + "## create_transfer_out\n\n`client.agents.me.createTransferOut(destination: { accountId: string; paymentRail?: string; }, source: { accountId: string; }, amount?: number, remittanceInformation?: string, Idempotency-Key?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/me/transfer-out`\n\nTransfer funds from an internal account to an external account for the authenticated agent's customer. Accounts must belong to the agent's customer. Requires the CREATE_TRANSFERS permission in the agent's policy.\nIf the agent's policy requires approval for this amount, the transaction will be created in a pending state and must be approved by the platform via `POST /agents/{agentId}/actions/{actionId}/approve`.\n\n\n### Parameters\n\n- `destination: { accountId: string; paymentRail?: string; }`\n Destination external account details\n - `accountId: string`\n Reference to an external account ID\n - `paymentRail?: string`\n The payment rail to use for the transfer. Must be one of the rails supported by the destination account. If not specified, the system will select a default rail.\n\n- `source: { accountId: string; }`\n Source internal account details\n - `accountId: string`\n Reference to an internal account ID\n\n- `amount?: number`\n Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)\n\n- `remittanceInformation?: string`\n Free-form information about the payment that travels with it to the recipient. The field this populates depends on the payment rail: for ACH it populates the Addenda record, for FedNow and RTP it populates the remittanceInformation field, and for wires it populates the OBI (Originator to Beneficiary Information) / beneficiary information.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.createTransferOut({\n destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n});\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.me.createTransferOut', @@ -5194,12 +4783,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'agents().me().createTransferOut', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.AgentAction\nimport com.lightspark.grid.models.agents.me.MeCreateTransferOutParams\nimport com.lightspark.grid.models.transferin.ExternalAccountReference\nimport com.lightspark.grid.models.transferin.InternalAccountReference\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: MeCreateTransferOutParams = MeCreateTransferOutParams.builder()\n .destination(ExternalAccountReference.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .source(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .build()\n val agentAction: AgentAction = client.agents().me().createTransferOut(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.AgentAction\nimport com.lightspark.grid.models.transferin.InternalAccountReference\nimport com.lightspark.grid.models.transferout.TransferOutRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: TransferOutRequest = TransferOutRequest.builder()\n .destination(TransferOutRequest.Destination.builder()\n .accountId("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965")\n .build())\n .source(InternalAccountReference.builder()\n .accountId("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123")\n .build())\n .build()\n val agentAction: AgentAction = client.agents().me().createTransferOut(params)\n}', }, go: { method: 'client.Agents.Me.NewTransferOut', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithAgentAccessToken("My Agent Access Token"),\n\t)\n\tagentAction, err := client.Agents.Me.NewTransferOut(context.TODO(), grid.AgentMeNewTransferOutParams{\n\t\tDestination: grid.ExternalAccountReferenceParam{\n\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t\tSource: grid.InternalAccountReferenceParam{\n\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tAmount: grid.Int(12550),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", agentAction.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithAgentAccessToken("My Agent Access Token"),\n\t)\n\tagentAction, err := client.Agents.Me.NewTransferOut(context.TODO(), grid.AgentMeNewTransferOutParams{\n\t\tTransferOutRequest: grid.TransferOutRequestParam{\n\t\t\tDestination: grid.TransferOutRequestDestinationParam{\n\t\t\t\tAccountID: "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t\t},\n\t\t\tSource: grid.InternalAccountReferenceParam{\n\t\t\t\tAccountID: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\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", agentAction.ID)\n}\n', }, ruby: { method: 'agents.me.create_transfer_out', @@ -5214,16 +4803,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'agents->me->createTransferOut', example: - "agents->me->createTransferOut(\n destination: [\n 'accountID' => 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965'\n ],\n source: [\n 'accountID' => 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123'\n ],\n amount: 12550,\n idempotencyKey: '550e8400-e29b-41d4-a716-446655440000',\n);\n\nvar_dump($agentAction);", - }, - csharp: { - method: 'Agents.Me.CreateTransferOut', - example: - 'MeCreateTransferOutParams parameters = new()\n{\n Destination = new("ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"),\n Source = new("InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"),\n};\n\nvar agentAction = await client.Agents.Me.CreateTransferOut(parameters);\n\nConsole.WriteLine(agentAction);', + "agents->me->createTransferOut(\n destination: [\n 'accountID' => 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n 'paymentRail' => 'ACH',\n ],\n source: [\n 'accountID' => 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123'\n ],\n amount: 12550,\n remittanceInformation: '12345',\n idempotencyKey: '550e8400-e29b-41d4-a716-446655440000',\n);\n\nvar_dump($agentAction);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/transfer-out \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN" \\\n -d \'{\n "destination": {\n "accountId": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "source": {\n "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "amount": 12550\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/transfer-out \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN" \\\n -d \'{\n "destination": {\n "accountId": "ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n },\n "source": {\n "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n },\n "amount": 12550,\n "remittanceInformation": "12345"\n }\'', }, }, }, @@ -5243,9 +4827,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET';", ], response: - "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", + "{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }", markdown: - "## list_internal_accounts\n\n`client.agents.me.listInternalAccounts(currency?: string, cursor?: string, limit?: number, type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**get** `/agents/me/internal-accounts`\n\nRetrieve the internal accounts belonging to the customer this agent operates on behalf of. Use this to discover available source accounts for transfers and quotes, and to verify which accounts are accessible under the agent's `accountRestrictions` policy.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for the customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for platform-managed holding accounts.\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const internalAccount of client.agents.me.listInternalAccounts()) {\n console.log(internalAccount);\n}\n```", + "## list_internal_accounts\n\n`client.agents.me.listInternalAccounts(currency?: string, cursor?: string, limit?: number, type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'): { id: string; balance: currency_amount; createdAt: string; fundingPaymentInstructions: payment_instructions[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: currency_amount; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n**get** `/agents/me/internal-accounts`\n\nRetrieve the internal accounts belonging to the customer this agent operates on behalf of. Use this to discover available source accounts for transfers and quotes, and to verify which accounts are accessible under the agent's `accountRestrictions` policy.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `type?: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n Filter by internal account type. Use `EMBEDDED_WALLET` to find the self-custodial wallet provisioned for the customer, or `INTERNAL_FIAT` / `INTERNAL_CRYPTO` for platform-managed holding accounts.\n\n### Returns\n\n- `{ id: string; balance: { amount: number; currency: currency; }; createdAt: string; fundingPaymentInstructions: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; totalBalance: { amount: number; currency: currency; }; type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'; updatedAt: string; customerId?: string; privateEnabled?: boolean; }`\n\n - `id: string`\n - `balance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `createdAt: string`\n - `fundingPaymentInstructions: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'`\n - `totalBalance: { amount: number; currency: { code?: string; decimals?: number; name?: string; symbol?: string; }; }`\n - `type: 'INTERNAL_FIAT' | 'INTERNAL_CRYPTO' | 'EMBEDDED_WALLET'`\n - `updatedAt: string`\n - `customerId?: string`\n - `privateEnabled?: boolean`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const internalAccount of client.agents.me.listInternalAccounts()) {\n console.log(internalAccount);\n}\n```", perLanguage: { typescript: { method: 'client.agents.me.listInternalAccounts', @@ -5281,11 +4865,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->listInternalAccounts(\n currency: 'currency', cursor: 'cursor', limit: 1, type: 'INTERNAL_FIAT'\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Agents.Me.ListInternalAccounts', - example: - 'MeListInternalAccountsParams parameters = new();\n\nvar page = await client.Agents.Me.ListInternalAccounts(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/internal-accounts \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5314,10 +4893,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED';", "type?: 'INCOMING' | 'OUTGOING';", ], - response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }", + response: 'object | object | object', markdown: - "## list\n\n`client.agents.me.transactions.list(accountIdentifier?: string, cursor?: string, endDate?: string, limit?: number, receiverAccountIdentifier?: string, reference?: string, senderAccountIdentifier?: string, sortOrder?: 'asc' | 'desc', startDate?: string, status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED', type?: 'INCOMING' | 'OUTGOING'): object | object`\n\n**get** `/agents/me/transactions`\n\nRetrieve a paginated list of transactions for the authenticated agent's customer. Results are automatically scoped to the agent's associated customer — no customer filter is needed or accepted.\n\n\n### Parameters\n\n- `accountIdentifier?: string`\n Filter by account identifier (matches either sender or receiver)\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `endDate?: string`\n Filter by end date (inclusive) in ISO 8601 format\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `receiverAccountIdentifier?: string`\n Filter by receiver account identifier\n\n- `reference?: string`\n Filter by reference\n\n- `senderAccountIdentifier?: string`\n Filter by sender account identifier\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `startDate?: string`\n Filter by start date (inclusive) in ISO 8601 format\n\n- `status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n Status of a payment transaction.\n\n| Status | Description |\n|--------|-------------|\n| `CREATED` | Initial lookup has been created |\n| `PENDING` | Quote has been created |\n| `PROCESSING` | Funding has been received and payment initiated |\n| `COMPLETED` | Cross border payment has been received, converted and payment has been sent to the offramp network |\n| `REJECTED` | Receiving institution or wallet rejected payment, payment has been refunded |\n| `FAILED` | An error occurred during payment |\n| `REFUNDED` | Payment was unable to complete and refunded |\n| `EXPIRED` | Quote has expired |\n\n- `type?: 'INCOMING' | 'OUTGOING'`\n Type of transaction (incoming payment or outgoing payment)\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const transaction of client.agents.me.transactions.list()) {\n console.log(transaction);\n}\n```", + "## list\n\n`client.agents.me.transactions.list(accountIdentifier?: string, cursor?: string, endDate?: string, limit?: number, receiverAccountIdentifier?: string, reference?: string, senderAccountIdentifier?: string, sortOrder?: 'asc' | 'desc', startDate?: string, status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED', type?: 'INCOMING' | 'OUTGOING'): object | object | object`\n\n**get** `/agents/me/transactions`\n\nRetrieve a paginated list of transactions for the authenticated agent's customer. Results are automatically scoped to the agent's associated customer — no customer filter is needed or accepted.\n\n\n### Parameters\n\n- `accountIdentifier?: string`\n Filter by account identifier (matches either sender or receiver)\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `endDate?: string`\n Filter by end date (inclusive) in ISO 8601 format\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `receiverAccountIdentifier?: string`\n Filter by receiver account identifier\n\n- `reference?: string`\n Filter by reference\n\n- `senderAccountIdentifier?: string`\n Filter by sender account identifier\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `startDate?: string`\n Filter by start date (inclusive) in ISO 8601 format\n\n- `status?: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'`\n Status of a payment transaction.\n\n| Status | Description |\n|--------|-------------|\n| `CREATED` | Initial lookup has been created |\n| `PENDING` | Quote has been created |\n| `PROCESSING` | Funding has been received and payment initiated |\n| `COMPLETED` | Cross border payment has been received, converted and payment has been sent to the offramp network |\n| `REJECTED` | Receiving institution or wallet rejected payment, payment has been refunded |\n| `FAILED` | An error occurred during payment |\n| `REFUNDED` | Payment was unable to complete and refunded |\n| `EXPIRED` | Quote has expired |\n\n- `type?: 'INCOMING' | 'OUTGOING'`\n Type of transaction (incoming payment or outgoing payment)\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const transaction of client.agents.me.transactions.list()) {\n console.log(transaction);\n}\n```", perLanguage: { typescript: { method: 'client.agents.me.transactions.list', @@ -5353,11 +4931,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->transactions->list(\n accountIdentifier: 'accountIdentifier',\n cursor: 'cursor',\n endDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n limit: 1,\n receiverAccountIdentifier: 'receiverAccountIdentifier',\n reference: 'reference',\n senderAccountIdentifier: 'senderAccountIdentifier',\n sortOrder: 'asc',\n startDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n status: TransactionStatus::CREATED,\n type: TransactionType::INCOMING,\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Agents.Me.Transactions.List', - example: - 'TransactionListParams parameters = new();\n\nvar page = await client.Agents.Me.Transactions.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/transactions \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5374,10 +4947,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) agents.me.transactions > (method) retrieve', qualified: 'client.agents.me.transactions.retrieve', params: ['transactionId: string;'], - response: - "{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: currency_amount; status: transaction_status; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: incoming_rate_details; reconciliationInstructions?: reconciliation_instructions; settledAt?: string; source?: transaction_source_one_of; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: currency_amount; source: transaction_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: payment_instructions[]; quoteId?: string; rateDetails?: outgoing_rate_details; receivedAmount?: currency_amount; reconciliationInstructions?: reconciliation_instructions; refund?: object; settledAt?: string; updatedAt?: string; }", + response: 'object | object | object', markdown: - "## retrieve\n\n`client.agents.me.transactions.retrieve(transactionId: string): object | object`\n\n**get** `/agents/me/transactions/{transactionId}`\n\nRetrieve a specific transaction belonging to the authenticated agent's customer. Returns 404 if the transaction exists but belongs to a different customer.\n\n\n### Parameters\n\n- `transactionId: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.agents.me.transactions.retrieve('transactionId');\n\nconsole.log(transaction);\n```", + "## retrieve\n\n`client.agents.me.transactions.retrieve(transactionId: string): object | object | object`\n\n**get** `/agents/me/transactions/{transactionId}`\n\nRetrieve a specific transaction belonging to the authenticated agent's customer. Returns 404 if the transaction exists but belongs to a different customer.\n\n\n### Parameters\n\n- `transactionId: string`\n\n### Returns\n\n- `{ id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n Parent transaction row for a card authorization and all of the pulls / settlements / refunds that reconcile against it. Child events are rolled up into the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. Delivered as the payload of the generic transaction webhook stream (extends the Transaction model with a card destination type) on every transition.\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst transaction = await client.agents.me.transactions.retrieve('transactionId');\n\nconsole.log(transaction);\n```", perLanguage: { typescript: { method: 'client.agents.me.transactions.retrieve', @@ -5414,11 +4986,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->transactions->retrieve('transactionId');\n\nvar_dump($transaction);", }, - csharp: { - method: 'Agents.Me.Transactions.Retrieve', - example: - 'TransactionRetrieveParams parameters = new()\n{\n TransactionID = "transactionId"\n};\n\nvar transaction = await client.Agents.Me.Transactions.Retrieve(parameters);\n\nConsole.WriteLine(transaction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/transactions/$TRANSACTION_ID \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5443,13 +5010,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'immediatelyExecute?: boolean;', 'lookupId?: string;', 'purposeOfPayment?: string;', + 'remittanceInformation?: string;', 'senderCustomerInfo?: object;', 'Idempotency-Key?: string;', ], response: - "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }", + "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }", markdown: - "## create\n\n`client.agents.me.quotes.create(destination: object, lockedCurrencyAmount: number, lockedCurrencySide: 'SENDING' | 'RECEIVING', source: object, description?: string, immediatelyExecute?: boolean, lookupId?: string, purposeOfPayment?: string, senderCustomerInfo?: object, Idempotency-Key?: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }`\n\n**post** `/agents/me/quotes`\n\nGenerate a quote for a cross-currency transfer on behalf of the authenticated agent's customer. Accounts referenced in the request must belong to the agent's customer. Requires the CREATE_QUOTES permission in the agent's policy.\nIf the agent's defaultExecutionMode is APPROVAL_REQUIRED, or the quote amount exceeds the agent's approvalThresholds, the resulting transaction will require explicit approval before funds move.\n\n\n### Parameters\n\n- `destination: object`\n\n- `lockedCurrencyAmount: number`\n The amount to send/receive in the smallest unit of the locked currency (eg. cents). See `lockedCurrencySide` for more information.\n\n- `lockedCurrencySide: 'SENDING' | 'RECEIVING'`\n The side of the quote which should be locked and specified in the `lockedCurrencyAmount`. For example, if I want to send exactly $5 MXN from my wallet, I would set this to \"sending\", and the `lockedCurrencyAmount` to 500 (in cents). If I want the receiver to receive exactly $10 USD, I would set this to \"receiving\" and the `lockedCurrencyAmount` to 10000 (in cents).\n\n- `source: object`\n\n- `description?: string`\n Optional description/memo for the transfer\n\n- `immediatelyExecute?: boolean`\n Whether to immediately execute the quote after creation. If true, the quote will be executed and the transaction will be created at the current exchange rate. It should only be used if you don't want to lock and view rate details before executing the quote. If you are executing a pre-existing quote, use the `/quotes/{quoteId}/execute` endpoint instead. This is false by default.\nThis can only be used for quotes with a `source` which is either an internal account, or has direct pull functionality (e.g. ACH pull with an external account).\nNot supported when the `source` is an internal account of type `EMBEDDED_WALLET`: those transfers require a `Grid-Wallet-Signature` over the `payloadToSign` returned in the quote response, which is not available in a combined create-and-execute call. Create the quote first with `immediatelyExecute: false` and then call `POST /quotes/{quoteId}/execute` with the `Grid-Wallet-Signature` stamp header.\n\n- `lookupId?: string`\n Lookup ID from a previous receiver lookup request. If provided, this can make the quote creation more efficient by reusing cached lookup data.\nNOTE: This is required for UMA destinations due to counterparty institution requirements. See `senderCustomerInfo` for more information.\n\n- `purposeOfPayment?: string`\n The purpose of the payment. This may be required when sending to certain geographies (e.g. India).\n\n- `senderCustomerInfo?: object`\n Key-value pairs of additional information about the sender which was requested by the destination. This is relevant when the destination requires more sender info than was provided during customer creation.\nAny fields specified in `requiredPayerDataFields` from the response of the `/receiver/uma/{receiverUmaAddress}` (lookupUma) or `/receiver/external-account/{accountId}` (lookupExternalAccount) endpoints MUST be provided here if they were requested. If the destination did not request any additional information, this field can be omitted.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.agents.me.quotes.create({\n destination: {},\n lockedCurrencyAmount: 1000,\n lockedCurrencySide: 'SENDING',\n source: {},\n});\n\nconsole.log(quote);\n```", + "## create\n\n`client.agents.me.quotes.create(destination: object, lockedCurrencyAmount: number, lockedCurrencySide: 'SENDING' | 'RECEIVING', source: object, description?: string, immediatelyExecute?: boolean, lookupId?: string, purposeOfPayment?: string, remittanceInformation?: string, senderCustomerInfo?: object, Idempotency-Key?: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }`\n\n**post** `/agents/me/quotes`\n\nGenerate a quote for a cross-currency transfer on behalf of the authenticated agent's customer. Accounts referenced in the request must belong to the agent's customer. Requires the CREATE_QUOTES permission in the agent's policy.\nIf the agent's defaultExecutionMode is APPROVAL_REQUIRED, or the quote amount exceeds the agent's approvalThresholds, the resulting transaction will require explicit approval before funds move.\n\n\n### Parameters\n\n- `destination: object`\n\n- `lockedCurrencyAmount: number`\n The amount to send/receive in the smallest unit of the locked currency (eg. cents). See `lockedCurrencySide` for more information.\n\n- `lockedCurrencySide: 'SENDING' | 'RECEIVING'`\n The side of the quote which should be locked and specified in the `lockedCurrencyAmount`. For example, if I want to send exactly $5 MXN from my wallet, I would set this to \"sending\", and the `lockedCurrencyAmount` to 500 (in cents). If I want the receiver to receive exactly $10 USD, I would set this to \"receiving\" and the `lockedCurrencyAmount` to 10000 (in cents).\n\n- `source: object`\n\n- `description?: string`\n Optional description/memo for the transfer\n\n- `immediatelyExecute?: boolean`\n Whether to immediately execute the quote after creation. If true, the quote will be executed and the transaction will be created at the current exchange rate. It should only be used if you don't want to lock and view rate details before executing the quote. If you are executing a pre-existing quote, use the `/quotes/{quoteId}/execute` endpoint instead. This is false by default.\nThis can only be used for quotes with a `source` which is either an internal account, or has direct pull functionality (e.g. ACH pull with an external account).\nNot supported when the `source` is an internal account of type `EMBEDDED_WALLET`: those transfers require a `Grid-Wallet-Signature` over the `payloadToSign` returned in the quote response, which is not available in a combined create-and-execute call. Create the quote first with `immediatelyExecute: false` and then call `POST /quotes/{quoteId}/execute` with the `Grid-Wallet-Signature` stamp header.\n\n- `lookupId?: string`\n Lookup ID from a previous receiver lookup request. If provided, this can make the quote creation more efficient by reusing cached lookup data.\nNOTE: This is required for UMA destinations due to counterparty institution requirements. See `senderCustomerInfo` for more information.\n\n- `purposeOfPayment?: string`\n The purpose of the payment. This may be required when sending to certain geographies (e.g. India).\n\n- `remittanceInformation?: string`\n Free-form information about the payment that travels with it to the recipient. The field this populates depends on the payment rail: for ACH it populates the Addenda record, for FedNow and RTP it populates the remittanceInformation field, and for wires it populates the OBI (Originator to Beneficiary Information) / beneficiary information.\n\n- `senderCustomerInfo?: object`\n Key-value pairs of additional information about the sender which was requested by the destination. This is relevant when the destination requires more sender info than was provided during customer creation.\nAny fields specified in `requiredPayerDataFields` from the response of the `/receiver/uma/{receiverUmaAddress}` (lookupUma) or `/receiver/external-account/{accountId}` (lookupExternalAccount) endpoints MUST be provided here if they were requested. If the destination did not request any additional information, this field can be omitted.\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `remittanceInformation?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.agents.me.quotes.create({\n destination: {},\n lockedCurrencyAmount: 1000,\n lockedCurrencySide: 'SENDING',\n source: {},\n});\n\nconsole.log(quote);\n```", perLanguage: { typescript: { method: 'client.agents.me.quotes.create', @@ -5464,12 +5032,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'agents().me().quotes().create', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.agents.me.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\n val quote: Quote = client.agents().me().quotes().create(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: QuoteRequest = QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\n val quote: Quote = client.agents().me().quotes().create(params)\n}', }, go: { method: 'client.Agents.Me.Quotes.New', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithAgentAccessToken("My Agent Access Token"),\n\t)\n\tquote, err := client.Agents.Me.Quotes.New(context.TODO(), grid.AgentMeQuoteNewParams{\n\t\tDestination: map[string]any{},\n\t\tLockedCurrencyAmount: 1000,\n\t\tLockedCurrencySide: grid.AgentMeQuoteNewParamsLockedCurrencySideSending,\n\t\tSource: map[string]any{},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quote.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithAgentAccessToken("My Agent Access Token"),\n\t)\n\tquote, err := client.Agents.Me.Quotes.New(context.TODO(), grid.AgentMeQuoteNewParams{\n\t\tQuoteRequest: grid.QuoteRequestParam{\n\t\t\tDestination: map[string]any{},\n\t\t\tLockedCurrencyAmount: 1000,\n\t\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\t\tSource: map[string]any{},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quote.ID)\n}\n', }, ruby: { method: 'agents.me.quotes.create', @@ -5484,16 +5052,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'agents->me->quotes->create', example: - "agents->me->quotes->create(\n destination: (object) [],\n lockedCurrencyAmount: 1000,\n lockedCurrencySide: 'SENDING',\n source: (object) [],\n description: 'Invoice #1234 payment',\n immediatelyExecute: false,\n lookupID: 'Lookup:019542f5-b3e7-1d02-0000-000000000009',\n purposeOfPayment: 'GIFT',\n senderCustomerInfo: ['FULL_NAME' => 'bar', 'NATIONALITY' => 'bar'],\n idempotencyKey: '',\n);\n\nvar_dump($quote);", - }, - csharp: { - method: 'Agents.Me.Quotes.Create', - example: - 'QuoteCreateParams parameters = new()\n{\n Destination = JsonSerializer.Deserialize("{}"),\n LockedCurrencyAmount = 1000,\n LockedCurrencySide = LockedCurrencySide.Sending,\n Source = JsonSerializer.Deserialize("{}"),\n};\n\nvar quote = await client.Agents.Me.Quotes.Create(parameters);\n\nConsole.WriteLine(quote);', + "agents->me->quotes->create(\n destination: (object) [],\n lockedCurrencyAmount: 1000,\n lockedCurrencySide: 'SENDING',\n source: (object) [],\n description: 'Invoice #1234 payment',\n immediatelyExecute: false,\n lookupID: 'Lookup:019542f5-b3e7-1d02-0000-000000000009',\n purposeOfPayment: 'GIFT',\n remittanceInformation: '12345',\n senderCustomerInfo: ['FULL_NAME' => 'bar', 'NATIONALITY' => 'bar'],\n idempotencyKey: '',\n);\n\nvar_dump($quote);", }, http: { example: - 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/quotes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN" \\\n -d \'{\n "destination": {},\n "lockedCurrencyAmount": 1000,\n "lockedCurrencySide": "SENDING",\n "source": {},\n "description": "Invoice #1234 payment",\n "immediatelyExecute": false,\n "lookupId": "Lookup:019542f5-b3e7-1d02-0000-000000000009",\n "senderCustomerInfo": {\n "FULL_NAME": "bar",\n "NATIONALITY": "bar"\n }\n }\'', + 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/quotes \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN" \\\n -d \'{\n "destination": {},\n "lockedCurrencyAmount": 1000,\n "lockedCurrencySide": "SENDING",\n "source": {},\n "description": "Invoice #1234 payment",\n "immediatelyExecute": false,\n "lookupId": "Lookup:019542f5-b3e7-1d02-0000-000000000009",\n "remittanceInformation": "12345",\n "senderCustomerInfo": {\n "FULL_NAME": "bar",\n "NATIONALITY": "bar"\n }\n }\'', }, }, }, @@ -5508,9 +5071,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.me.quotes.retrieve', params: ['quoteId: string;'], response: - "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }", + "{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }", markdown: - "## retrieve\n\n`client.agents.me.quotes.retrieve(quoteId: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }`\n\n**get** `/agents/me/quotes/{quoteId}`\n\nRetrieve a quote created by the authenticated agent. Returns 404 if the quote exists but was not created by this agent.\n\n\n### Parameters\n\n- `quoteId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.agents.me.quotes.retrieve('quoteId');\n\nconsole.log(quote);\n```", + "## retrieve\n\n`client.agents.me.quotes.retrieve(quoteId: string): { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }`\n\n**get** `/agents/me/quotes/{quoteId}`\n\nRetrieve a quote created by the authenticated agent. Returns 404 if the quote exists but was not created by this agent.\n\n\n### Parameters\n\n- `quoteId: string`\n\n### Returns\n\n- `{ id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n\n - `id: string`\n - `createdAt: string`\n - `destination: object`\n - `exchangeRate: number`\n - `expiresAt: string`\n - `feesIncluded: number`\n - `receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }`\n - `source: object`\n - `status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'`\n - `totalReceivingAmount: number`\n - `totalSendingAmount: number`\n - `transactionId: string`\n - `counterpartyInformation?: object`\n - `paymentInstructions?: { accountOrWalletInfo: { accountNumber: string; accountType: 'ARS_ACCOUNT'; } | { accountType: 'SLV_ACCOUNT'; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; country: string; paymentRails: 'SWIFT'[]; reference: string; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; reference: string; accountNumber?: string; phoneNumber?: string; } | { accountType: 'EMBEDDED_WALLET'; payloadToSign: string; }; instructionsNotes?: string; isPlatformAccount?: boolean; }[]`\n - `rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }`\n - `remittanceInformation?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst quote = await client.agents.me.quotes.retrieve('quoteId');\n\nconsole.log(quote);\n```", perLanguage: { typescript: { method: 'client.agents.me.quotes.retrieve', @@ -5547,11 +5110,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->quotes->retrieve('quoteId');\n\nvar_dump($quote);", }, - csharp: { - method: 'Agents.Me.Quotes.Retrieve', - example: - 'QuoteRetrieveParams parameters = new() { QuoteID = "quoteId" };\n\nvar quote = await client.Agents.Me.Quotes.Retrieve(parameters);\n\nConsole.WriteLine(quote);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/quotes/$QUOTE_ID \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5569,9 +5127,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.me.quotes.execute', params: ['quoteId: string;', 'Grid-Wallet-Signature?: string;', 'Idempotency-Key?: string;'], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## execute\n\n`client.agents.me.quotes.execute(quoteId: string, Grid-Wallet-Signature?: string, Idempotency-Key?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/me/quotes/{quoteId}/execute`\n\nExecute a quote created by the authenticated agent. Requires the EXECUTE_QUOTES permission in the agent's policy.\nIf the agent's policy requires approval for this amount (based on execution mode or approval thresholds), the transaction will be created in a pending state and must be approved by the platform via `POST /agents/{agentId}/actions/{actionId}/approve`.\nOnce executed, the quote cannot be cancelled.\n\n\n### Parameters\n\n- `quoteId: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.quotes.execute('Quote:019542f5-b3e7-1d02-0000-000000000001');\n\nconsole.log(agentAction);\n```", + "## execute\n\n`client.agents.me.quotes.execute(quoteId: string, Grid-Wallet-Signature?: string, Idempotency-Key?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/me/quotes/{quoteId}/execute`\n\nExecute a quote created by the authenticated agent. Requires the EXECUTE_QUOTES permission in the agent's policy.\nIf the agent's policy requires approval for this amount (based on execution mode or approval thresholds), the transaction will be created in a pending state and must be approved by the platform via `POST /agents/{agentId}/actions/{actionId}/approve`.\nOnce executed, the quote cannot be cancelled.\n\n\n### Parameters\n\n- `quoteId: string`\n\n- `Grid-Wallet-Signature?: string`\n\n- `Idempotency-Key?: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.quotes.execute('Quote:019542f5-b3e7-1d02-0000-000000000001');\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.me.quotes.execute', @@ -5608,11 +5166,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->quotes->execute(\n 'Quote:019542f5-b3e7-1d02-0000-000000000001',\n gridWalletSignature: 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9',\n idempotencyKey: '',\n);\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Me.Quotes.Execute', - example: - 'QuoteExecuteParams parameters = new()\n{\n QuoteID = "Quote:019542f5-b3e7-1d02-0000-000000000001"\n};\n\nvar agentAction = await client.Agents.Me.Quotes.Execute(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/quotes/$QUOTE_ID/execute \\\n -X POST \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5630,9 +5183,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.me.externalAccounts.list', params: ['currency?: string;', 'cursor?: string;', 'limit?: number;'], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## list\n\n`client.agents.me.externalAccounts.list(currency?: string, cursor?: string, limit?: number): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/agents/me/external-accounts`\n\nRetrieve a paginated list of external accounts belonging to the authenticated agent's customer. Requires the MANAGE_EXTERNAL_ACCOUNTS permission in the agent's policy.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const externalAccount of client.agents.me.externalAccounts.list()) {\n console.log(externalAccount);\n}\n```", + "## list\n\n`client.agents.me.externalAccounts.list(currency?: string, cursor?: string, limit?: number): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/agents/me/external-accounts`\n\nRetrieve a paginated list of external accounts belonging to the authenticated agent's customer. Requires the MANAGE_EXTERNAL_ACCOUNTS permission in the agent's policy.\n\n\n### Parameters\n\n- `currency?: string`\n Filter by currency code\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const externalAccount of client.agents.me.externalAccounts.list()) {\n console.log(externalAccount);\n}\n```", perLanguage: { typescript: { method: 'client.agents.me.externalAccounts.list', @@ -5668,11 +5221,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->externalAccounts->list(\n currency: 'currency', cursor: 'cursor', limit: 1\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Agents.Me.ExternalAccounts.List', - example: - 'ExternalAccountListParams parameters = new();\n\nvar page = await client.Agents.Me.ExternalAccounts.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/external-accounts \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5689,16 +5237,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) agents.me.external_accounts > (method) add', qualified: 'client.agents.me.externalAccounts.add', params: [ - "accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; };", + "accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: object; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; address?: address; birthDate?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; };", 'currency: string;', 'customerId?: string;', 'defaultUmaDepositAccount?: boolean;', 'platformAccountId?: string;', ], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## add\n\n`client.agents.me.externalAccounts.add(accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: aed_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: bdt_beneficiary | business_beneficiary; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: brl_beneficiary | business_beneficiary; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: bwp_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: cad_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: cop_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: dkk_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: egp_beneficiary | business_beneficiary; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: eur_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: gbp_beneficiary | business_beneficiary; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: ghs_beneficiary | business_beneficiary; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: gtq_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: hkd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: htg_beneficiary | business_beneficiary; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: idr_beneficiary | business_beneficiary; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: inr_beneficiary | business_beneficiary; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: jmd_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: kes_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: mwk_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: mxn_beneficiary | business_beneficiary; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: myr_beneficiary | business_beneficiary; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: ngn_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: php_beneficiary | business_beneficiary; } | { accountType: 'PKR_ACCOUNT'; beneficiary: pkr_beneficiary | business_beneficiary; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: rwf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: sgd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: thb_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: tzs_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: ugx_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: usd_beneficiary | business_beneficiary; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: vnd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: xaf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: xof_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: zar_beneficiary | business_beneficiary; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: zmw_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; swiftCode: string; accountNumber?: string; iban?: string; }, currency: string, customerId?: string, defaultUmaDepositAccount?: boolean, platformAccountId?: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**post** `/agents/me/external-accounts`\n\nRegister a new external bank account or wallet for the authenticated agent's customer. Requires the MANAGE_EXTERNAL_ACCOUNTS permission in the agent's policy. The `customerId` field is optional and will be inferred from the agent's associated customer if omitted.\n\n\n### Parameters\n\n- `accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'COP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; swiftCode?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; vpa: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; }`\n Required fields depend on the selected paymentRails:\n- BANK_TRANSFER: accountNumber\n- MOBILE_MONEY: phoneNumber\n\n- `currency: string`\n The ISO 4217 currency code\n\n- `customerId?: string`\n The ID of the customer for whom to create the external account. If not provided, the external account will be created on behalf of the platform.\n\n- `defaultUmaDepositAccount?: boolean`\n Whether to set the external account as the default UMA deposit account. When set to true, incoming payments to this customer's UMA address will be automatically deposited into this external account. False if not provided. Note that only one external account can be set as the default UMA deposit account for a customer, so if there is already a default UMA deposit account, this will override the existing default UMA deposit account. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer.\n\n- `platformAccountId?: string`\n Your platform's identifier for the account in your system. This can be used to reference the account by your own identifier.\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.agents.me.externalAccounts.add({\n accountInfo: {\n accountType: 'AED_ACCOUNT',\n beneficiary: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n beneficiaryType: 'INDIVIDUAL',\n fullName: 'fullName',\n},\n iban: 'AE070331234567890123456',\n},\n currency: 'USD',\n});\n\nconsole.log(externalAccount);\n```", + "## add\n\n`client.agents.me.externalAccounts.add(accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: aed_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: bdt_beneficiary | business_beneficiary; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: brl_beneficiary | business_beneficiary; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: bwp_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: cad_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | object; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: cop_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: dkk_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: egp_beneficiary | business_beneficiary; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: eur_beneficiary | business_beneficiary; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: gbp_beneficiary | business_beneficiary; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: ghs_beneficiary | business_beneficiary; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: gtq_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: hkd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: htg_beneficiary | business_beneficiary; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: idr_beneficiary | business_beneficiary; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: inr_beneficiary | business_beneficiary; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: jmd_beneficiary | business_beneficiary; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: kes_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: mwk_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: mxn_beneficiary | business_beneficiary; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: myr_beneficiary | business_beneficiary; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: ngn_beneficiary | business_beneficiary; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: php_beneficiary | business_beneficiary; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: pkr_beneficiary | business_beneficiary; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: rwf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: sgd_beneficiary | business_beneficiary; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: thb_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: tzs_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: ugx_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: usd_beneficiary | business_beneficiary; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: vnd_beneficiary | business_beneficiary; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: xaf_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: xof_beneficiary | business_beneficiary; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: zar_beneficiary | business_beneficiary; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: zmw_beneficiary | business_beneficiary; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; swiftCode: string; accountNumber?: string; iban?: string; }, currency: string, customerId?: string, defaultUmaDepositAccount?: boolean, platformAccountId?: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**post** `/agents/me/external-accounts`\n\nRegister a new external bank account or wallet for the authenticated agent's customer. Requires the MANAGE_EXTERNAL_ACCOUNTS permission in the agent's policy. The `customerId` field is optional and will be inferred from the agent's associated customer if omitted.\n\n\n### Parameters\n\n- `accountInfo: { accountType: 'AED_ACCOUNT'; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'BDT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; branchCode?: string; phoneNumber?: string; swiftCode?: string; } | { accountType: 'BRL_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; pixKey: string; pixKeyType: 'CPF' | 'CNPJ' | 'EMAIL' | 'PHONE' | 'RANDOM'; taxId: string; } | { accountType: 'BWP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'CAD_ACCOUNT'; bankCode: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; registrationNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: { country: string; line1: string; postalCode: string; city?: string; line2?: string; state?: string; }; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: object; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountType: 'COP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; documentNumber?: string; documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; phoneNumber?: string; } | { accountType: 'DKK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountType: 'EGP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban?: string; phoneNumber?: string; } | { accountType: 'EUR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; address?: address; birthDate?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; iban: string; swiftCode?: string; } | { accountNumber: string; accountType: 'GBP_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; sortCode: string; } | { accountType: 'GHS_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'GTQ_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; countryOfResidence: string; fullName: string; phoneNumber: string; address?: address; birthDate?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'HKD_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'HTG_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; } | { accountNumber: string; accountType: 'IDR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; swiftCode: string; } | { accountType: 'INR_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankName?: string; ifsc?: string; rail?: string; vpa?: string; } | { accountNumber: string; accountType: 'JMD_ACCOUNT'; bankAccountType: 'CHECKING' | 'SAVINGS'; bankName: string; beneficiary: { address: address; beneficiaryType: 'INDIVIDUAL'; fullName: string; phoneNumber: string; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; branchCode: string; } | { accountType: 'KES_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MWK_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'MXN_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; clabeNumber: string; } | { accountNumber: string; accountType: 'MYR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountNumber: string; accountType: 'NGN_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountNumber: string; accountType: 'PHP_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'PKR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; iban?: string; phoneNumber?: string; } | { accountType: 'RWF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'SGD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; bankName?: string; } | { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountNumber: string; accountType: 'THB_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'TZS_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'UGX_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountNumber: string; accountType: 'USD_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; routingNumber: string; } | { accountNumber: string; accountType: 'VND_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; swiftCode: string; } | { accountType: 'XAF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'CM' | 'CG'; } | { accountType: 'XOF_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; region: 'BJ' | 'CI' | 'SN' | 'TG'; } | { accountNumber: string; accountType: 'ZAR_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; } | { accountType: 'ZMW_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; phoneNumber: string; provider: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; swiftCode: string; accountNumber?: string; iban?: string; }`\n Required fields depend on the selected paymentRails:\n- BANK_TRANSFER: accountNumber, bankName\n- MOBILE_MONEY: bankName, phoneNumber\n\n- `currency: string`\n The ISO 4217 currency code\n\n- `customerId?: string`\n The ID of the customer for whom to create the external account. If not provided, the external account will be created on behalf of the platform.\n\n- `defaultUmaDepositAccount?: boolean`\n Whether to set the external account as the default UMA deposit account. When set to true, incoming payments to this customer's UMA address will be automatically deposited into this external account. False if not provided. Note that only one external account can be set as the default UMA deposit account for a customer, so if there is already a default UMA deposit account, this will override the existing default UMA deposit account. If there is no default UMA deposit account, incoming UMA payments will be deposited into the primary internal account for the customer.\n\n- `platformAccountId?: string`\n Your platform's identifier for the account in your system. This can be used to reference the account by your own identifier.\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.agents.me.externalAccounts.add({\n accountInfo: {\n accountType: 'AED_ACCOUNT',\n beneficiary: {\n address: {\n country: 'US',\n line1: '123 Main Street',\n postalCode: '94105',\n},\n beneficiaryType: 'INDIVIDUAL',\n fullName: 'fullName',\n},\n iban: 'AE070331234567890123456',\n},\n currency: 'USD',\n});\n\nconsole.log(externalAccount);\n```", perLanguage: { typescript: { method: 'client.agents.me.externalAccounts.add', @@ -5735,11 +5283,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->externalAccounts->add(\n accountInfo: [\n 'accountType' => 'AED_ACCOUNT',\n 'beneficiary' => [\n 'address' => [\n 'country' => 'US',\n 'line1' => '123 Main Street',\n 'postalCode' => '94105',\n 'city' => 'San Francisco',\n 'line2' => 'Apt 4B',\n 'state' => 'CA',\n ],\n 'beneficiaryType' => 'INDIVIDUAL',\n 'fullName' => 'fullName',\n 'birthDate' => 'birthDate',\n 'countryOfResidence' => 'countryOfResidence',\n 'email' => 'email',\n 'nationality' => 'nationality',\n 'phoneNumber' => 'phoneNumber',\n ],\n 'iban' => 'AE070331234567890123456',\n 'swiftCode' => 'EBILAEAD',\n ],\n currency: 'USD',\n customerID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n defaultUmaDepositAccount: true,\n platformAccountID: 'ext_acc_123456',\n);\n\nvar_dump($externalAccount);", }, - csharp: { - method: 'Agents.Me.ExternalAccounts.Add', - example: - 'ExternalAccountAddParams parameters = new()\n{\n AccountInfo = new AedExternalAccountCreateInfo()\n {\n AccountType = AccountType.AedAccount,\n Beneficiary = new AedBeneficiary()\n {\n Address = new()\n {\n Country = "US",\n Line1 = "123 Main Street",\n PostalCode = "94105",\n City = "San Francisco",\n Line2 = "Apt 4B",\n State = "CA",\n },\n BeneficiaryType = BeneficiaryType.Individual,\n FullName = "fullName",\n BirthDate = "birthDate",\n CountryOfResidence = "countryOfResidence",\n Email = "email",\n Nationality = "nationality",\n PhoneNumber = "phoneNumber",\n },\n Iban = "AE070331234567890123456",\n SwiftCode = "EBILAEAD",\n },\n Currency = "USD",\n};\n\nvar externalAccount = await client.Agents.Me.ExternalAccounts.Add(parameters);\n\nConsole.WriteLine(externalAccount);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/external-accounts \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN" \\\n -d \'{\n "accountInfo": {\n "accountType": "AED_ACCOUNT",\n "beneficiary": {\n "address": {\n "country": "US",\n "line1": "123 Main Street",\n "postalCode": "94105"\n },\n "beneficiaryType": "INDIVIDUAL",\n "fullName": "fullName"\n },\n "iban": "AE070331234567890123456",\n "swiftCode": "EBILAEAD"\n },\n "currency": "USD",\n "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",\n "platformAccountId": "ext_acc_123456"\n }\'', @@ -5757,9 +5300,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.me.externalAccounts.retrieve', params: ['externalAccountId: string;'], response: - "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", + "{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }", markdown: - "## retrieve\n\n`client.agents.me.externalAccounts.retrieve(externalAccountId: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/agents/me/external-accounts/{externalAccountId}`\n\nRetrieve an external account belonging to the authenticated agent's customer. Returns 404 if the account exists but belongs to a different customer. Requires the MANAGE_EXTERNAL_ACCOUNTS permission in the agent's policy.\n\n\n### Parameters\n\n- `externalAccountId: string`\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.agents.me.externalAccounts.retrieve('externalAccountId');\n\nconsole.log(externalAccount);\n```", + "## retrieve\n\n`client.agents.me.externalAccounts.retrieve(externalAccountId: string): { id: string; accountInfo: external_account_info_one_of; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: beneficiary_verified_data; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n**get** `/agents/me/external-accounts/{externalAccountId}`\n\nRetrieve an external account belonging to the authenticated agent's customer. Returns 404 if the account exists but belongs to a different customer. Requires the MANAGE_EXTERNAL_ACCOUNTS permission in the agent's policy.\n\n\n### Parameters\n\n- `externalAccountId: string`\n\n### Returns\n\n- `{ id: string; accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: slv_beneficiary | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: swift_beneficiary | business_beneficiary; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: object | business_beneficiary; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }; currency: string; status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'; beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'; beneficiaryVerifiedData?: { fullName?: string; }; customerId?: string; defaultUmaDepositAccount?: boolean; platformAccountId?: string; }`\n\n - `id: string`\n - `accountInfo: { accountType: 'SLV_ACCOUNT'; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; bankAccountType?: 'CHECKING' | 'SAVINGS'; bankName?: string; phoneNumber?: string; } | { accountType: 'SWIFT_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: address; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; country: string; paymentRails: 'SWIFT'[]; swiftCode: string; accountNumber?: string; iban?: string; } | { accountType: 'CNY_ACCOUNT'; bankName: string; beneficiary: { beneficiaryType: 'INDIVIDUAL'; fullName: string; address?: object; birthDate?: string; countryOfResidence?: string; email?: string; nationality?: string; phoneNumber?: string; } | { beneficiaryType: 'BUSINESS'; legalName: string; address?: address; countryOfResidence?: string; email?: string; phoneNumber?: string; registrationNumber?: string; taxId?: string; }; paymentRails: 'BANK_TRANSFER' | 'MOBILE_MONEY'[]; accountNumber?: string; phoneNumber?: string; }`\n - `currency: string`\n - `status: 'PENDING' | 'ACTIVE' | 'UNDER_REVIEW' | 'INACTIVE'`\n - `beneficiaryVerificationStatus?: 'MATCHED' | 'PARTIAL_MATCH' | 'NOT_MATCHED' | 'UNSUPPORTED' | 'CHECKED_BY_RECEIVING_FI' | 'PENDING'`\n - `beneficiaryVerifiedData?: { fullName?: string; }`\n - `customerId?: string`\n - `defaultUmaDepositAccount?: boolean`\n - `platformAccountId?: string`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst externalAccount = await client.agents.me.externalAccounts.retrieve('externalAccountId');\n\nconsole.log(externalAccount);\n```", perLanguage: { typescript: { method: 'client.agents.me.externalAccounts.retrieve', @@ -5796,11 +5339,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->externalAccounts->retrieve(\n 'externalAccountId'\n);\n\nvar_dump($externalAccount);", }, - csharp: { - method: 'Agents.Me.ExternalAccounts.Retrieve', - example: - 'ExternalAccountRetrieveParams parameters = new()\n{\n ExternalAccountID = "externalAccountId"\n};\n\nvar externalAccount = await client.Agents.Me.ExternalAccounts.Retrieve(parameters);\n\nConsole.WriteLine(externalAccount);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/external-accounts/$EXTERNAL_ACCOUNT_ID \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5855,11 +5393,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->externalAccounts->delete('externalAccountId');\n\nvar_dump($result);", }, - csharp: { - method: 'Agents.Me.ExternalAccounts.Delete', - example: - 'ExternalAccountDeleteParams parameters = new()\n{\n ExternalAccountID = "externalAccountId"\n};\n\nawait client.Agents.Me.ExternalAccounts.Delete(parameters);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/external-accounts/$EXTERNAL_ACCOUNT_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5881,9 +5414,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "status?: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED';", ], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## list\n\n`client.agents.me.actions.list(cursor?: string, limit?: number, status?: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**get** `/agents/me/actions`\n\nRetrieve a paginated list of actions submitted by the authenticated agent. Use this to poll for approval decisions after submitting an action that requires approval.\n\n\n### Parameters\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `status?: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n Filter by action status\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const agentAction of client.agents.me.actions.list()) {\n console.log(agentAction);\n}\n```", + "## list\n\n`client.agents.me.actions.list(cursor?: string, limit?: number, status?: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**get** `/agents/me/actions`\n\nRetrieve a paginated list of actions submitted by the authenticated agent. Use this to poll for approval decisions after submitting an action that requires approval.\n\n\n### Parameters\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `status?: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n Filter by action status\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const agentAction of client.agents.me.actions.list()) {\n console.log(agentAction);\n}\n```", perLanguage: { typescript: { method: 'client.agents.me.actions.list', @@ -5919,11 +5452,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->actions->list(\n cursor: 'cursor', limit: 1, status: 'PENDING_APPROVAL'\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Agents.Me.Actions.List', - example: - 'ActionListParams parameters = new();\n\nvar page = await client.Agents.Me.Actions.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/actions \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -5941,9 +5469,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.me.actions.retrieve', params: ['actionId: string;'], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## retrieve\n\n`client.agents.me.actions.retrieve(actionId: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**get** `/agents/me/actions/{actionId}`\n\nRetrieve a specific action submitted by the authenticated agent. Poll this endpoint after submitting an action that requires approval to check whether it has been approved, rejected, or has failed.\n\n\n### Parameters\n\n- `actionId: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.actions.retrieve('actionId');\n\nconsole.log(agentAction);\n```", + "## retrieve\n\n`client.agents.me.actions.retrieve(actionId: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**get** `/agents/me/actions/{actionId}`\n\nRetrieve a specific action submitted by the authenticated agent. Poll this endpoint after submitting an action that requires approval to check whether it has been approved, rejected, or has failed.\n\n\n### Parameters\n\n- `actionId: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.me.actions.retrieve('actionId');\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.me.actions.retrieve', @@ -5980,11 +5508,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->me->actions->retrieve('actionId');\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Me.Actions.Retrieve', - example: - 'ActionRetrieveParams parameters = new() { ActionID = "actionId" };\n\nvar agentAction = await client.Agents.Me.Actions.Retrieve(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/me/actions/$ACTION_ID \\\n -H "Authorization: Bearer $GRID_AGENT_ACCESS_TOKEN"', @@ -6040,11 +5563,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->deviceCodes->regenerate('agentId');\n\nvar_dump($agentDeviceCode);", }, - csharp: { - method: 'Agents.DeviceCodes.Regenerate', - example: - 'DeviceCodeRegenerateParams parameters = new() { AgentID = "agentId" };\n\nvar agentDeviceCode = await client.Agents.DeviceCodes.Regenerate(parameters);\n\nConsole.WriteLine(agentDeviceCode);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID/device-codes \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6100,11 +5618,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->deviceCodes->getStatus(\n 'code'\n);\n\nvar_dump($agentDeviceCodeStatusResponse);", }, - csharp: { - method: 'Agents.DeviceCodes.GetStatus', - example: - 'DeviceCodeGetStatusParams parameters = new() { Code = "code" };\n\nvar agentDeviceCodeStatusResponse = await client.Agents.DeviceCodes.GetStatus(parameters);\n\nConsole.WriteLine(agentDeviceCodeStatusResponse);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/device-codes/$CODE/status \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6161,11 +5674,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->deviceCodes->redeem('code');\n\nvar_dump($agentDeviceCodeRedeemResponse);", }, - csharp: { - method: 'Agents.DeviceCodes.Redeem', - example: - 'DeviceCodeRedeemParams parameters = new() { Code = "code" };\n\nvar agentDeviceCodeRedeemResponse = await client.Agents.DeviceCodes.Redeem(parameters);\n\nConsole.WriteLine(agentDeviceCodeRedeemResponse);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/device-codes/$CODE/redeem \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6183,9 +5691,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.transactions.approve', params: ['agentId: string;', 'actionId: string;'], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## approve\n\n`client.agents.transactions.approve(agentId: string, actionId: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/approve`\n\nApprove a pending agent action, allowing Grid to proceed with execution. The action must have status `PENDING_APPROVAL`. Once approved, Grid executes the underlying operation (quote execution or transfer) and the action transitions to `APPROVED`.\nFor `EXECUTE_QUOTE` actions, note that the underlying quote may have expired between submission and approval — in that case the action will transition to `FAILED` instead.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.transactions.approve('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", + "## approve\n\n`client.agents.transactions.approve(agentId: string, actionId: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/approve`\n\nApprove a pending agent action, allowing Grid to proceed with execution. The action must have status `PENDING_APPROVAL`. Once approved, Grid executes the underlying operation (quote execution or transfer) and the action transitions to `APPROVED`.\nFor `EXECUTE_QUOTE` actions, note that the underlying quote may have expired between submission and approval — in that case the action will transition to `FAILED` instead.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.transactions.approve('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.transactions.approve', @@ -6222,11 +5730,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->transactions->approve(\n 'actionId', agentID: 'agentId'\n);\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Transactions.Approve', - example: - 'TransactionApproveParams parameters = new()\n{\n AgentID = "agentId",\n ActionID = "actionId",\n};\n\nvar agentAction = await client.Agents.Transactions.Approve(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID/actions/$ACTION_ID/approve \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6244,9 +5747,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.transactions.reject', params: ['agentId: string;', 'actionId: string;', 'reason?: string;'], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## reject\n\n`client.agents.transactions.reject(agentId: string, actionId: string, reason?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/reject`\n\nReject a pending agent action, preventing execution. The action must have status `PENDING_APPROVAL`. Once rejected, the action transitions to `REJECTED` and the underlying operation is not executed.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n- `reason?: string`\n Optional human-readable reason for the rejection, stored on the action and visible to the platform.\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.transactions.reject('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", + "## reject\n\n`client.agents.transactions.reject(agentId: string, actionId: string, reason?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/reject`\n\nReject a pending agent action, preventing execution. The action must have status `PENDING_APPROVAL`. Once rejected, the action transitions to `REJECTED` and the underlying operation is not executed.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n- `reason?: string`\n Optional human-readable reason for the rejection, stored on the action and visible to the platform.\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.transactions.reject('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.transactions.reject', @@ -6283,11 +5786,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->transactions->reject(\n 'actionId',\n agentID: 'agentId',\n reason: 'Transaction amount exceeds customer\\'s current risk limit.',\n);\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Transactions.Reject', - example: - 'TransactionRejectParams parameters = new()\n{\n AgentID = "agentId",\n ActionID = "actionId",\n};\n\nvar agentAction = await client.Agents.Transactions.Reject(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID/actions/$ACTION_ID/reject \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6305,9 +5803,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.actions.approve', params: ['agentId: string;', 'actionId: string;'], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## approve\n\n`client.agents.actions.approve(agentId: string, actionId: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/approve`\n\nApprove a pending agent action, allowing Grid to proceed with execution. The action must have status `PENDING_APPROVAL`. Once approved, Grid executes the underlying operation (quote execution or transfer) and the action transitions to `APPROVED`.\nFor `EXECUTE_QUOTE` actions, note that the underlying quote may have expired between submission and approval — in that case the action will transition to `FAILED` instead.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.actions.approve('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", + "## approve\n\n`client.agents.actions.approve(agentId: string, actionId: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/approve`\n\nApprove a pending agent action, allowing Grid to proceed with execution. The action must have status `PENDING_APPROVAL`. Once approved, Grid executes the underlying operation (quote execution or transfer) and the action transitions to `APPROVED`.\nFor `EXECUTE_QUOTE` actions, note that the underlying quote may have expired between submission and approval — in that case the action will transition to `FAILED` instead.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.actions.approve('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.actions.approve', @@ -6344,11 +5842,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->actions->approve(\n 'actionId', agentID: 'agentId'\n);\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Actions.Approve', - example: - 'ActionApproveParams parameters = new()\n{\n AgentID = "agentId",\n ActionID = "actionId",\n};\n\nvar agentAction = await client.Agents.Actions.Approve(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID/actions/$ACTION_ID/approve \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6366,9 +5859,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.agents.actions.reject', params: ['agentId: string;', 'actionId: string;', 'reason?: string;'], response: - "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", + "{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }", markdown: - "## reject\n\n`client.agents.actions.reject(agentId: string, actionId: string, reason?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/reject`\n\nReject a pending agent action, preventing execution. The action must have status `PENDING_APPROVAL`. Once rejected, the action transitions to `REJECTED` and the underlying operation is not executed.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n- `reason?: string`\n Optional human-readable reason for the rejection, stored on the action and visible to the platform.\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; }; rejectionReason?: string; transaction?: object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; failureReason?: string; fees?: number; paymentInstructions?: object[]; quoteId?: string; rateDetails?: object; receivedAmount?: object; reconciliationInstructions?: object; refund?: { initiatedAt: string; reference: string; status: 'PENDING' | 'COMPLETED' | 'FAILED'; reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; settledAt?: string; }; settledAt?: string; updatedAt?: string; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.actions.reject('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", + "## reject\n\n`client.agents.actions.reject(agentId: string, actionId: string, reason?: string): { id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: quote; rejectionReason?: string; transaction?: transaction; transferDetails?: agent_transfer_details; }`\n\n**post** `/agents/{agentId}/actions/{actionId}/reject`\n\nReject a pending agent action, preventing execution. The action must have status `PENDING_APPROVAL`. Once rejected, the action transitions to `REJECTED` and the underlying operation is not executed.\nThis endpoint is called by the platform's backend using platform credentials, not by the agent itself.\n\n\n### Parameters\n\n- `agentId: string`\n\n- `actionId: string`\n\n- `reason?: string`\n Optional human-readable reason for the rejection, stored on the action and visible to the platform.\n\n### Returns\n\n- `{ id: string; agentId: string; createdAt: string; customerId: string; platformCustomerId: string; status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'; type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'; updatedAt: string; quote?: { id: string; createdAt: string; destination: quote_destination_one_of; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: currency; sendingCurrency: currency; source: quote_source_one_of; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: payment_instructions[]; rateDetails?: outgoing_rate_details; remittanceInformation?: string; }; rejectionReason?: string; transaction?: object | object | object; transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }; }`\n An action submitted by an agent that may require platform approval before execution. All agent-initiated operations (quote execution, transfers) are represented as AgentActions, giving the platform a consistent object to approve, reject, and audit regardless of the underlying operation type.\n\n - `id: string`\n - `agentId: string`\n - `createdAt: string`\n - `customerId: string`\n - `platformCustomerId: string`\n - `status: 'PENDING_APPROVAL' | 'APPROVED' | 'REJECTED' | 'FAILED'`\n - `type: 'EXECUTE_QUOTE' | 'TRANSFER_OUT' | 'TRANSFER_IN'`\n - `updatedAt: string`\n - `quote?: { id: string; createdAt: string; destination: object; exchangeRate: number; expiresAt: string; feesIncluded: number; receivingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; sendingCurrency: { code?: string; decimals?: number; name?: string; symbol?: string; }; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; totalReceivingAmount: number; totalSendingAmount: number; transactionId: string; counterpartyInformation?: object; paymentInstructions?: { accountOrWalletInfo: object | object | object | object | object; instructionsNotes?: string; isPlatformAccount?: boolean; }[]; rateDetails?: { counterpartyFixedFee: number; counterpartyMultiplier: number; gridApiFixedFee: number; gridApiMultiplier: number; gridApiVariableFeeAmount: number; gridApiVariableFeeRate: number; }; remittanceInformation?: string; }`\n - `rejectionReason?: string`\n - `transaction?: { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; receivedAmount: object; status: 'CREATED' | 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' | 'FAILED' | 'REFUNDED' | 'EXPIRED'; type: 'INCOMING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; failureReason?: string; fees?: number; rateDetails?: object; receiptDeliveryConfirmedAt?: string; reconciliationInstructions?: object; settledAt?: string; source?: object; updatedAt?: string; } | { id: string; customerId: string; destination: object; direction: 'CREDIT' | 'DEBIT'; platformCustomerId: string; sentAmount: object; source: object; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED'; type: 'OUTGOING'; agentId?: string; counterpartyInformation?: object; createdAt?: string; description?: string; exchangeRate?: number; expectedSettlementAt?: string; failureReason?: string; fees?: number; paymentInstructions?: object[]; paymentRail?: string; quoteId?: string; railSelectionMode?: 'AUTO' | 'MANUAL'; rateDetails?: object; receiptDeliveryConfirmedAt?: string; receivedAmount?: object; reconciliationInstructions?: object; refund?: object; settledAt?: string; settlementTimelineSeconds?: number; updatedAt?: string; } | { id: string; accountId: string; authorizedAmount: object; authorizedAt: string; createdAt: string; customerId: string; direction: 'CREDIT' | 'DEBIT'; merchant: object; platformCustomerId: string; status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; type: 'CARD'; updatedAt: string; cardId?: string; issuerTransactionToken?: string; lastEventAt?: string; pullSummary?: object; refundedAmount?: object; refundSummary?: object; settledAmount?: object; settlementSummary?: object; }`\n - `transferDetails?: { amount: number; currency: string; destinationAccountId: string; sourceAccountId: string; }`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst agentAction = await client.agents.actions.reject('actionId', { agentId: 'agentId' });\n\nconsole.log(agentAction);\n```", perLanguage: { typescript: { method: 'client.agents.actions.reject', @@ -6405,11 +5898,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "agents->actions->reject(\n 'actionId',\n agentID: 'agentId',\n reason: 'Transaction amount exceeds customer\\'s current risk limit.',\n);\n\nvar_dump($agentAction);", }, - csharp: { - method: 'Agents.Actions.Reject', - example: - 'ActionRejectParams parameters = new()\n{\n AgentID = "agentId",\n ActionID = "actionId",\n};\n\nvar agentAction = await client.Agents.Actions.Reject(parameters);\n\nConsole.WriteLine(agentAction);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/agents/$AGENT_ID/actions/$ACTION_ID/reject \\\n -X POST \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6422,7 +5910,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Issue a card', description: - 'Issue a new card for a cardholder. Every card must be bound to at least one funding source at create time. The cardholder must have KYC status `APPROVED` before a card can be issued; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`.\n\nNew cards start in `state: "PENDING_ISSUE"` while the card issuer provisions the card. The `card.state_change` webhook fires on the transition to `ACTIVE` (or to `CLOSED` with `stateReason: "ISSUER_REJECTED"` if provisioning fails).\n', + 'Issue a new card for a cardholder. Every card must be bound to at least one funding source at create time. The cardholder must have KYC status `APPROVED` before a card can be issued; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`.\n\nIf any funding source is an Embedded Wallet internal account, the cardholder must authorize Grid to sign Spark token transactions for that card funding source by completing the delegated-key creation flow with `POST /auth/delegated-keys`. Until an active delegated key exists for that funding source, Authorization Decisioning cannot use it to fund card transactions.\n\nNew cards start in `state: "PROCESSING"` while the card issuer provisions the card. The `card.state_change` webhook fires on each state transition, including the transition to `ACTIVE` (or to `CLOSED` with `stateReason: "ISSUER_REJECTED"` if provisioning fails).\n', stainlessPath: '(resource) cards > (method) issue', qualified: 'client.cards.issue', params: [ @@ -6432,34 +5920,34 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'platformCardId?: string;', ], response: - "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", + "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", markdown: - "## issue\n\n`client.cards.issue(cardholderId: string, form: 'VIRTUAL', fundingSources: string[], platformCardId?: string): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**post** `/cards`\n\nIssue a new card for a cardholder. Every card must be bound to at least one funding source at create time. The cardholder must have KYC status `APPROVED` before a card can be issued; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`.\n\nNew cards start in `state: \"PENDING_ISSUE\"` while the card issuer provisions the card. The `card.state_change` webhook fires on the transition to `ACTIVE` (or to `CLOSED` with `stateReason: \"ISSUER_REJECTED\"` if provisioning fails).\n\n\n### Parameters\n\n- `cardholderId: string`\n The id of the `Customer` to issue the card to. The customer must have KYC status `APPROVED`; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`.\n\n- `form: 'VIRTUAL'`\n Physical form factor of the card. Only `VIRTUAL` is supported in v1;\n`PHYSICAL` will be added in a later release.\n\n- `fundingSources: string[]`\n Internal account ids to bind as funding sources, in priority order. The first entry is tried first by Authorization Decisioning. Every card must be bound to at least one source, and every source must belong to the cardholder and be denominated in a card-eligible currency (USDB in v1); otherwise the request is rejected with `FUNDING_SOURCE_INELIGIBLE`.\n\n- `platformCardId?: string`\n Optional platform-specific card identifier. System-generated when omitted, mirroring `platformCustomerId` semantics.\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `panEmbedUrl?: string`\n - `platformCardId?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst response = await client.cards.issue({\n cardholderId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n form: 'VIRTUAL',\n fundingSources: ['InternalAccount:019542f5-b3e7-1d02-0000-000000000002'],\n});\n\nconsole.log(response);\n```", + "## issue\n\n`client.cards.issue(cardholderId: string, form: 'VIRTUAL', fundingSources: string[], platformCardId?: string): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**post** `/cards`\n\nIssue a new card for a cardholder. Every card must be bound to at least one funding source at create time. The cardholder must have KYC status `APPROVED` before a card can be issued; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`.\n\nIf any funding source is an Embedded Wallet internal account, the cardholder must authorize Grid to sign Spark token transactions for that card funding source by completing the delegated-key creation flow with `POST /auth/delegated-keys`. Until an active delegated key exists for that funding source, Authorization Decisioning cannot use it to fund card transactions.\n\nNew cards start in `state: \"PROCESSING\"` while the card issuer provisions the card. The `card.state_change` webhook fires on each state transition, including the transition to `ACTIVE` (or to `CLOSED` with `stateReason: \"ISSUER_REJECTED\"` if provisioning fails).\n\n\n### Parameters\n\n- `cardholderId: string`\n The id of the `Customer` to issue the card to. The customer must have KYC status `APPROVED`; otherwise the request is rejected with `CARDHOLDER_KYC_NOT_APPROVED`.\n\n- `form: 'VIRTUAL'`\n Physical form factor of the card. Only `VIRTUAL` is supported in v1;\n`PHYSICAL` will be added in a later release.\n\n- `fundingSources: string[]`\n Internal account ids to bind as funding sources, in priority order. The first entry is tried first by Authorization Decisioning. Every card must be bound to at least one source, and every source must belong to the cardholder and be denominated in a card-eligible currency (USDB in v1); otherwise the request is rejected with `FUNDING_SOURCE_INELIGIBLE`.\n\n- `platformCardId?: string`\n Optional platform-specific card identifier. System-generated when omitted, mirroring `platformCustomerId` semantics.\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `platformCardId?: string`\n - `processorRef?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst card = await client.cards.issue({\n cardholderId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n form: 'VIRTUAL',\n fundingSources: ['InternalAccount:019542f5-b3e7-1d02-0000-000000000002'],\n});\n\nconsole.log(card);\n```", perLanguage: { typescript: { method: 'client.cards.issue', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst response = await client.cards.issue({\n cardholderId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n form: 'VIRTUAL',\n fundingSources: ['InternalAccount:019542f5-b3e7-1d02-0000-000000000002'],\n platformCardId: 'card-emp-aary-001',\n});\n\nconsole.log(response.id);", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst card = await client.cards.issue({\n cardholderId: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n form: 'VIRTUAL',\n fundingSources: ['InternalAccount:019542f5-b3e7-1d02-0000-000000000002'],\n platformCardId: 'card-emp-aary-001',\n});\n\nconsole.log(card.id);", }, python: { method: 'cards.issue', example: - 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\nresponse = client.cards.issue(\n cardholder_id="Customer:019542f5-b3e7-1d02-0000-000000000001",\n form="VIRTUAL",\n funding_sources=["InternalAccount:019542f5-b3e7-1d02-0000-000000000002"],\n platform_card_id="card-emp-aary-001",\n)\nprint(response.id)', + 'import os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\ncard = client.cards.issue(\n cardholder_id="Customer:019542f5-b3e7-1d02-0000-000000000001",\n form="VIRTUAL",\n funding_sources=["InternalAccount:019542f5-b3e7-1d02-0000-000000000002"],\n platform_card_id="card-emp-aary-001",\n)\nprint(card.id)', }, kotlin: { method: 'cards().issue', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.CardIssueParams\nimport com.lightspark.grid.models.cards.CardIssueResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CardIssueParams = CardIssueParams.builder()\n .cardholderId("Customer:019542f5-b3e7-1d02-0000-000000000001")\n .form(CardIssueParams.Form.VIRTUAL)\n .addFundingSource("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n .build()\n val response: CardIssueResponse = client.cards().issue(params)\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.Card\nimport com.lightspark.grid.models.cards.CardCreateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CardCreateRequest = CardCreateRequest.builder()\n .cardholderId("Customer:019542f5-b3e7-1d02-0000-000000000001")\n .form(CardCreateRequest.Form.VIRTUAL)\n .addFundingSource("InternalAccount:019542f5-b3e7-1d02-0000-000000000002")\n .build()\n val card: Card = client.cards().issue(params)\n}', }, go: { method: 'client.Cards.Issue', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tresponse, err := client.Cards.Issue(context.TODO(), grid.CardIssueParams{\n\t\tCardholderID: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n\t\tForm: grid.CardIssueParamsFormVirtual,\n\t\tFundingSources: []string{"InternalAccount:019542f5-b3e7-1d02-0000-000000000002"},\n\t\tPlatformCardID: grid.String("card-emp-aary-001"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcard, err := client.Cards.Issue(context.TODO(), grid.CardIssueParams{\n\t\tCardCreateRequest: grid.CardCreateRequestParam{\n\t\t\tCardholderID: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n\t\t\tForm: grid.CardCreateRequestFormVirtual,\n\t\t\tFundingSources: []string{"InternalAccount:019542f5-b3e7-1d02-0000-000000000002"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card.ID)\n}\n', }, ruby: { method: 'cards.issue', example: - 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\nresponse = lightspark_grid.cards.issue(\n cardholder_id: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n form: :VIRTUAL,\n funding_sources: ["InternalAccount:019542f5-b3e7-1d02-0000-000000000002"]\n)\n\nputs(response)', + 'require "grid"\n\nlightspark_grid = Grid::Client.new(username: "My Username", password: "My Password")\n\ncard = lightspark_grid.cards.issue(\n cardholder_id: "Customer:019542f5-b3e7-1d02-0000-000000000001",\n form: :VIRTUAL,\n funding_sources: ["InternalAccount:019542f5-b3e7-1d02-0000-000000000002"]\n)\n\nputs(card)', }, cli: { method: 'cards issue', @@ -6469,12 +5957,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ php: { method: 'cards->issue', example: - "cards->issue(\n cardholderID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n form: 'VIRTUAL',\n fundingSources: ['InternalAccount:019542f5-b3e7-1d02-0000-000000000002'],\n platformCardID: 'card-emp-aary-001',\n);\n\nvar_dump($response);", - }, - csharp: { - method: 'Cards.Issue', - example: - 'CardIssueParams parameters = new()\n{\n CardholderID = "Customer:019542f5-b3e7-1d02-0000-000000000001",\n Form = Form.Virtual,\n FundingSources =\n [\n "InternalAccount:019542f5-b3e7-1d02-0000-000000000002"\n ],\n};\n\nvar response = await client.Cards.Issue(parameters);\n\nConsole.WriteLine(response);', + "cards->issue(\n cardholderID: 'Customer:019542f5-b3e7-1d02-0000-000000000001',\n form: 'VIRTUAL',\n fundingSources: ['InternalAccount:019542f5-b3e7-1d02-0000-000000000002'],\n platformCardID: 'card-emp-aary-001',\n);\n\nvar_dump($card);", }, http: { example: @@ -6498,17 +5981,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'limit?: number;', 'platformCardId?: string;', "sortOrder?: 'asc' | 'desc';", - "state?: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED';", + "state?: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED';", ], response: - "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", + "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", markdown: - "## list\n\n`client.cards.list(accountId?: string, cardholderId?: string, cursor?: string, limit?: number, platformCardId?: string, sortOrder?: 'asc' | 'desc', state?: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**get** `/cards`\n\nRetrieve a paginated list of cards. Cards can be filtered by cardholder, bound funding-source internal account, state, and platform-specific card identifier. If no filters are provided, returns all cards visible to the caller.\n\n\n### Parameters\n\n- `accountId?: string`\n Filter by internal account id. Returns cards whose `fundingSources` array contains the given internal account id.\n\n- `cardholderId?: string`\n Filter by cardholder (customer) id.\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `platformCardId?: string`\n Filter by platform-specific card identifier.\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `state?: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n Filter by card state.\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `panEmbedUrl?: string`\n - `platformCardId?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const cardListResponse of client.cards.list()) {\n console.log(cardListResponse);\n}\n```", + "## list\n\n`client.cards.list(accountId?: string, cardholderId?: string, cursor?: string, limit?: number, platformCardId?: string, sortOrder?: 'asc' | 'desc', state?: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**get** `/cards`\n\nRetrieve a paginated list of cards. Cards can be filtered by cardholder, bound funding-source internal account, state, and platform-specific card identifier. If no filters are provided, returns all cards visible to the caller.\n\n\n### Parameters\n\n- `accountId?: string`\n Filter by internal account id. Returns cards whose `fundingSources` array contains the given internal account id.\n\n- `cardholderId?: string`\n Filter by cardholder (customer) id.\n\n- `cursor?: string`\n Cursor for pagination (returned from previous request)\n\n- `limit?: number`\n Maximum number of results to return (default 20, max 100)\n\n- `platformCardId?: string`\n Filter by platform-specific card identifier.\n\n- `sortOrder?: 'asc' | 'desc'`\n Order to sort results in\n\n- `state?: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n Filter by card state.\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `platformCardId?: string`\n - `processorRef?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// Automatically fetches more pages as needed.\nfor await (const card of client.cards.list()) {\n console.log(card);\n}\n```", perLanguage: { typescript: { method: 'client.cards.list', example: - "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const cardListResponse of client.cards.list()) {\n console.log(cardListResponse.id);\n}", + "import LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const card of client.cards.list()) {\n console.log(card.id);\n}", }, python: { method: 'cards.list', @@ -6539,11 +6022,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "cards->list(\n accountID: 'accountId',\n cardholderID: 'cardholderId',\n cursor: 'cursor',\n limit: 1,\n platformCardID: 'platformCardId',\n sortOrder: 'asc',\n state: 'PENDING_KYC',\n);\n\nvar_dump($page);", }, - csharp: { - method: 'Cards.List', - example: - 'CardListParams parameters = new();\n\nvar page = await client.Cards.List(parameters);\nawait foreach (var item in page.Paginate())\n{\n Console.WriteLine(item);\n}', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/cards \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6555,14 +6033,15 @@ const EMBEDDED_METHODS: MethodEntry[] = [ endpoint: '/cards/{id}', httpMethod: 'get', summary: 'Get a card', - description: 'Retrieve a card by its system-generated id.', + description: + "Retrieve a card by its system-generated id. To display the card's full PAN, CVV, and expiry to the cardholder, request a reveal with `POST /cards/{id}/reveal` — the card resource itself never carries the reveal URL.", stainlessPath: '(resource) cards > (method) retrieve', qualified: 'client.cards.retrieve', params: ['id: string;'], response: - "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", + "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", markdown: - "## retrieve\n\n`client.cards.retrieve(id: string): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**get** `/cards/{id}`\n\nRetrieve a card by its system-generated id.\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `panEmbedUrl?: string`\n - `platformCardId?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst card = await client.cards.retrieve('id');\n\nconsole.log(card);\n```", + "## retrieve\n\n`client.cards.retrieve(id: string): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**get** `/cards/{id}`\n\nRetrieve a card by its system-generated id. To display the card's full PAN, CVV, and expiry to the cardholder, request a reveal with `POST /cards/{id}/reveal` — the card resource itself never carries the reveal URL.\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `platformCardId?: string`\n - `processorRef?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst card = await client.cards.retrieve('id');\n\nconsole.log(card);\n```", perLanguage: { typescript: { method: 'client.cards.retrieve', @@ -6577,7 +6056,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'cards().retrieve', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.CardRetrieveParams\nimport com.lightspark.grid.models.cards.CardRetrieveResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val card: CardRetrieveResponse = client.cards().retrieve("id")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.Card\nimport com.lightspark.grid.models.cards.CardRetrieveParams\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val card: Card = client.cards().retrieve("id")\n}', }, go: { method: 'client.Cards.Get', @@ -6599,11 +6078,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "cards->retrieve('id');\n\nvar_dump($card);", }, - csharp: { - method: 'Cards.Retrieve', - example: - 'CardRetrieveParams parameters = new() { ID = "id" };\n\nvar card = await client.Cards.Retrieve(parameters);\n\nConsole.WriteLine(card);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/cards/$ID \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET"', @@ -6627,9 +6101,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'Request-Id?: string;', ], response: - "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", + "{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }", markdown: - "## update\n\n`client.cards.update(id: string, fundingSources?: string[], state?: 'ACTIVE' | 'FROZEN' | 'CLOSED', Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**patch** `/cards/{id}`\n\nUpdate a card's `state` and / or its bound `fundingSources`. At least one of the two fields must be supplied.\n\n- `state` transitions are limited to `ACTIVE ⇄ FROZEN` and `ACTIVE | FROZEN → CLOSED`. `CLOSED` is terminal and irreversible. Any other transition returns `409 INVALID_STATE_TRANSITION`.\n- `fundingSources`, when supplied, fully replaces the card's bound funding sources. Array order determines the priority Authorization Decisioning tries them in. Each id must belong to the cardholder and be denominated in the card's currency; the list must contain at least one source. `fundingSources` cannot be supplied alongside `state: CLOSED`.\n\nBecause both updates are sensitive state changes, this endpoint uses Grid's 202 → signed-retry pattern (same shape as `DELETE /auth/credentials/{id}` and `POST /internal-accounts/{id}/export`):\n\n1. Call `PATCH /cards/{id}` with the target fields and no signing headers. The response is `202` with a `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Sign the `payloadToSign` with the session private key of a verified authentication credential on the card's owning internal account and retry with the signature as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `200` with the updated `Card`.\n\nEffects:\n- `state: FROZEN`: Authorization Decisioning declines new auths with `CARD_PAUSED`. Existing pulls and in-flight reconciliation continue — freezing does not pause the lifecycle of authorizations that already passed.\n- `state: ACTIVE`: normal authorization behavior resumes.\n- `state: CLOSED`: terminal close. The card transitions to `state: \"CLOSED\"` with `stateReason: \"CLOSED_BY_PLATFORM\"` and stays in the system for audit and reconciliation. All pending auths reconcile to a terminal state via the existing reconcile primitive. Inbound clearings received after close follow the standard force-post / late-presentment path — Lightspark absorbs the loss if a post-hoc pull on the now-unbound source fails. Funding-source bindings are detached. Refunds already in flight still complete because Lightspark holds the card-reserve keys.\n- `fundingSources` change: emits `card.funding_source_change` reflecting the new ordered binding.\n\nThe `card.state_change` webhook fires on every successful `state` transition; the `card.funding_source_change` webhook fires whenever `fundingSources` is updated.\n\n\n### Parameters\n\n- `id: string`\n\n- `fundingSources?: string[]`\n New ordered list of internal account ids to bind as funding sources. Fully replaces the previous binding. Each id must belong to the cardholder and be denominated in the card's currency. The list must contain at least one source — to stop a card from spending without removing all sources, transition it to `FROZEN` instead. Cannot be supplied alongside `state: CLOSED`.\n\n- `state?: 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n Target state for the card. Permitted transitions are `ACTIVE ⇄ FROZEN` and `ACTIVE | FROZEN → CLOSED`. `CLOSED` is terminal and irreversible; once closed, the card stays in the system for audit and reconciliation but cannot transact again.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; panEmbedUrl?: string; platformCardId?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `panEmbedUrl?: string`\n - `platformCardId?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst card = await client.cards.update('id');\n\nconsole.log(card);\n```", + "## update\n\n`client.cards.update(id: string, fundingSources?: string[], state?: 'ACTIVE' | 'FROZEN' | 'CLOSED', Grid-Wallet-Signature?: string, Request-Id?: string): { id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n**patch** `/cards/{id}`\n\nUpdate a card's `state` and / or its bound `fundingSources`. At least one of the two fields must be supplied.\n\n- `state` transitions are limited to `ACTIVE ⇄ FROZEN` and `ACTIVE | FROZEN → CLOSED`. `CLOSED` is terminal and irreversible. Any other transition returns `409 INVALID_STATE_TRANSITION`.\n- `fundingSources`, when supplied, fully replaces the card's bound funding sources. Array order determines the priority Authorization Decisioning tries them in. Each id must belong to the cardholder and be denominated in the card's currency; the list must contain at least one source. `fundingSources` cannot be supplied alongside `state: CLOSED`.\n\nBecause both updates are sensitive state changes, this endpoint uses Grid's 202 → signed-retry pattern (same shape as `DELETE /auth/credentials/{id}` and `POST /internal-accounts/{id}/export`):\n\n1. Call `PATCH /cards/{id}` with the target fields and no signing headers. The response is `202` with a `payloadToSign`, `requestId`, and `expiresAt`.\n\n2. Sign the `payloadToSign` with the session private key of a verified authentication credential on the card's owning internal account and retry with the signature as the `Grid-Wallet-Signature` header and the `requestId` echoed back as the `Request-Id` header. The signed retry returns `200` with the updated `Card`.\n\nEffects:\n- `state: FROZEN`: Authorization Decisioning declines new auths with `CARD_PAUSED`. Existing pulls and in-flight reconciliation continue — freezing does not pause the lifecycle of authorizations that already passed.\n- `state: ACTIVE`: normal authorization behavior resumes.\n- `state: CLOSED`: terminal close. The card transitions to `state: \"CLOSED\"` with `stateReason: \"CLOSED_BY_PLATFORM\"` and stays in the system for audit and reconciliation. All pending auths reconcile to a terminal state via the existing reconcile primitive. Inbound clearings received after close follow the standard force-post / late-presentment path — Lightspark absorbs the loss if a post-hoc pull on the now-unbound source fails. Funding-source bindings are detached. Refunds already in flight still complete because Lightspark holds the card-reserve keys.\n- `fundingSources` change: emits `card.funding_source_change` reflecting the new ordered binding.\n\nThe `card.state_change` webhook fires on every successful `state` transition; the `card.funding_source_change` webhook fires whenever `fundingSources` is updated.\n\n\n### Parameters\n\n- `id: string`\n\n- `fundingSources?: string[]`\n New ordered list of internal account ids to bind as funding sources. Fully replaces the previous binding. Each id must belong to the cardholder and be denominated in the card's currency. The list must contain at least one source — to stop a card from spending without removing all sources, transition it to `FROZEN` instead. Cannot be supplied alongside `state: CLOSED`.\n\n- `state?: 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n Target state for the card. Permitted transitions are `ACTIVE ⇄ FROZEN` and `ACTIVE | FROZEN → CLOSED`. `CLOSED` is terminal and irreversible; once closed, the card stays in the system for audit and reconciliation but cannot transact again.\n\n- `Grid-Wallet-Signature?: string`\n\n- `Request-Id?: string`\n\n### Returns\n\n- `{ id: string; cardholderId: string; createdAt: string; form: 'VIRTUAL'; fundingSources: string[]; state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; updatedAt: string; brand?: 'VISA' | 'MASTERCARD'; currency?: string; expMonth?: number; expYear?: number; issuerRef?: string; last4?: string; platformCardId?: string; processorRef?: string; stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'; }`\n\n - `id: string`\n - `cardholderId: string`\n - `createdAt: string`\n - `form: 'VIRTUAL'`\n - `fundingSources: string[]`\n - `state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'`\n - `updatedAt: string`\n - `brand?: 'VISA' | 'MASTERCARD'`\n - `currency?: string`\n - `expMonth?: number`\n - `expYear?: number`\n - `issuerRef?: string`\n - `last4?: string`\n - `platformCardId?: string`\n - `processorRef?: string`\n - `stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID'`\n\n### Example\n\n```typescript\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\nconst card = await client.cards.update('id');\n\nconsole.log(card);\n```", perLanguage: { typescript: { method: 'client.cards.update', @@ -6644,12 +6118,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ kotlin: { method: 'cards().update', example: - 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.CardUpdateParams\nimport com.lightspark.grid.models.cards.CardUpdateResponse\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val card: CardUpdateResponse = client.cards().update("id")\n}', + 'package com.lightspark.grid.example\n\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.cards.Card\nimport com.lightspark.grid.models.cards.CardUpdateParams\nimport com.lightspark.grid.models.cards.CardUpdateRequest\n\nfun main() {\n val client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\n val params: CardUpdateParams = CardUpdateParams.builder()\n .id("id")\n .cardUpdateRequest(CardUpdateRequest.builder().build())\n .build()\n val card: Card = client.cards().update(params)\n}', }, go: { method: 'client.Cards.Update', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcard, err := client.Cards.Update(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.CardUpdateParams{\n\t\t\tState: grid.CardUpdateParamsStateFrozen,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card.ID)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"),\n\t\toption.WithPassword("My Password"),\n\t)\n\tcard, err := client.Cards.Update(\n\t\tcontext.TODO(),\n\t\t"id",\n\t\tgrid.CardUpdateParams{\n\t\t\tCardUpdateRequest: grid.CardUpdateRequestParam{},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", card.ID)\n}\n', }, ruby: { method: 'cards.update', @@ -6666,11 +6140,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [ example: "cards->update(\n 'id',\n fundingSources: [\n 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002',\n 'InternalAccount:019542f5-b3e7-1d02-0000-000000000003',\n ],\n state: 'FROZEN',\n gridWalletSignature: 'MEUCIQDx7k2N0aK4p8f3vR9J6yT5wL1mB0sXnG2hQ4vJ8zYkCgIgZ4rP9dT7eWfU3oM6KjR1qSpNvBwL0tXyA2iG8fH5dE=',\n requestID: '7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21',\n);\n\nvar_dump($card);", }, - csharp: { - method: 'Cards.Update', - example: - 'CardUpdateParams parameters = new() { ID = "id" };\n\nvar card = await client.Cards.Update(parameters);\n\nConsole.WriteLine(card);', - }, http: { example: 'curl https://api.lightspark.com/grid/2025-10-13/cards/$ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -u "$GRID_CLIENT_ID:GRID_CLIENT_SECRET" \\\n -d \'{\n "fundingSources": [\n "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",\n "InternalAccount:019542f5-b3e7-1d02-0000-000000000003"\n ],\n "state": "FROZEN"\n }\'', @@ -6685,20 +6154,15 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [ content: "# Lightspark Grid CLI\n\nThe official CLI for the [Lightspark Grid REST API](grid.lightspark.com).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## Installation\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/stainless-sdks/grid-cli/cmd/grid@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\ngrid [resource] [flags...]\n~~~\n\n~~~sh\ngrid quotes create \\\n --username 'My Username' \\\n --password 'My Password' \\\n --destination '{destinationType: ACCOUNT, accountId: ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123}' \\\n --locked-currency-amount 10000 \\\n --locked-currency-side SENDING \\\n --source '{sourceType: ACCOUNT, accountId: InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965}'\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Description | Required | Default value |\n| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ------------- |\n| `GRID_CLIENT_ID` | API token authentication using format `:` | no | `null` |\n| `GRID_CLIENT_SECRET` | API token authentication using format `:` | no | `null` |\n| `GRID_AGENT_ACCESS_TOKEN` | Bearer access token obtained by redeeming a device code. Required when calling agent-scoped endpoints (e.g. `GET /agents/me/...`). Leave unset for platform-scoped operations. | no | `null` |\n| `GRID_WEBHOOK_PUBKEY` | Secp256r1 (P-256) asymmetric signature of the webhook payload, which can be used to verify that the webhook was sent by Grid.\n\nTo verify the signature:\n1. Get the Grid public key provided to you during integration\n2. Decode the base64 signature from the header\n3. Create a SHA-256 hash of the request body\n4. Verify the signature using the public key and the hash\n\nIf the signature verification succeeds, the webhook is authentic. If not, it should be rejected.\n | no | `null` |\n\n### Global flags\n\n- `--username` - API token authentication using format `:` (can also be set with `GRID_CLIENT_ID` env var)\n- `--password` - API token authentication using format `:` (can also be set with `GRID_CLIENT_SECRET` env var)\n- `--agent-access-token` - Bearer access token obtained by redeeming a device code. Required when calling agent-scoped endpoints (e.g. `GET /agents/me/...`). Leave unset for platform-scoped operations. (can also be set with `GRID_AGENT_ACCESS_TOKEN` env var)\n- `--webhook-signature` - Secp256r1 (P-256) asymmetric signature of the webhook payload, which can be used to verify that the webhook was sent by Grid.\n\nTo verify the signature:\n1. Get the Grid public key provided to you during integration\n2. Decode the base64 signature from the header\n3. Create a SHA-256 hash of the request body\n4. Verify the signature using the public key and the hash\n\nIf the signature verification succeeds, the webhook is authentic. If not, it should be rejected.\n (can also be set with `GRID_WEBHOOK_PUBKEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\ngrid --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\ngrid --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\ngrid < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\ngrid --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Lightspark Grid Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/grid-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../grid-go`.\n", }, - { - language: 'csharp', - content: - '# Lightspark Grid C# API Library\n\nThe Lightspark Grid C# SDK provides convenient access to the [Lightspark Grid REST API](grid.lightspark.com) from applications written in C#.\n\n## Installation\n\n```bash\ngit clone git@github.com:stainless-sdks/grid-csharp.git\ndotnet add reference grid-csharp/src/Grid\n```\n\n## Requirements\n\nThis library requires .NET Standard 2.0 or later.\n\n## Usage\n\nSee the [`examples`](examples) directory for complete and runnable examples.\n\n```csharp\nLightsparkGridClient client = new();\n\nQuoteCreateParams parameters = new()\n{\n Destination = JsonSerializer.Deserialize(\n """\n {\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"\n }\n """\n ),\n LockedCurrencyAmount = 10000,\n LockedCurrencySide = LockedCurrencySide.Sending,\n Source = JsonSerializer.Deserialize(\n """\n {\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"\n }\n """\n ),\n};\n\nvar quote = await client.Quotes.Create(parameters);\n\nConsole.WriteLine(quote);\n```', - }, { language: 'go', content: - '# Lightspark Grid Go API Library\n\nGo Reference\n\nThe Lightspark Grid Go library provides convenient access to the [Lightspark Grid REST API](grid.lightspark.com)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%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/stainless-sdks/grid-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/stainless-sdks/grid-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/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"), // defaults to os.LookupEnv("GRID_CLIENT_ID")\n\t\toption.WithPassword("My Password"), // defaults to os.LookupEnv("GRID_CLIENT_SECRET")\n\t)\n\tquote, err := client.Quotes.New(context.TODO(), grid.QuoteNewParams{\n\t\tDestination: map[string]any{\n\t\t\t"destinationType": "ACCOUNT",\n\t\t\t"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tLockedCurrencyAmount: 10000,\n\t\tLockedCurrencySide: grid.QuoteNewParamsLockedCurrencySideSending,\n\t\tSource: map[string]any{\n\t\t\t"sourceType": "ACCOUNT",\n\t\t\t"accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quote.ID)\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.Quotes.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/stainless-sdks/grid-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.Customers.ListAutoPaging(context.TODO(), grid.CustomerListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tcustomerListResponse := iter.Current()\n\tfmt.Printf("%+v\\n", customerListResponse)\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.Customers.List(context.TODO(), grid.CustomerListParams{})\nfor page != nil {\n\tfor _, customer := range page.Data {\n\t\tfmt.Printf("%+v\\n", customer)\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.Quotes.New(context.TODO(), grid.QuoteNewParams{\n\tDestination: map[string]any{\n\t\t"destinationType": "ACCOUNT",\n\t\t"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t},\n\tLockedCurrencyAmount: 10000,\n\tLockedCurrencySide: grid.QuoteNewParamsLockedCurrencySideSending,\n\tSource: map[string]any{\n\t\t"sourceType": "ACCOUNT",\n\t\t"accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t},\n})\nif err != nil {\n\tvar apierr *grid.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}\n\tpanic(err.Error()) // GET "/quotes": 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.Quotes.New(\n\tctx,\n\tgrid.QuoteNewParams{\n\t\tDestination: map[string]any{\n\t\t\t"destinationType": "ACCOUNT",\n\t\t\t"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tLockedCurrencyAmount: 10000,\n\t\tLockedCurrencySide: grid.QuoteNewParamsLockedCurrencySideSending,\n\t\tSource: map[string]any{\n\t\t\t"sourceType": "ACCOUNT",\n\t\t\t"accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\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```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\ngrid.CustomerBulkUploadCsvParams{\n\tFile: file,\n}\n\n// A file from a string\ngrid.CustomerBulkUploadCsvParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\ngrid.CustomerBulkUploadCsvParams{\n\tFile: grid.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\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 := grid.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Quotes.New(\n\tcontext.TODO(),\n\tgrid.QuoteNewParams{\n\t\tDestination: map[string]any{\n\t\t\t"destinationType": "ACCOUNT",\n\t\t\t"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tLockedCurrencyAmount: 10000,\n\t\tLockedCurrencySide: grid.QuoteNewParamsLockedCurrencySideSending,\n\t\tSource: map[string]any{\n\t\t\t"sourceType": "ACCOUNT",\n\t\t\t"accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\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\nquote, err := client.Quotes.New(\n\tcontext.TODO(),\n\tgrid.QuoteNewParams{\n\t\tDestination: map[string]any{\n\t\t\t"destinationType": "ACCOUNT",\n\t\t\t"accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n\t\t},\n\t\tLockedCurrencyAmount: 10000,\n\t\tLockedCurrencySide: grid.QuoteNewParamsLockedCurrencySideSending,\n\t\tSource: map[string]any{\n\t\t\t"sourceType": "ACCOUNT",\n\t\t\t"accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n\t\t},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", quote)\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/stainless-sdks/grid-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + '# Lightspark Grid Go API Library\n\nGo Reference\n\nThe Lightspark Grid Go library provides convenient access to the [Lightspark Grid REST API](grid.lightspark.com)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%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/stainless-sdks/grid-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/stainless-sdks/grid-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/stainless-sdks/grid-go"\n\t"github.com/stainless-sdks/grid-go/option"\n)\n\nfunc main() {\n\tclient := grid.NewClient(\n\t\toption.WithUsername("My Username"), // defaults to os.LookupEnv("GRID_CLIENT_ID")\n\t\toption.WithPassword("My Password"), // defaults to os.LookupEnv("GRID_CLIENT_SECRET")\n\t)\n\tquote, err := client.Quotes.New(context.TODO(), grid.QuoteNewParams{\n\t\tQuoteRequest: grid.QuoteRequestParam{\n\t\t\tDestination: map[string]any{},\n\t\t\tLockedCurrencyAmount: 1000,\n\t\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\t\tSource: map[string]any{},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", quote.ID)\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.Quotes.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/stainless-sdks/grid-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.Customers.ListAutoPaging(context.TODO(), grid.CustomerListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tcustomerOneOf := iter.Current()\n\tfmt.Printf("%+v\\n", customerOneOf)\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.Customers.List(context.TODO(), grid.CustomerListParams{})\nfor page != nil {\n\tfor _, customer := range page.Data {\n\t\tfmt.Printf("%+v\\n", customer)\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.Quotes.New(context.TODO(), grid.QuoteNewParams{\n\tQuoteRequest: grid.QuoteRequestParam{\n\t\tDestination: map[string]any{},\n\t\tLockedCurrencyAmount: 1000,\n\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\tSource: map[string]any{},\n\t},\n})\nif err != nil {\n\tvar apierr *grid.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}\n\tpanic(err.Error()) // GET "/quotes": 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.Quotes.New(\n\tctx,\n\tgrid.QuoteNewParams{\n\t\tQuoteRequest: grid.QuoteRequestParam{\n\t\t\tDestination: map[string]any{},\n\t\t\tLockedCurrencyAmount: 1000,\n\t\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\t\tSource: map[string]any{},\n\t\t},\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```go\n// A file from the file system\nfile, err := os.Open("/path/to/file")\ngrid.CustomerBulkUploadCsvParams{\n\tFile: file,\n}\n\n// A file from a string\ngrid.CustomerBulkUploadCsvParams{\n\tFile: strings.NewReader("my file contents"),\n}\n\n// With a custom filename and contentType\ngrid.CustomerBulkUploadCsvParams{\n\tFile: grid.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),\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 := grid.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Quotes.New(\n\tcontext.TODO(),\n\tgrid.QuoteNewParams{\n\t\tQuoteRequest: grid.QuoteRequestParam{\n\t\t\tDestination: map[string]any{},\n\t\t\tLockedCurrencyAmount: 1000,\n\t\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\t\tSource: map[string]any{},\n\t\t},\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\nquote, err := client.Quotes.New(\n\tcontext.TODO(),\n\tgrid.QuoteNewParams{\n\t\tQuoteRequest: grid.QuoteRequestParam{\n\t\t\tDestination: map[string]any{},\n\t\t\tLockedCurrencyAmount: 1000,\n\t\t\tLockedCurrencySide: grid.QuoteRequestLockedCurrencySideSending,\n\t\t\tSource: map[string]any{},\n\t\t},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", quote)\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/stainless-sdks/grid-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', }, { language: 'kotlin', content: - '# Lightspark Grid Kotlin API Library\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.lightspark.grid/lightspark-grid-kotlin)](https://central.sonatype.com/artifact/com.lightspark.grid/lightspark-grid-kotlin/0.0.1)\n[![javadoc](https://javadoc.io/badge2/com.lightspark.grid/lightspark-grid-kotlin/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.lightspark.grid/lightspark-grid-kotlin/0.0.1)\n\n\nThe Lightspark Grid Kotlin SDK provides convenient access to the [Lightspark Grid REST API](grid.lightspark.com) from applications written in Kotlin.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nKDocs are available on [javadoc.io](https://javadoc.io/doc/com.lightspark.grid/lightspark-grid-kotlin/0.0.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("com.lightspark.grid:lightspark-grid-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n\n com.lightspark.grid\n lightspark-grid-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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder()\n .putAdditionalProperty("destinationType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"))\n .build())\n .lockedCurrencyAmount(10000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .build()\nval quote: Quote = client.quotes().create(params)\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.builder()\n .username("My Username")\n .password("My Password")\n .agentAccessToken("My Agent Access Token")\n .webhookSignature("My Webhook Signature")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.builder()\n // Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n // Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\n .fromEnv()\n .username("My Username")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| ------------------ | ------------------------------------- | -------------------------- | -------- | ---------------------------------------------- |\n| `username` | `lightsparkgrid.gridClientId` | `GRID_CLIENT_ID` | false | - |\n| `password` | `lightsparkgrid.gridClientSecret` | `GRID_CLIENT_SECRET` | false | - |\n| `agentAccessToken` | `lightsparkgrid.gridAgentAccessToken` | `GRID_AGENT_ACCESS_TOKEN` | false | - |\n| `webhookSignature` | `lightsparkgrid.gridWebhookPubkey` | `GRID_WEBHOOK_PUBKEY` | false | - |\n| `baseUrl` | `lightsparkgrid.baseUrl` | `LIGHTSPARK_GRID_BASE_URL` | true | `"https://api.lightspark.com/grid/2025-10-13"` |\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.lightspark.grid.client.LightsparkGridClient\n\nval clientWithOptions: LightsparkGridClient = 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 Lightspark Grid 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.quotes().create(...)` should be called with an instance of `QuoteCreateParams`, and it will return an instance of `Quote`.\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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder()\n .putAdditionalProperty("destinationType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"))\n .build())\n .lockedCurrencyAmount(10000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .build()\nval quote: Quote = client.async().quotes().create(params)\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClientAsync\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClientAsync\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClientAsync = LightsparkGridOkHttpClientAsync.fromEnv()\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder()\n .putAdditionalProperty("destinationType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"))\n .build())\n .lockedCurrencyAmount(10000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .build()\nval quote: Quote = client.quotes().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## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```kotlin\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\nimport java.nio.file.Paths\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file(Paths.get("/path/to/file"))\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```kotlin\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\nimport java.net.URL\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file(URL("https://example.com//path/to/file").openStream())\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\n```\n\nOr a `ByteArray`:\n\n```kotlin\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file("content".toByteArray())\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt):\n\n```kotlin\nimport com.lightspark.grid.core.MultipartField\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\nimport java.io.InputStream\nimport java.net.URL\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file(MultipartField.builder()\n .value(URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\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.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.core.http.Headers\nimport com.lightspark.grid.core.http.HttpResponseFor\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder()\n .putAdditionalProperty("destinationType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"))\n .build())\n .lockedCurrencyAmount(10000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .build()\nval quote: HttpResponseFor = client.quotes().withRawResponse().create(params)\n\nval statusCode: Int = quote.statusCode()\nval headers: Headers = quote.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport com.lightspark.grid.models.quotes.Quote\n\nval parsedQuote: Quote = quote.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`LightsparkGridServiceException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridServiceException.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`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/UnexpectedStatusCodeException.kt) |\n\n- [`LightsparkGridIoException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridIoException.kt): I/O networking errors.\n\n- [`LightsparkGridRetryableException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`LightsparkGridInvalidDataException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridInvalidDataException.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- [`LightsparkGridException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridException.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.lightspark.grid.models.customers.CustomerListPage\n\nval page: CustomerListPage = client.customers().list()\npage.autoPager()\n .take(50)\n .forEach { customer -> println(customer) }\n```\n\nWhen using the asynchronous client, the method returns a [`Flow`](https://kotlinlang.org/docs/flow.html):\n\n```kotlin\nimport com.lightspark.grid.models.customers.CustomerListPageAsync\n\nval page: CustomerListPageAsync = client.async().customers().list()\npage.autoPager()\n .take(50)\n .forEach { customer -> println(customer) }\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.lightspark.grid.models.customers.CustomerListPage\nimport com.lightspark.grid.models.customers.CustomerListResponse\n\nval page: CustomerListPage = client.customers().list()\nwhile (true) {\n for (customer in page.items()) {\n println(customer)\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 `LIGHTSPARK_GRID_LOG` environment variable to `info`:\n\n```sh\nexport LIGHTSPARK_GRID_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport LIGHTSPARK_GRID_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.LogLevel\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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 `lightspark-grid-kotlin-core` is published with a [configuration file](lightspark-grid-kotlin-core/src/main/resources/META-INF/proguard/lightspark-grid-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 [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) or [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.models.quotes.Quote\n\nval quote: Quote = client.quotes().create(\n params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport java.time.Duration\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.http.ProxyAuthenticator\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport java.time.Duration\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `lightspark-grid-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LightsparkGridClient`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClient.kt), [`LightsparkGridClientAsync`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsync.kt), [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt), and [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), all of which can work with any HTTP client\n- `lightspark-grid-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) and [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.kt), which provide a way to construct [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt) and [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), respectively, using OkHttp\n- `lightspark-grid-kotlin`\n - Depends on and exposes the APIs of both `lightspark-grid-kotlin-core` and `lightspark-grid-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 [`lightspark-grid-kotlin` dependency](#installation) with `lightspark-grid-kotlin-core`\n2. Copy `lightspark-grid-kotlin-client-okhttp`\'s [`OkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt) or [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), similarly to [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) or [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`lightspark-grid-kotlin` dependency](#installation) with `lightspark-grid-kotlin-core`\n2. Write a class that implements the [`HttpClient`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/http/HttpClient.kt) interface\n3. Construct [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt) or [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), similarly to [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) or [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.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.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\n\nval params: QuoteCreateParams = QuoteCreateParams.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.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.config.ConfigUpdateParams\nimport com.lightspark.grid.models.config.EmbeddedWalletConfig\n\nval params: ConfigUpdateParams = ConfigUpdateParams.builder()\n .embeddedWalletConfig(EmbeddedWalletConfig.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`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt) object to its setter:\n\n```kotlin\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .destination(QuoteDestinationOneOf.builder()\n .putAdditionalProperty("destinationType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"))\n .build())\n .lockedCurrencyAmount(JsonValue.from(3.14))\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .build()\n```\n\nThe most straightforward way to create a [`JsonValue`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport com.lightspark.grid.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`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt):\n\n```kotlin\nimport com.lightspark.grid.core.JsonMissing\nimport com.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .lockedCurrencyAmount(10000L)\n .lockedCurrencySide(QuoteCreateParams.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder()\n .putAdditionalProperty("sourceType", JsonValue.from("ACCOUNT"))\n .putAdditionalProperty("accountId", JsonValue.from("InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965"))\n .build())\n .destination(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport com.lightspark.grid.core.JsonBoolean\nimport com.lightspark.grid.core.JsonNull\nimport com.lightspark.grid.core.JsonNumber\nimport com.lightspark.grid.core.JsonValue\n\nval additionalProperties: Map = client.quotes().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.lightspark.grid.core.JsonField\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\n\nval destination: JsonField = client.quotes().create(params)._destination()\n\nif (destination.isMissing()) {\n // The property is absent from the JSON response\n} else if (destination.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? = destination.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = destination.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 [`LightsparkGridInvalidDataException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridInvalidDataException.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.lightspark.grid.models.quotes.Quote\n\nval quote: Quote = client.quotes().create(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport com.lightspark.grid.models.quotes.Quote\n\nval quote: Quote = client.quotes().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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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/lightsparkdev/grid-kotlin-sdk/issues) with questions, bugs, or suggestions.\n', + '# Lightspark Grid Kotlin API Library\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.lightspark.grid/lightspark-grid-kotlin)](https://central.sonatype.com/artifact/com.lightspark.grid/lightspark-grid-kotlin/0.0.1)\n[![javadoc](https://javadoc.io/badge2/com.lightspark.grid/lightspark-grid-kotlin/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.lightspark.grid/lightspark-grid-kotlin/0.0.1)\n\n\nThe Lightspark Grid Kotlin SDK provides convenient access to the [Lightspark Grid REST API](grid.lightspark.com) from applications written in Kotlin.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nKDocs are available on [javadoc.io](https://javadoc.io/doc/com.lightspark.grid/lightspark-grid-kotlin/0.0.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("com.lightspark.grid:lightspark-grid-kotlin:0.0.1")\n~~~\n\n### Maven\n\n~~~xml\n\n com.lightspark.grid\n lightspark-grid-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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\nval params: QuoteRequest = QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\nval quote: Quote = client.quotes().create(params)\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n```\n\nOr manually:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.builder()\n .username("My Username")\n .password("My Password")\n .agentAccessToken("My Agent Access Token")\n .webhookSignature("My Webhook Signature")\n .build()\n```\n\nOr using a combination of the two approaches:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.builder()\n // Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n // Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\n .fromEnv()\n .username("My Username")\n .build()\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| ------------------ | ------------------------------------- | -------------------------- | -------- | ---------------------------------------------- |\n| `username` | `lightsparkgrid.gridClientId` | `GRID_CLIENT_ID` | false | - |\n| `password` | `lightsparkgrid.gridClientSecret` | `GRID_CLIENT_SECRET` | false | - |\n| `agentAccessToken` | `lightsparkgrid.gridAgentAccessToken` | `GRID_AGENT_ACCESS_TOKEN` | false | - |\n| `webhookSignature` | `lightsparkgrid.gridWebhookPubkey` | `GRID_WEBHOOK_PUBKEY` | false | - |\n| `baseUrl` | `lightsparkgrid.baseUrl` | `LIGHTSPARK_GRID_BASE_URL` | true | `"https://api.lightspark.com/grid/2025-10-13"` |\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.lightspark.grid.client.LightsparkGridClient\n\nval clientWithOptions: LightsparkGridClient = 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 Lightspark Grid 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.quotes().create(...)` should be called with an instance of `QuoteCreateParams`, and it will return an instance of `Quote`.\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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.fromEnv()\n\nval params: QuoteRequest = QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\nval quote: Quote = client.async().quotes().create(params)\n```\n\nOr create an asynchronous client from the beginning:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClientAsync\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClientAsync\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\n// Configures using the `lightsparkgrid.gridClientId`, `lightsparkgrid.gridClientSecret`, `lightsparkgrid.gridAgentAccessToken`, `lightsparkgrid.gridWebhookPubkey` and `lightsparkgrid.baseUrl` system properties\n// Or configures using the `GRID_CLIENT_ID`, `GRID_CLIENT_SECRET`, `GRID_AGENT_ACCESS_TOKEN`, `GRID_WEBHOOK_PUBKEY` and `LIGHTSPARK_GRID_BASE_URL` environment variables\nval client: LightsparkGridClientAsync = LightsparkGridOkHttpClientAsync.fromEnv()\n\nval params: QuoteRequest = QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\nval quote: Quote = client.quotes().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## File uploads\n\nThe SDK defines methods that accept files.\n\nTo upload a file, pass a [`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html):\n\n```kotlin\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\nimport java.nio.file.Paths\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file(Paths.get("/path/to/file"))\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\n```\n\nOr an arbitrary [`InputStream`](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html):\n\n```kotlin\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\nimport java.net.URL\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file(URL("https://example.com//path/to/file").openStream())\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\n```\n\nOr a `ByteArray`:\n\n```kotlin\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file("content".toByteArray())\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\n```\n\nNote that when passing a non-`Path` its filename is unknown so it will not be included in the request. To manually set a filename, pass a [`MultipartField`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt):\n\n```kotlin\nimport com.lightspark.grid.core.MultipartField\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvParams\nimport com.lightspark.grid.models.customers.bulk.BulkUploadCsvResponse\nimport java.io.InputStream\nimport java.net.URL\n\nval params: BulkUploadCsvParams = BulkUploadCsvParams.builder()\n .file(MultipartField.builder()\n .value(URL("https://example.com//path/to/file").openStream())\n .filename("/path/to/file")\n .build())\n .build()\nval response: BulkUploadCsvResponse = client.customers().bulk().uploadCsv(params)\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.lightspark.grid.core.http.Headers\nimport com.lightspark.grid.core.http.HttpResponseFor\nimport com.lightspark.grid.models.quotes.Quote\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nval params: QuoteRequest = QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build()\nval quote: HttpResponseFor = client.quotes().withRawResponse().create(params)\n\nval statusCode: Int = quote.statusCode()\nval headers: Headers = quote.headers()\n```\n\nYou can still deserialize the response into an instance of a Kotlin class if needed:\n\n```kotlin\nimport com.lightspark.grid.models.quotes.Quote\n\nval parsedQuote: Quote = quote.parse()\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`LightsparkGridServiceException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridServiceException.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`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/UnexpectedStatusCodeException.kt) |\n\n- [`LightsparkGridIoException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridIoException.kt): I/O networking errors.\n\n- [`LightsparkGridRetryableException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`LightsparkGridInvalidDataException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridInvalidDataException.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- [`LightsparkGridException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridException.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.lightspark.grid.models.customers.CustomerListPage\n\nval page: CustomerListPage = client.customers().list()\npage.autoPager()\n .take(50)\n .forEach { customer -> println(customer) }\n```\n\nWhen using the asynchronous client, the method returns a [`Flow`](https://kotlinlang.org/docs/flow.html):\n\n```kotlin\nimport com.lightspark.grid.models.customers.CustomerListPageAsync\n\nval page: CustomerListPageAsync = client.async().customers().list()\npage.autoPager()\n .take(50)\n .forEach { customer -> println(customer) }\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.lightspark.grid.models.customers.CustomerListPage\nimport com.lightspark.grid.models.customers.CustomerOneOf\n\nval page: CustomerListPage = client.customers().list()\nwhile (true) {\n for (customer in page.items()) {\n println(customer)\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 `LIGHTSPARK_GRID_LOG` environment variable to `info`:\n\n```sh\nexport LIGHTSPARK_GRID_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport LIGHTSPARK_GRID_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.LogLevel\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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 `lightspark-grid-kotlin-core` is published with a [configuration file](lightspark-grid-kotlin-core/src/main/resources/META-INF/proguard/lightspark-grid-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 [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) or [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.models.quotes.Quote\n\nval quote: Quote = client.quotes().create(\n params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()\n)\n```\n\nOr configure the default for all method calls at the client level:\n\n```kotlin\nimport com.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport java.time.Duration\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport java.net.InetSocketAddress\nimport java.net.Proxy\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport com.lightspark.grid.core.http.ProxyAuthenticator\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\nimport java.time.Duration\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `lightspark-grid-kotlin-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LightsparkGridClient`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClient.kt), [`LightsparkGridClientAsync`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsync.kt), [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt), and [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), all of which can work with any HTTP client\n- `lightspark-grid-kotlin-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) and [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.kt), which provide a way to construct [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt) and [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), respectively, using OkHttp\n- `lightspark-grid-kotlin`\n - Depends on and exposes the APIs of both `lightspark-grid-kotlin-core` and `lightspark-grid-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 [`lightspark-grid-kotlin` dependency](#installation) with `lightspark-grid-kotlin-core`\n2. Copy `lightspark-grid-kotlin-client-okhttp`\'s [`OkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt) or [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), similarly to [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) or [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`lightspark-grid-kotlin` dependency](#installation) with `lightspark-grid-kotlin-core`\n2. Write a class that implements the [`HttpClient`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/http/HttpClient.kt) interface\n3. Construct [`LightsparkGridClientImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientImpl.kt) or [`LightsparkGridClientAsyncImpl`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/client/LightsparkGridClientAsyncImpl.kt), similarly to [`LightsparkGridOkHttpClient`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClient.kt) or [`LightsparkGridOkHttpClientAsync`](lightspark-grid-kotlin-client-okhttp/src/main/kotlin/com/lightspark/grid/client/okhttp/LightsparkGridOkHttpClientAsync.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.lightspark.grid.core.JsonValue\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\n\nval params: QuoteCreateParams = QuoteCreateParams.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 a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt) object to its setter:\n\n```kotlin\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .quoteRequest(QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build())\n .build()\n```\n\nThe most straightforward way to create a [`JsonValue`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt) is using its `from(...)` method:\n\n```kotlin\nimport com.lightspark.grid.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`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/core/Values.kt):\n\n```kotlin\nimport com.lightspark.grid.core.JsonMissing\nimport com.lightspark.grid.models.quotes.QuoteCreateParams\nimport com.lightspark.grid.models.quotes.QuoteDestinationOneOf\nimport com.lightspark.grid.models.quotes.QuoteRequest\nimport com.lightspark.grid.models.quotes.QuoteSourceOneOf\n\nval params: QuoteCreateParams = QuoteCreateParams.builder()\n .quoteRequest(QuoteRequest.builder()\n .destination(QuoteDestinationOneOf.builder().build())\n .lockedCurrencyAmount(1000L)\n .lockedCurrencySide(QuoteRequest.LockedCurrencySide.SENDING)\n .source(QuoteSourceOneOf.builder().build())\n .build())\n .destination(JsonMissing.of())\n .build()\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```kotlin\nimport com.lightspark.grid.core.JsonBoolean\nimport com.lightspark.grid.core.JsonNull\nimport com.lightspark.grid.core.JsonNumber\nimport com.lightspark.grid.core.JsonValue\n\nval additionalProperties: Map = client.quotes().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.lightspark.grid.core.JsonField\n\nval field: JsonField = client.quotes().create(params)._field()\n\nif (field.isMissing()) {\n // The property is absent from the JSON response\n} else if (field.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? = field.asString();\n\n // Try to deserialize into a custom type\n val myObject: MyClass = field.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 [`LightsparkGridInvalidDataException`](lightspark-grid-kotlin-core/src/main/kotlin/com/lightspark/grid/errors/LightsparkGridInvalidDataException.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.lightspark.grid.models.quotes.Quote\n\nval quote: Quote = client.quotes().create(params).validate()\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```kotlin\nimport com.lightspark.grid.models.quotes.Quote\n\nval quote: Quote = client.quotes().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.lightspark.grid.client.LightsparkGridClient\nimport com.lightspark.grid.client.okhttp.LightsparkGridOkHttpClient\n\nval client: LightsparkGridClient = LightsparkGridOkHttpClient.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/lightsparkdev/grid-kotlin-sdk/issues) with questions, bugs, or suggestions.\n', }, { language: 'php', @@ -6708,7 +6172,7 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [ { language: 'python', content: - '# Lightspark Grid Python API library\n\n\n[![PyPI version](https://img.shields.io/pypi/v/grid.svg?label=pypi%20(stable))](https://pypi.org/project/grid/)\n\nThe Lightspark Grid Python library provides convenient access to the Lightspark Grid 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\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\n The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from this staging repo\npip install git+ssh://git@github.com/stainless-sdks/grid-python.git\n```\n> [!NOTE]\n> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install grid`\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\n\nquote = client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n)\nprint(quote.id)\n```\n\nWhile you can provide a `username` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `GRID_CLIENT_ID="My Username"` to your `.env` file\nso that your Username is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncLightsparkGrid` instead of `LightsparkGrid` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom grid import AsyncLightsparkGrid\n\nclient = AsyncLightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n quote = await client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n )\n print(quote.id)\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 this staging repo\npip install \'grid[aiohttp] @ git+ssh://git@github.com/stainless-sdks/grid-python.git\'\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom grid import DefaultAioHttpClient\nfrom grid import AsyncLightsparkGrid\n\nasync def main() -> None:\n async with AsyncLightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n quote = await client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n )\n print(quote.id)\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 Lightspark Grid 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 grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\nall_customers = []\n# Automatically fetches more pages as needed.\nfor customer in client.customers.list():\n # Do something with customer here\n all_customers.append(customer)\nprint(all_customers)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom grid import AsyncLightsparkGrid\n\nclient = AsyncLightsparkGrid()\n\nasync def main() -> None:\n all_customers = []\n # Iterate through items across all pages, issuing requests as needed.\n async for customer in client.customers.list():\n all_customers.append(customer)\n print(all_customers)\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.customers.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.customers.list()\n\nprint(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."\nfor customer in first_page.data:\n print(customer)\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 grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\nplatform_config = client.config.update(\n embedded_wallet_config={\n "app_name": "Acme Wallet",\n "logo_url": "https://acme.com/logo.png",\n "reply_to_email_address": "support@acme.com",\n "send_from_email_address": "noreply@acme.com",\n "send_from_email_sender_name": "Acme Notifications",\n },\n)\nprint(platform_config.embedded_wallet_config)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\nclient.customers.bulk.upload_csv(\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\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 `grid.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `grid.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `grid.APIError`.\n\n```python\nimport grid\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\ntry:\n client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n )\nexcept grid.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept grid.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept grid.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 grid import LightsparkGrid\n\n# Configure the default for all requests:\nclient = LightsparkGrid(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\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 grid import LightsparkGrid\n\n# Configure the default for all requests:\nclient = LightsparkGrid(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = LightsparkGrid(\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).quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\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 `LIGHTSPARK_GRID_LOG` to `info`.\n\n```shell\n$ export LIGHTSPARK_GRID_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 grid import LightsparkGrid\n\nclient = LightsparkGrid()\nresponse = client.quotes.with_raw_response.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nquote = response.parse() # get the object that `quotes.create()` would have returned\nprint(quote.id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/stainless-sdks/grid-python/tree/main/src/grid/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/grid-python/tree/main/src/grid/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\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\n```python\nwith client.quotes.with_streaming_response.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\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 grid import LightsparkGrid, DefaultHttpxClient\n\nclient = LightsparkGrid(\n # Or use the `LIGHTSPARK_GRID_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 grid import LightsparkGrid\n\nwith LightsparkGrid() 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/stainless-sdks/grid-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 grid\nprint(grid.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + '# Lightspark Grid Python API library\n\n\n[![PyPI version](https://img.shields.io/pypi/v/grid.svg?label=pypi%20(stable))](https://pypi.org/project/grid/)\n\nThe Lightspark Grid Python library provides convenient access to the Lightspark Grid 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\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\n The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from this staging repo\npip install git+ssh://git@github.com/stainless-sdks/grid-python.git\n```\n> [!NOTE]\n> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install grid`\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\n\nquote = client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n)\nprint(quote.id)\n```\n\nWhile you can provide a `username` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `GRID_CLIENT_ID="My Username"` to your `.env` file\nso that your Username is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncLightsparkGrid` instead of `LightsparkGrid` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom grid import AsyncLightsparkGrid\n\nclient = AsyncLightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n quote = await client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n )\n print(quote.id)\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 this staging repo\npip install \'grid[aiohttp] @ git+ssh://git@github.com/stainless-sdks/grid-python.git\'\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom grid import DefaultAioHttpClient\nfrom grid import AsyncLightsparkGrid\n\nasync def main() -> None:\n async with AsyncLightsparkGrid(\n username=os.environ.get("GRID_CLIENT_ID"), # This is the default and can be omitted\n password=os.environ.get("GRID_CLIENT_SECRET"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n quote = await client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n )\n print(quote.id)\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 Lightspark Grid 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 grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\nall_customers = []\n# Automatically fetches more pages as needed.\nfor customer in client.customers.list():\n # Do something with customer here\n all_customers.append(customer)\nprint(all_customers)\n```\n\nOr, asynchronously:\n\n```python\nimport asyncio\nfrom grid import AsyncLightsparkGrid\n\nclient = AsyncLightsparkGrid()\n\nasync def main() -> None:\n all_customers = []\n # Iterate through items across all pages, issuing requests as needed.\n async for customer in client.customers.list():\n all_customers.append(customer)\n print(all_customers)\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.customers.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.customers.list()\n\nprint(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."\nfor customer in first_page.data:\n print(customer)\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 grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\nplatform_config = client.config.update(\n embedded_wallet_config={},\n)\nprint(platform_config.embedded_wallet_config)\n```\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.\n\n```python\nfrom pathlib import Path\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\nclient.customers.bulk.upload_csv(\n file=Path("/path/to/file"),\n)\n```\n\nThe async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.\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 `grid.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `grid.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `grid.APIError`.\n\n```python\nimport grid\nfrom grid import LightsparkGrid\n\nclient = LightsparkGrid()\n\ntry:\n client.quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n )\nexcept grid.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept grid.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept grid.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 grid import LightsparkGrid\n\n# Configure the default for all requests:\nclient = LightsparkGrid(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\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 grid import LightsparkGrid\n\n# Configure the default for all requests:\nclient = LightsparkGrid(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = LightsparkGrid(\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).quotes.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\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 `LIGHTSPARK_GRID_LOG` to `info`.\n\n```shell\n$ export LIGHTSPARK_GRID_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 grid import LightsparkGrid\n\nclient = LightsparkGrid()\nresponse = client.quotes.with_raw_response.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nquote = response.parse() # get the object that `quotes.create()` would have returned\nprint(quote.id)\n```\n\nThese methods return an [`APIResponse`](https://github.com/stainless-sdks/grid-python/tree/main/src/grid/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/grid-python/tree/main/src/grid/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\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\n```python\nwith client.quotes.with_streaming_response.create(\n destination={\n "destinationType": "ACCOUNT",\n "accountId": "ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",\n },\n locked_currency_amount=10000,\n locked_currency_side="SENDING",\n source={\n "sourceType": "ACCOUNT",\n "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965",\n },\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 grid import LightsparkGrid, DefaultHttpxClient\n\nclient = LightsparkGrid(\n # Or use the `LIGHTSPARK_GRID_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 grid import LightsparkGrid\n\nwith LightsparkGrid() 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/stainless-sdks/grid-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 grid\nprint(grid.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', }, { language: 'ruby', @@ -6718,7 +6182,7 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [ { language: 'typescript', content: - "# Lightspark Grid TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@lightsparkdev/grid.svg?label=npm%20(stable))](https://npmjs.org/package/@lightsparkdev/grid) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@lightsparkdev/grid) [![JSR Version](https://jsr.io/badges/@lightsparkdev/grid)](https://jsr.io/@lightsparkdev/grid)\n\nThis library provides convenient access to the Lightspark Grid REST API from server-side TypeScript or JavaScript.\n\n\n\nThe full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%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 @lightsparkdev/grid\n```\n\n### Installation from JSR\n\n```sh\ndeno add jsr:@lightsparkdev/grid\nnpx jsr add @lightsparkdev/grid\n```\n\nThese commands will make the module importable from the `@lightsparkdev/grid` scope:\n\nYou can also [import directly from JSR](https://jsr.io/docs/using-packages#importing-with-jsr-specifiers) without an install step if you're using the Deno JavaScript runtime:\n\n```ts\nimport LightsparkGrid from 'jsr:@lightsparkdev/grid';\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst quote = await client.quotes.create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n});\n\nconsole.log(quote.id);\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 LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst params: LightsparkGrid.QuoteCreateParams = {\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n};\nconst quote: LightsparkGrid.Quote = await client.quotes.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## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport LightsparkGrid, { toFile } from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.customers.bulk.uploadCsv({ file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.customers.bulk.uploadCsv({ file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.customers.bulk.uploadCsv({ file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.customers.bulk.uploadCsv({ file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.customers.bulk.uploadCsv({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });\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 quote = await client.quotes\n .create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n })\n .catch(async (err) => {\n if (err instanceof LightsparkGrid.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\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 LightsparkGrid({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.quotes.create({\n destination: { destinationType: 'ACCOUNT', accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n}, {\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 LightsparkGrid({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.quotes.create({\n destination: { destinationType: 'ACCOUNT', accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n}, {\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 LightsparkGrid API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllCustomerListResponses(params) {\n const allCustomerListResponses = [];\n // Automatically fetches more pages as needed.\n for await (const customerListResponse of client.customers.list()) {\n allCustomerListResponses.push(customerListResponse);\n }\n return allCustomerListResponses;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.customers.list();\nfor (const customerListResponse of page.data) {\n console.log(customerListResponse);\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 LightsparkGrid();\n\nconst response = await client.quotes\n .create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: quote, response: raw } = await client.quotes\n .create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(quote.id);\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 `LIGHTSPARK_GRID_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\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 LightsparkGrid from '@lightsparkdev/grid';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new LightsparkGrid({\n logger: logger.child({ name: 'LightsparkGrid' }),\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.quotes.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 LightsparkGrid from '@lightsparkdev/grid';\nimport fetch from 'my-fetch';\n\nconst client = new LightsparkGrid({ 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 LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\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 LightsparkGrid from '@lightsparkdev/grid';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new LightsparkGrid({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n **Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\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 LightsparkGrid from 'jsr:@lightsparkdev/grid';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new LightsparkGrid({\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/lightsparkdev/grid-js-sdk/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", + "# Lightspark Grid TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/@lightsparkdev/grid.svg?label=npm%20(stable))](https://npmjs.org/package/@lightsparkdev/grid) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@lightsparkdev/grid) [![JSR Version](https://jsr.io/badges/@lightsparkdev/grid)](https://jsr.io/@lightsparkdev/grid)\n\nThis library provides convenient access to the Lightspark Grid REST API from server-side TypeScript or JavaScript.\n\n\n\nThe full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Lightspark Grid 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=%40lightsparkdev%2Fgrid-mcp&config=eyJuYW1lIjoiQGxpZ2h0c3BhcmtkZXYvZ3JpZC1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9ncmlkLW1jcC5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWdyaWQtY2xpZW50LWlkIjoiTXkgVXNlcm5hbWUiLCJ4LWdyaWQtY2xpZW50LXNlY3JldCI6Ik15IFBhc3N3b3JkIiwieC1ncmlkLWFnZW50LWFjY2Vzcy10b2tlbiI6Ik15IEFnZW50IEFjY2VzcyBUb2tlbiIsIlgtR3JpZC1TaWduYXR1cmUiOiJNeSBXZWJob29rIFNpZ25hdHVyZSJ9fQ)\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%22%40lightsparkdev%2Fgrid-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgrid-mcp.stlmcp.com%22%2C%22headers%22%3A%7B%22x-grid-client-id%22%3A%22My%20Username%22%2C%22x-grid-client-secret%22%3A%22My%20Password%22%2C%22x-grid-agent-access-token%22%3A%22My%20Agent%20Access%20Token%22%2C%22X-Grid-Signature%22%3A%22My%20Webhook%20Signature%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 @lightsparkdev/grid\n```\n\n### Installation from JSR\n\n```sh\ndeno add jsr:@lightsparkdev/grid\nnpx jsr add @lightsparkdev/grid\n```\n\nThese commands will make the module importable from the `@lightsparkdev/grid` scope:\n\nYou can also [import directly from JSR](https://jsr.io/docs/using-packages#importing-with-jsr-specifiers) without an install step if you're using the Deno JavaScript runtime:\n\n```ts\nimport LightsparkGrid from 'jsr:@lightsparkdev/grid';\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst quote = await client.quotes.create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n});\n\nconsole.log(quote.id);\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 LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\n username: process.env['GRID_CLIENT_ID'], // This is the default and can be omitted\n password: process.env['GRID_CLIENT_SECRET'], // This is the default and can be omitted\n});\n\nconst params: LightsparkGrid.QuoteCreateParams = {\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n};\nconst quote: LightsparkGrid.Quote = await client.quotes.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## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport LightsparkGrid, { toFile } from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.customers.bulk.uploadCsv({ file: fs.createReadStream('/path/to/file') });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.customers.bulk.uploadCsv({ file: new File(['my bytes'], 'file') });\n\n// You can also pass a `fetch` `Response`:\nawait client.customers.bulk.uploadCsv({ file: await fetch('https://somesite/file') });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.customers.bulk.uploadCsv({ file: await toFile(Buffer.from('my bytes'), 'file') });\nawait client.customers.bulk.uploadCsv({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });\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 quote = await client.quotes\n .create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n })\n .catch(async (err) => {\n if (err instanceof LightsparkGrid.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\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 LightsparkGrid({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.quotes.create({\n destination: { destinationType: 'ACCOUNT', accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n}, {\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 LightsparkGrid({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.quotes.create({\n destination: { destinationType: 'ACCOUNT', accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' },\n}, {\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 LightsparkGrid API are paginated.\nYou can use the `for await … of` syntax to iterate through items across all pages:\n\n```ts\nasync function fetchAllCustomerOneoves(params) {\n const allCustomerOneoves = [];\n // Automatically fetches more pages as needed.\n for await (const customerOneOf of client.customers.list()) {\n allCustomerOneoves.push(customerOneOf);\n }\n return allCustomerOneoves;\n}\n```\n\nAlternatively, you can request a single page at a time:\n\n```ts\nlet page = await client.customers.list();\nfor (const customerOneOf of page.data) {\n console.log(customerOneOf);\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 LightsparkGrid();\n\nconst response = await client.quotes\n .create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: quote, response: raw } = await client.quotes\n .create({\n destination: {\n destinationType: 'ACCOUNT',\n accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123',\n },\n lockedCurrencyAmount: 10000,\n lockedCurrencySide: 'SENDING',\n source: {\n sourceType: 'ACCOUNT',\n accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965',\n },\n })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(quote.id);\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 `LIGHTSPARK_GRID_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\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 LightsparkGrid from '@lightsparkdev/grid';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new LightsparkGrid({\n logger: logger.child({ name: 'LightsparkGrid' }),\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.quotes.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 LightsparkGrid from '@lightsparkdev/grid';\nimport fetch from 'my-fetch';\n\nconst client = new LightsparkGrid({ 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 LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\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 LightsparkGrid from '@lightsparkdev/grid';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new LightsparkGrid({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n **Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport LightsparkGrid from '@lightsparkdev/grid';\n\nconst client = new LightsparkGrid({\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 LightsparkGrid from 'jsr:@lightsparkdev/grid';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new LightsparkGrid({\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/lightsparkdev/grid-js-sdk/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", }, ]; diff --git a/packages/mcp-server/src/methods.ts b/packages/mcp-server/src/methods.ts index f8f19771..669f37b1 100644 --- a/packages/mcp-server/src/methods.ts +++ b/packages/mcp-server/src/methods.ts @@ -53,16 +53,16 @@ export const sdkMethods: SdkMethod[] = [ httpPath: '/customers/{customerId}', }, { - clientCallName: 'client.customers.export', - fullyQualifiedName: 'customers.export', + clientCallName: 'client.customers.createKYCLink', + fullyQualifiedName: 'customers.createKYCLink', httpMethod: 'post', - httpPath: '/internal-accounts/{id}/export', + httpPath: '/customers/{customerId}/kyc-link', }, { - clientCallName: 'client.customers.generateKYCLink', - fullyQualifiedName: 'customers.generateKYCLink', + clientCallName: 'client.customers.export', + fullyQualifiedName: 'customers.export', httpMethod: 'post', - httpPath: '/customers/{customerId}/kyc-link', + httpPath: '/internal-accounts/{id}/export', }, { clientCallName: 'client.customers.listInternalAccounts', diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 69485611..618dd961 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -28,7 +28,7 @@ export const newMcpServer = async ({ new McpServer( { name: 'lightsparkdev_grid_api', - version: '1.8.0', + version: '1.9.0', }, { instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }), diff --git a/src/client.ts b/src/client.ts index 2e92462a..1bbced7d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -21,21 +21,25 @@ import * as API from './resources/index'; import { APIPromise } from './core/api-promise'; import { BeneficialOwnerCreateParams, + BeneficialOwnerCreateRequest, BeneficialOwnerListParams, + BeneficialOwnerListResponse, BeneficialOwnerPersonalInfo, BeneficialOwnerUpdateParams, + BeneficialOwnerUpdateRequest, BeneficialOwners, } from './resources/beneficial-owners'; import { + Card, + CardCreateRequest, CardIssueParams, - CardIssueResponse, CardListParams, CardListResponse, - CardListResponsesDefaultPagination, - CardRetrieveResponse, + CardTransaction, CardUpdateParams, - CardUpdateResponse, + CardUpdateRequest, Cards, + CardsDefaultPagination, } from './resources/cards'; import { Config, @@ -43,32 +47,39 @@ import { CustomerInfoFieldName, EmbeddedWalletConfig, PlatformConfig, + PlatformConfigUpdateRequest, PlatformCurrencyConfig, } from './resources/config'; import { Crypto, CryptoEstimateWithdrawalFeeParams, - CryptoEstimateWithdrawalFeeResponse, + EstimateCryptoWithdrawalFeeRequest, + EstimateCryptoWithdrawalFeeResponse, } from './resources/crypto'; import { Discoveries, DiscoveryListParams, DiscoveryListResponse } from './resources/discoveries'; import { + Document, DocumentListParams, DocumentListResponse, - DocumentListResponsesDefaultPagination, DocumentReplaceParams, - DocumentReplaceResponse, - DocumentRetrieveResponse, DocumentUploadParams, - DocumentUploadResponse, Documents, + DocumentsDefaultPagination, } from './resources/documents'; -import { ExchangeRateListParams, ExchangeRateListResponse, ExchangeRates } from './resources/exchange-rates'; +import { + ExchangeRate, + ExchangeRateListParams, + ExchangeRateListResponse, + ExchangeRates, +} from './resources/exchange-rates'; import { CurrencyAmount, InvitationClaimParams, InvitationCreateParams, Invitations, UmaInvitation, + UmaInvitationClaimRequest, + UmaInvitationCreateRequest, } from './resources/invitations'; import { BaseDestination, @@ -80,24 +91,27 @@ import { QuoteCreateParams, QuoteDestinationOneOf, QuoteExecuteParams, + QuoteRequest, QuoteSourceOneOf, Quotes, } from './resources/quotes'; import { CounterpartyFieldDefinition, + ExternalAccountLookupResponse, LookupResponse, Receiver, ReceiverLookupExternalAccountParams, - ReceiverLookupExternalAccountResponse, ReceiverLookupUmaParams, - ReceiverLookupUmaResponse, + UmaLookupResponse, } from './resources/receiver'; import { APIToken, + APITokenCreateRequest, APITokensDefaultPagination, Permission, TokenCreateParams, TokenListParams, + TokenListResponse, Tokens, } from './resources/tokens'; import { @@ -109,6 +123,7 @@ import { ReconciliationInstructions, TransactionApproveParams, TransactionListParams, + TransactionListResponse, TransactionRejectParams, TransactionSourceOneOf, TransactionStatus, @@ -122,22 +137,24 @@ import { Transaction, TransferIn, TransferInCreateParams, + TransferInRequest, } from './resources/transfer-in'; -import { TransferOut, TransferOutCreateParams } from './resources/transfer-out'; +import { TransferOut, TransferOutCreateParams, TransferOutRequest } from './resources/transfer-out'; import { + UmaProvider, UmaProviderListParams, UmaProviderListResponse, - UmaProviderListResponsesDefaultPagination, UmaProviders, + UmaProvidersDefaultPagination, } from './resources/uma-providers'; import { + Verification, VerificationListParams, VerificationListResponse, - VerificationListResponsesDefaultPagination, - VerificationRetrieveResponse, + VerificationRequest, VerificationSubmitParams, - VerificationSubmitResponse, Verifications, + VerificationsDefaultPagination, } from './resources/verifications'; import { AgentActionWebhookEvent, @@ -149,7 +166,6 @@ import { InternalAccountStatusWebhookEvent, InvitationClaimedWebhookEvent, OutgoingPaymentWebhookEvent, - TestWebhookWebhookEvent, UnwrapWebhookEvent, VerificationUpdateWebhookEvent, Webhooks, @@ -173,6 +189,7 @@ import { AgentListParams, AgentListResponse, AgentPolicy, + AgentPolicyUpdateRequest, AgentUpdateParams, AgentUpdatePolicyParams, AgentUpdateRequest, @@ -182,29 +199,37 @@ import { } from './resources/agents/agents'; import { Auth } from './resources/auth/auth'; import { + BusinessCustomerCreateRequest, + BusinessCustomerUpdateRequest, + Customer, + CustomerCreateKYCLinkParams, CustomerCreateParams, - CustomerCreateResponse, - CustomerDeleteResponse, + CustomerCreateRequestOneOf, CustomerExportParams, - CustomerExportResponse, - CustomerGenerateKYCLinkParams, - CustomerGenerateKYCLinkResponse, CustomerListInternalAccountsParams, CustomerListParams, CustomerListResponse, - CustomerListResponsesDefaultPagination, - CustomerRetrieveResponse, + CustomerOneOf, + CustomerOneovesDefaultPagination, CustomerUpdateInternalAccountParams, CustomerUpdateParams, - CustomerUpdateResponse, + CustomerUpdateRequestOneOf, Customers, + IndividualCustomerCreateRequest, + IndividualCustomerUpdateRequest, + InternalAccountExportRequest, + InternalAccountExportResponse, + InternalAccountListResponse, + InternalAccountUpdateRequest, + KYCLinkCreateRequest, + KYCLinkResponse, } from './resources/customers/customers'; import { Platform, + PlatformInternalAccountListResponse, PlatformListInternalAccountsParams, - PlatformListInternalAccountsResponse, } from './resources/platform/platform'; -import { Sandbox, SandboxSendFundsParams } from './resources/sandbox/sandbox'; +import { Sandbox, SandboxSendFundsParams, SendRequest } from './resources/sandbox/sandbox'; import { type Fetch } from './internal/builtin-types'; import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers'; import { FinalRequestOptions, RequestOptions } from './internal/request-options'; @@ -972,11 +997,19 @@ export class LightsparkGrid { 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]); @@ -1151,32 +1184,41 @@ export declare namespace LightsparkGrid { type CustomerInfoFieldName as CustomerInfoFieldName, type EmbeddedWalletConfig as EmbeddedWalletConfig, type PlatformConfig as PlatformConfig, + type PlatformConfigUpdateRequest as PlatformConfigUpdateRequest, type PlatformCurrencyConfig as PlatformCurrencyConfig, type ConfigUpdateParams as ConfigUpdateParams, }; export { Customers as Customers, - type CustomerCreateResponse as CustomerCreateResponse, - type CustomerRetrieveResponse as CustomerRetrieveResponse, - type CustomerUpdateResponse as CustomerUpdateResponse, + type BusinessCustomerCreateRequest as BusinessCustomerCreateRequest, + type BusinessCustomerUpdateRequest as BusinessCustomerUpdateRequest, + type Customer as Customer, + type CustomerCreateRequestOneOf as CustomerCreateRequestOneOf, type CustomerListResponse as CustomerListResponse, - type CustomerDeleteResponse as CustomerDeleteResponse, - type CustomerExportResponse as CustomerExportResponse, - type CustomerGenerateKYCLinkResponse as CustomerGenerateKYCLinkResponse, - type CustomerListResponsesDefaultPagination as CustomerListResponsesDefaultPagination, + type CustomerOneOf as CustomerOneOf, + type CustomerUpdateRequestOneOf as CustomerUpdateRequestOneOf, + type IndividualCustomerCreateRequest as IndividualCustomerCreateRequest, + type IndividualCustomerUpdateRequest as IndividualCustomerUpdateRequest, + type InternalAccountExportRequest as InternalAccountExportRequest, + type InternalAccountExportResponse as InternalAccountExportResponse, + type InternalAccountListResponse as InternalAccountListResponse, + type InternalAccountUpdateRequest as InternalAccountUpdateRequest, + type KYCLinkCreateRequest as KYCLinkCreateRequest, + type KYCLinkResponse as KYCLinkResponse, + type CustomerOneovesDefaultPagination as CustomerOneovesDefaultPagination, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, + type CustomerCreateKYCLinkParams as CustomerCreateKYCLinkParams, type CustomerExportParams as CustomerExportParams, - type CustomerGenerateKYCLinkParams as CustomerGenerateKYCLinkParams, type CustomerListInternalAccountsParams as CustomerListInternalAccountsParams, type CustomerUpdateInternalAccountParams as CustomerUpdateInternalAccountParams, }; export { Platform as Platform, - type PlatformListInternalAccountsResponse as PlatformListInternalAccountsResponse, + type PlatformInternalAccountListResponse as PlatformInternalAccountListResponse, type PlatformListInternalAccountsParams as PlatformListInternalAccountsParams, }; @@ -1186,17 +1228,22 @@ export declare namespace LightsparkGrid { type ExternalAccountReference as ExternalAccountReference, type InternalAccountReference as InternalAccountReference, type Transaction as Transaction, + type TransferInRequest as TransferInRequest, type TransferInCreateParams as TransferInCreateParams, }; - export { TransferOut as TransferOut, type TransferOutCreateParams as TransferOutCreateParams }; + export { + TransferOut as TransferOut, + type TransferOutRequest as TransferOutRequest, + type TransferOutCreateParams as TransferOutCreateParams, + }; export { Receiver as Receiver, type CounterpartyFieldDefinition as CounterpartyFieldDefinition, + type ExternalAccountLookupResponse as ExternalAccountLookupResponse, type LookupResponse as LookupResponse, - type ReceiverLookupExternalAccountResponse as ReceiverLookupExternalAccountResponse, - type ReceiverLookupUmaResponse as ReceiverLookupUmaResponse, + type UmaLookupResponse as UmaLookupResponse, type ReceiverLookupExternalAccountParams as ReceiverLookupExternalAccountParams, type ReceiverLookupUmaParams as ReceiverLookupUmaParams, }; @@ -1210,6 +1257,7 @@ export declare namespace LightsparkGrid { type PaymentInstructions as PaymentInstructions, type Quote as Quote, type QuoteDestinationOneOf as QuoteDestinationOneOf, + type QuoteRequest as QuoteRequest, type QuoteSourceOneOf as QuoteSourceOneOf, type QuoteCreateParams as QuoteCreateParams, type QuoteExecuteParams as QuoteExecuteParams, @@ -1223,6 +1271,7 @@ export declare namespace LightsparkGrid { type OutgoingTransaction as OutgoingTransaction, type OutgoingTransactionStatus as OutgoingTransactionStatus, type ReconciliationInstructions as ReconciliationInstructions, + type TransactionListResponse as TransactionListResponse, type TransactionSourceOneOf as TransactionSourceOneOf, type TransactionStatus as TransactionStatus, type TransactionType as TransactionType, @@ -1235,23 +1284,32 @@ export declare namespace LightsparkGrid { Invitations as Invitations, type CurrencyAmount as CurrencyAmount, type UmaInvitation as UmaInvitation, + type UmaInvitationClaimRequest as UmaInvitationClaimRequest, + type UmaInvitationCreateRequest as UmaInvitationCreateRequest, type InvitationCreateParams as InvitationCreateParams, type InvitationClaimParams as InvitationClaimParams, }; - export { Sandbox as Sandbox, type SandboxSendFundsParams as SandboxSendFundsParams }; + export { + Sandbox as Sandbox, + type SendRequest as SendRequest, + type SandboxSendFundsParams as SandboxSendFundsParams, + }; export { UmaProviders as UmaProviders, + type UmaProvider as UmaProvider, type UmaProviderListResponse as UmaProviderListResponse, - type UmaProviderListResponsesDefaultPagination as UmaProviderListResponsesDefaultPagination, + type UmaProvidersDefaultPagination as UmaProvidersDefaultPagination, type UmaProviderListParams as UmaProviderListParams, }; export { Tokens as Tokens, type APIToken as APIToken, + type APITokenCreateRequest as APITokenCreateRequest, type Permission as Permission, + type TokenListResponse as TokenListResponse, type APITokensDefaultPagination as APITokensDefaultPagination, type TokenCreateParams as TokenCreateParams, type TokenListParams as TokenListParams, @@ -1259,6 +1317,7 @@ export declare namespace LightsparkGrid { export { ExchangeRates as ExchangeRates, + type ExchangeRate as ExchangeRate, type ExchangeRateListResponse as ExchangeRateListResponse, type ExchangeRateListParams as ExchangeRateListParams, }; @@ -1268,7 +1327,6 @@ export declare namespace LightsparkGrid { type AgentActionWebhookEvent as AgentActionWebhookEvent, type IncomingPaymentWebhookEvent as IncomingPaymentWebhookEvent, type OutgoingPaymentWebhookEvent as OutgoingPaymentWebhookEvent, - type TestWebhookWebhookEvent as TestWebhookWebhookEvent, type BulkUploadWebhookEvent as BulkUploadWebhookEvent, type InvitationClaimedWebhookEvent as InvitationClaimedWebhookEvent, type CustomerUpdateWebhookEvent as CustomerUpdateWebhookEvent, @@ -1281,13 +1339,17 @@ export declare namespace LightsparkGrid { export { Crypto as Crypto, - type CryptoEstimateWithdrawalFeeResponse as CryptoEstimateWithdrawalFeeResponse, + type EstimateCryptoWithdrawalFeeRequest as EstimateCryptoWithdrawalFeeRequest, + type EstimateCryptoWithdrawalFeeResponse as EstimateCryptoWithdrawalFeeResponse, type CryptoEstimateWithdrawalFeeParams as CryptoEstimateWithdrawalFeeParams, }; export { BeneficialOwners as BeneficialOwners, + type BeneficialOwnerCreateRequest as BeneficialOwnerCreateRequest, + type BeneficialOwnerListResponse as BeneficialOwnerListResponse, type BeneficialOwnerPersonalInfo as BeneficialOwnerPersonalInfo, + type BeneficialOwnerUpdateRequest as BeneficialOwnerUpdateRequest, type BeneficialOwnerCreateParams as BeneficialOwnerCreateParams, type BeneficialOwnerUpdateParams as BeneficialOwnerUpdateParams, type BeneficialOwnerListParams as BeneficialOwnerListParams, @@ -1295,11 +1357,9 @@ export declare namespace LightsparkGrid { export { Documents as Documents, - type DocumentRetrieveResponse as DocumentRetrieveResponse, + type Document as Document, type DocumentListResponse as DocumentListResponse, - type DocumentReplaceResponse as DocumentReplaceResponse, - type DocumentUploadResponse as DocumentUploadResponse, - type DocumentListResponsesDefaultPagination as DocumentListResponsesDefaultPagination, + type DocumentsDefaultPagination as DocumentsDefaultPagination, type DocumentListParams as DocumentListParams, type DocumentReplaceParams as DocumentReplaceParams, type DocumentUploadParams as DocumentUploadParams, @@ -1307,10 +1367,10 @@ export declare namespace LightsparkGrid { export { Verifications as Verifications, - type VerificationRetrieveResponse as VerificationRetrieveResponse, + type Verification as Verification, type VerificationListResponse as VerificationListResponse, - type VerificationSubmitResponse as VerificationSubmitResponse, - type VerificationListResponsesDefaultPagination as VerificationListResponsesDefaultPagination, + type VerificationRequest as VerificationRequest, + type VerificationsDefaultPagination as VerificationsDefaultPagination, type VerificationListParams as VerificationListParams, type VerificationSubmitParams as VerificationSubmitParams, }; @@ -1339,6 +1399,7 @@ export declare namespace LightsparkGrid { type AgentDeviceCodeStatusResponse as AgentDeviceCodeStatusResponse, type AgentListResponse as AgentListResponse, type AgentPolicy as AgentPolicy, + type AgentPolicyUpdateRequest as AgentPolicyUpdateRequest, type AgentUpdateRequest as AgentUpdateRequest, type AgentUsage as AgentUsage, type AgentsDefaultPagination as AgentsDefaultPagination, @@ -1352,11 +1413,12 @@ export declare namespace LightsparkGrid { export { Cards as Cards, - type CardRetrieveResponse as CardRetrieveResponse, - type CardUpdateResponse as CardUpdateResponse, + type Card as Card, + type CardCreateRequest as CardCreateRequest, type CardListResponse as CardListResponse, - type CardIssueResponse as CardIssueResponse, - type CardListResponsesDefaultPagination as CardListResponsesDefaultPagination, + type CardTransaction as CardTransaction, + type CardUpdateRequest as CardUpdateRequest, + type CardsDefaultPagination as CardsDefaultPagination, type CardUpdateParams as CardUpdateParams, type CardListParams as CardListParams, type CardIssueParams as CardIssueParams, @@ -1371,7 +1433,6 @@ export declare namespace LightsparkGrid { export type BrlExternalAccountCreateInfo = API.BrlExternalAccountCreateInfo; export type BulkCustomerImportErrorEntry = API.BulkCustomerImportErrorEntry; export type BusinessCustomer = API.BusinessCustomer; - export type BusinessInfoUpdate = API.BusinessInfoUpdate; export type BwpBeneficiary = API.BwpBeneficiary; export type BwpExternalAccountCreateInfo = API.BwpExternalAccountCreateInfo; export type CadBeneficiary = API.CadBeneficiary; diff --git a/src/resources/agents/agents.ts b/src/resources/agents/agents.ts index 6c9f4f44..a29e0d11 100644 --- a/src/resources/agents/agents.ts +++ b/src/resources/agents/agents.ts @@ -602,6 +602,81 @@ export namespace AgentPolicy { } } +/** + * Partial update to an agent's policy. Only provided fields will be updated; + * omitted fields retain their current values. + */ +export interface AgentPolicyUpdateRequest { + /** + * Optional restrictions that limit the agent to specific accounts or override + * policy per account. + */ + accountRestrictions?: AgentAccountRestrictions; + + /** + * Thresholds that force approval for high-value transactions, overriding the + * default execution mode. When a transaction is denominated in a different + * currency than the threshold, Grid converts using the exchange rate at evaluation + * time. + */ + approvalThresholds?: AgentApprovalThresholds; + + /** + * Execution mode controlling whether agent actions require human approval. AUTO: + * The agent can execute actions autonomously without explicit approval. + * APPROVAL_REQUIRED: All agent actions require explicit human approval before + * execution. + */ + defaultExecutionMode?: 'AUTO' | 'APPROVAL_REQUIRED'; + + /** + * Updated list of permissions. Replaces the entire permissions list when provided. + */ + permissions?: Array< + 'VIEW_TRANSACTIONS' | 'CREATE_TRANSFERS' | 'CREATE_QUOTES' | 'EXECUTE_QUOTES' | 'MANAGE_EXTERNAL_ACCOUNTS' + >; + + /** + * Partial update to spending limits. Only provided fields will be updated; omitted + * fields retain their current values. + */ + spendingLimits?: AgentPolicyUpdateRequest.SpendingLimits; +} + +export namespace AgentPolicyUpdateRequest { + /** + * Partial update to spending limits. Only provided fields will be updated; omitted + * fields retain their current values. + */ + export interface SpendingLimits { + /** + * ISO 4217 currency code that all amount limits are denominated in. Updating this + * recasts all existing limits into the new currency denomination. + */ + currency?: string; + + /** + * Maximum daily spend. Set to null to remove the daily limit. + */ + dailyLimit?: number | null; + + /** + * Maximum number of transactions per day. + */ + dailyTransactionLimit?: number; + + /** + * Maximum monthly spend. Set to null to remove the monthly limit. + */ + monthlyLimit?: number | null; + + /** + * Maximum amount per transaction. + */ + perTransactionLimit?: number; + } +} + /** * Partial update to an agent's basic fields. At least one field must be provided. */ @@ -846,6 +921,7 @@ export declare namespace Agents { type AgentDeviceCodeStatusResponse as AgentDeviceCodeStatusResponse, type AgentListResponse as AgentListResponse, type AgentPolicy as AgentPolicy, + type AgentPolicyUpdateRequest as AgentPolicyUpdateRequest, type AgentUpdateRequest as AgentUpdateRequest, type AgentUsage as AgentUsage, type AgentsDefaultPagination as AgentsDefaultPagination, diff --git a/src/resources/agents/index.ts b/src/resources/agents/index.ts index b8ffaa20..9d07b963 100644 --- a/src/resources/agents/index.ts +++ b/src/resources/agents/index.ts @@ -17,6 +17,7 @@ export { type AgentDeviceCodeStatusResponse, type AgentListResponse, type AgentPolicy, + type AgentPolicyUpdateRequest, type AgentUpdateRequest, type AgentUsage, type AgentCreateParams, diff --git a/src/resources/agents/me/external-accounts.ts b/src/resources/agents/me/external-accounts.ts index f639f47c..9e969588 100644 --- a/src/resources/agents/me/external-accounts.ts +++ b/src/resources/agents/me/external-accounts.ts @@ -140,8 +140,8 @@ export interface ExternalAccountAddParams { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ accountInfo: | Shared.AedExternalAccountCreateInfo @@ -149,6 +149,7 @@ export interface ExternalAccountAddParams { | Shared.BrlExternalAccountCreateInfo | Shared.BwpExternalAccountCreateInfo | Shared.CadExternalAccountCreateInfo + | ExternalAccountAddParams.CnyAccount | Shared.CopExternalAccountCreateInfo | Shared.DkkExternalAccountCreateInfo | Shared.EgpExternalAccountCreateInfo @@ -212,6 +213,73 @@ export interface ExternalAccountAddParams { platformAccountId?: string; } +export namespace ExternalAccountAddParams { + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + beneficiary: CnyAccount.IndividualBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + + export namespace CnyAccount { + export interface IndividualBeneficiary { + beneficiaryType: 'INDIVIDUAL'; + + /** + * The full name of the beneficiary + */ + fullName: string; + + address?: ExternalAccountsAPI.Address; + + /** + * The birth date of the beneficiary + */ + birthDate?: string; + + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + + /** + * The email of the beneficiary + */ + email?: string; + + /** + * The nationality of the beneficiary + */ + nationality?: string; + + /** + * The phone number of the beneficiary + */ + phoneNumber?: string; + } + } +} + export declare namespace ExternalAccounts { export { type ExternalAccountListParams as ExternalAccountListParams, diff --git a/src/resources/agents/me/me.ts b/src/resources/agents/me/me.ts index 1799642d..37f3b5ff 100644 --- a/src/resources/agents/me/me.ts +++ b/src/resources/agents/me/me.ts @@ -181,7 +181,7 @@ export interface MeCreateTransferOutParams { /** * Body param: Destination external account details */ - destination: TransferInAPI.ExternalAccountReference; + destination: MeCreateTransferOutParams.Destination; /** * Body param: Source internal account details @@ -194,6 +194,15 @@ export interface MeCreateTransferOutParams { */ amount?: number; + /** + * Body param: Free-form information about the payment that travels with it to the + * recipient. The field this populates depends on the payment rail: for ACH it + * populates the Addenda record, for FedNow and RTP it populates the + * remittanceInformation field, and for wires it populates the OBI (Originator to + * Beneficiary Information) / beneficiary information. + */ + remittanceInformation?: string; + /** * Header param: A unique identifier for the request. If the same key is sent * multiple times, the server will return the same response as the first request. @@ -201,6 +210,48 @@ export interface MeCreateTransferOutParams { 'Idempotency-Key'?: string; } +export namespace MeCreateTransferOutParams { + /** + * Destination external account details + */ + export interface Destination { + /** + * Reference to an external account ID + */ + accountId: string; + + /** + * The payment rail to use for the transfer. Must be one of the rails supported by + * the destination account. If not specified, the system will select a default + * rail. + */ + paymentRail?: + | 'ACH' + | 'ACH_COLOMBIA' + | 'BANK_TRANSFER' + | 'BRE_B' + | 'CIPS' + | 'FAST' + | 'FASTER_PAYMENTS' + | 'FEDNOW' + | 'INSTAPAY' + | 'MOBILE_MONEY' + | 'NEFT' + | 'PAYNOW' + | 'PESONET' + | 'PIX' + | 'RTGS' + | 'RTP' + | 'SEPA' + | 'SEPA_INSTANT' + | 'SPEI' + | 'SWIFT' + | 'UNIONPAY' + | 'UPI' + | 'WIRE'; + } +} + export interface MeListInternalAccountsParams extends DefaultPaginationParams { /** * Filter by currency code diff --git a/src/resources/agents/me/quotes.ts b/src/resources/agents/me/quotes.ts index 4aef51ad..b829256b 100644 --- a/src/resources/agents/me/quotes.ts +++ b/src/resources/agents/me/quotes.ts @@ -168,8 +168,19 @@ export interface QuoteCreateParams { | 'UTILITY_BILL' | 'DONATION' | 'TRAVEL' + | 'FAMILY_SUPPORT' + | 'SALARY_PAYMENT' | 'OTHER'; + /** + * Body param: Free-form information about the payment that travels with it to the + * recipient. The field this populates depends on the payment rail: for ACH it + * populates the Addenda record, for FedNow and RTP it populates the + * remittanceInformation field, and for wires it populates the OBI (Originator to + * Beneficiary Information) / beneficiary information. + */ + remittanceInformation?: string; + /** * Body param: Key-value pairs of additional information about the sender which was * requested by the destination. This is relevant when the destination requires @@ -191,7 +202,7 @@ export interface QuoteCreateParams { export interface QuoteExecuteParams { /** - * Full Turnkey API-key stamp over the `payloadToSign` returned in the quote's + * Full Grid wallet signature over the `payloadToSign` returned in the quote's * `paymentInstructions[].accountOrWalletInfo` entry, produced with the session * private key of a verified authentication credential on the source Embedded * Wallet. Required when the quote's source is an internal account of type diff --git a/src/resources/auth/auth.ts b/src/resources/auth/auth.ts index b39a2ef0..56ffdaaa 100644 --- a/src/resources/auth/auth.ts +++ b/src/resources/auth/auth.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../core/resource'; import * as CredentialsAPI from './credentials'; import { + AuthCredentialChallengeRequest, AuthCredentialCreateRequest, AuthCredentialCreateRequestOneOf, AuthCredentialListResponse, @@ -33,6 +34,7 @@ import { } from './credentials'; import * as SessionsAPI from './sessions'; import { + AuthSessionRefreshRequest, SessionDeleteParams, SessionListParams, SessionListResponse, @@ -51,6 +53,7 @@ Auth.Sessions = Sessions; export declare namespace Auth { export { Credentials as Credentials, + type AuthCredentialChallengeRequest as AuthCredentialChallengeRequest, type AuthCredentialCreateRequest as AuthCredentialCreateRequest, type AuthCredentialCreateRequestOneOf as AuthCredentialCreateRequestOneOf, type AuthCredentialListResponse as AuthCredentialListResponse, @@ -81,6 +84,7 @@ export declare namespace Auth { export { Sessions as Sessions, + type AuthSessionRefreshRequest as AuthSessionRefreshRequest, type SessionListResponse as SessionListResponse, type SessionListParams as SessionListParams, type SessionDeleteParams as SessionDeleteParams, diff --git a/src/resources/auth/credentials.ts b/src/resources/auth/credentials.ts index 55533fb7..4b134ca0 100644 --- a/src/resources/auth/credentials.ts +++ b/src/resources/auth/credentials.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 CredentialsAPI from './credentials'; import { APIPromise } from '../../core/api-promise'; import { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; @@ -15,9 +16,10 @@ export class Credentials extends APIResource { * * Embedded Wallet internal accounts are initialized with an `EMAIL_OTP` credential * tied to the customer email on the account. Use this endpoint to add another - * credential (`OAUTH` or `PASSKEY`), or to add `EMAIL_OTP` back after it has been - * removed. Only one `EMAIL_OTP` credential is supported per internal account; - * multiple distinct `PASSKEY` credentials may be registered. + * credential (`SMS_OTP`, `OAUTH`, or `PASSKEY`), or to add `EMAIL_OTP` / `SMS_OTP` + * back after it has been removed. Only one `EMAIL_OTP` and one `SMS_OTP` + * credential are supported per internal account; multiple distinct `PASSKEY` + * credentials may be registered. * * Adding a credential requires a signature from an existing verified credential on * the same account. Call this endpoint with the new credential's details to @@ -26,9 +28,9 @@ export class Credentials extends APIResource { * `encryptedSessionSigningKey`) to build an API-key stamp over `payloadToSign`, * then retry the same request with that full stamp as the `Grid-Wallet-Signature` * header and the `requestId` echoed back as the `Request-Id` header. The signed - * retry returns `201` with the created `AuthMethod`. For `EMAIL_OTP`, the OTP - * email is triggered on the signed retry, and the credential must then be - * activated via `POST /auth/credentials/{id}/verify`. + * retry returns `201` with the created `AuthMethod`. For OTP credentials, the + * one-time password is triggered on the signed retry, and the credential must then + * be activated via `POST /auth/credentials/{id}/verify`. * * @example * ```ts @@ -129,24 +131,26 @@ export class Credentials extends APIResource { /** * Re-issue the challenge for an existing authentication credential. * - * For `EMAIL_OTP` credentials, this triggers a new one-time password email to the - * address on file. The response is a plain `AuthMethod`; there is no challenge - * body to surface because the OTP is delivered out-of-band via email. After the - * user receives the new OTP, call `POST /auth/credentials/{id}/verify` to complete - * verification and issue a session. + * For `EMAIL_OTP` and `SMS_OTP` credentials, this triggers a new one-time password + * to the contact on file and returns a fresh `otpEncryptionTargetBundle` for the + * client to HPKE-encrypt the OTP attempt against. After the user receives the new + * OTP, build the `encryptedOtpBundle` under the new target bundle and call + * `POST /auth/credentials/{id}/verify` to begin the secure OTP login flow. * * `OAUTH` credentials do not have a challenge step. To authenticate or * reauthenticate an OAuth credential, call `POST /auth/credentials/{id}/verify` * with a fresh OIDC token and a `clientPublicKey`. * - * For `PASSKEY` credentials, this issues a fresh Grid-generated WebAuthn challenge - * for reauthentication. The request body must carry the client's ephemeral - * `clientPublicKey` so Grid can bake it into the Turnkey session-creation payload - * the returned challenge is computed from — this seals the resulting session - * signing key to the client. The response is a `PasskeyAuthChallenge` — the - * passkey auth method fields plus the WebAuthn `credentialId`, new `challenge`, - * `requestId`, and `expiresAt`. The client passes `credentialId` as - * `allowCredentials[].id` and `challenge` as the WebAuthn challenge in + * For `PASSKEY` credentials, this issues a fresh Grid reauthentication challenge. + * The request body must carry the client's ephemeral `clientPublicKey` so Grid can + * bake it into the session-creation payload the returned challenge is computed + * from — this seals the resulting session signing key to the client. The response + * is a `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn + * `credentialId`, new `challenge`, `requestId`, and `expiresAt`. The `challenge` + * value is the lowercase hex-encoded SHA-256 digest of the canonical + * session-creation body, not a base64url string. The client base64url-decodes + * `credentialId` for `allowCredentials[].id` and UTF-8 encodes `challenge` (for + * example, `new TextEncoder().encode(challenge)`) as the WebAuthn challenge in * `navigator.credentials.get()`, then submits the resulting assertion to * `POST /auth/credentials/{id}/verify` with `Request-Id: ` to receive a * session. @@ -174,15 +178,30 @@ export class Credentials extends APIResource { /** * Complete the verification step for a previously created authentication - * credential and issue a session signing key. + * credential and issue a session. * - * For `EMAIL_OTP` credentials, supply the one-time password that was emailed to - * the user along with a client-generated public key. For `OAUTH` credentials, - * supply a fresh OIDC token (`iat` must be less than 60 seconds before the - * request) along with the client-generated public key; this is also the - * reauthentication path after a prior session expired. The token identity (`iss`, - * `aud`, and `sub`) must match the OAuth credential being verified. In sandbox, - * the token's `nonce` must equal `sha256(clientPublicKey)`. For `PASSKEY` + * For `EMAIL_OTP` and `SMS_OTP` credentials, submit the `encryptedOtpBundle` + * produced by HPKE-encrypting `{otp_code, public_key}` under the + * `otpEncryptionTargetBundle` returned from registration when present, or from + * `POST /auth/credentials/{id}/challenge` when registration omitted it or the OTP + * must be reissued. The server is a pass-through and never sees the plaintext OTP + * code. On success the response is `202` with a `payloadToSign` carrying the + * `verificationToken` bound to the client's TEK public key — sign that token with + * the matching TEK private key, then retry the same request with the full stamp in + * `Grid-Wallet-Signature` and the `requestId` echoed in `Request-Id`. The signed + * retry returns `200` with the issued `AuthSession`. The TEK public key becomes + * the session API key on successful completion. In sandbox mode, the OTP flow runs + * real HPKE end-to-end against a sandbox enclave keypair — clients build a real + * `encryptedOtpBundle` against the sandbox `otpEncryptionTargetBundle` and sign a + * real `verificationToken` with their TEK keypair. The only sandbox shortcut is + * the magic OTP code (`"000000"`) the user "receives" instead of a real email or + * SMS delivery. + * + * For `OAUTH` credentials, supply a fresh OIDC token (`iat` must be less than 60 + * seconds before the request) along with the client-generated public key; this is + * also the reauthentication path after a prior session expired. The token identity + * (`iss`, `aud`, and `sub`) must match the OAuth credential being verified. In + * sandbox, the token's `nonce` must equal `sha256(clientPublicKey)`. For `PASSKEY` * credentials, the client completes a WebAuthn assertion * (`navigator.credentials.get()`) against the Grid-issued `challenge` returned * from `POST /auth/credentials/{id}/challenge`, and submits the resulting @@ -190,26 +209,42 @@ export class Credentials extends APIResource { * credentials is supplied on the challenge call, where it is bound into the * pending session-creation request. * - * On success, the response contains an `encryptedSessionSigningKey` that is - * encrypted to the supplied `clientPublicKey`, along with an `expiresAt` timestamp - * marking when the session expires. The `clientPublicKey` is ephemeral and - * one-time-use per verification request. + * On success for `OAUTH` and `PASSKEY`, and on the signed retry for OTP + * credentials, the response contains an `AuthSession`. For `OAUTH` and `PASSKEY` + * the session signing key is delivered as `encryptedSessionSigningKey` + * (HPKE-sealed to the supplied `clientPublicKey`); for OTP credentials the client + * already holds the session signing key (the TEK private key it generated) and + * that field is omitted from the response. The `expiresAt` timestamp marks when + * the session expires. * * @example * ```ts * const authSession = await client.auth.credentials.verify( * 'id', - * { AuthCredentialVerifyRequest: {} }, + * { + * AuthCredentialVerifyRequest: { + * type: 'SMS_OTP', + * encryptedOtpBundle: + * '{"encappedPublic":"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838","ciphertext":"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc"}', + * }, + * }, * ); * ``` */ verify(id: string, params: CredentialVerifyParams, options?: RequestOptions): APIPromise { - const { AuthCredentialVerifyRequest, 'Request-Id': requestID } = params; + const { + AuthCredentialVerifyRequest, + 'Grid-Wallet-Signature': gridWalletSignature, + 'Request-Id': requestID, + } = params; return this._client.post(path`/auth/credentials/${id}/verify`, { body: AuthCredentialVerifyRequest, ...options, headers: buildHeaders([ - { ...(requestID != null ? { 'Request-Id': requestID } : undefined) }, + { + ...(gridWalletSignature != null ? { 'Grid-Wallet-Signature': gridWalletSignature } : undefined), + ...(requestID != null ? { 'Request-Id': requestID } : undefined), + }, options?.headers, ]), __security: { basicAuth: true }, @@ -217,6 +252,27 @@ export class Credentials extends APIResource { } } +/** + * Request body for `POST /auth/credentials/{id}/challenge`. Required when + * re-challenging a `PASSKEY` credential — must carry `clientPublicKey` so Grid can + * bake it into the session-creation payload the returned challenge is computed + * from. Ignored for `EMAIL_OTP` and `SMS_OTP`, where the credential type alone is + * sufficient because the OTP is delivered out-of-band. OAuth credentials do not + * use this endpoint; authenticate or reauthenticate them with + * `POST /auth/credentials/{id}/verify`. + */ +export interface AuthCredentialChallengeRequest { + /** + * Required for `PASSKEY` credentials. Client-generated P-256 public key, + * hex-encoded in uncompressed SEC1 format (`04` prefix followed by the 32-byte X + * and 32-byte Y coordinates; 130 hex characters total). The matching private key + * must remain on the client. Grid bakes this key into the session-creation payload + * that the returned `challenge` is computed from, so the resulting session signing + * key is sealed to the client. Ignored for `EMAIL_OTP` and `SMS_OTP`. + */ + clientPublicKey?: string; +} + export interface AuthCredentialCreateRequest { /** * Identifier of the internal account that this credential will authenticate. @@ -228,9 +284,19 @@ export interface AuthCredentialCreateRequest { export type AuthCredentialCreateRequestOneOf = | EmailOtpCredentialCreateRequest + | AuthCredentialCreateRequestOneOf.SMSOtpCredentialCreateRequest | OAuthCredentialCreateRequest | PasskeyCredentialCreateRequest; +export namespace AuthCredentialCreateRequestOneOf { + export interface SMSOtpCredentialCreateRequest extends CredentialsAPI.AuthCredentialCreateRequest { + /** + * Discriminator value identifying this as an SMS OTP credential. + */ + type: 'SMS_OTP'; + } +} + export interface AuthCredentialListResponse { /** * List of authentication credentials registered on the internal account. @@ -240,14 +306,14 @@ export interface AuthCredentialListResponse { /** * Discriminated response shape returned from - * `POST /auth/credentials/{id}/challenge`. For `EMAIL_OTP` credentials the body is - * a plain `AuthMethod` (wrapped as `AuthMethodResponse` to disambiguate the - * oneOf). For `PASSKEY` credentials the body is a `PasskeyAuthChallenge` — the - * passkey auth method fields plus the WebAuthn `credentialId`, Grid-issued - * `challenge`, `requestId`, and `expiresAt` that drive the subsequent assertion. - * OAuth credentials do not use the challenge endpoint. Registration responses from - * `POST /auth/credentials` use the simpler `AuthMethodResponse` shape directly for - * all three credential types. + * `POST /auth/credentials/{id}/challenge`. For `EMAIL_OTP` and `SMS_OTP` + * credentials the body is a plain `AuthMethod` (wrapped as `AuthMethodResponse` to + * disambiguate the oneOf). For `PASSKEY` credentials the body is a + * `PasskeyAuthChallenge` — the passkey auth method fields plus the WebAuthn + * `credentialId`, Grid-issued `challenge`, `requestId`, and `expiresAt` that drive + * the subsequent assertion. OAuth credentials do not use the challenge endpoint. + * Registration responses from `POST /auth/credentials` use the simpler + * `AuthMethodResponse` shape directly for all credential types. */ export type AuthCredentialResponseOneOf = AuthMethodResponse | PasskeyAuthChallenge; @@ -255,66 +321,30 @@ export interface AuthCredentialVerifyRequest { type: unknown; } -export type AuthCredentialVerifyRequestOneOf = unknown; - -export interface AuthMethod { - /** - * System-generated unique identifier for the authentication credential. - */ - id: string; - - /** - * Identifier of the internal account that this credential authenticates. - */ - accountId: string; - - /** - * Creation timestamp. - */ - createdAt: string; - - /** - * Human-readable identifier for this credential. For EMAIL_OTP credentials this is - * the email address; for OAUTH credentials it is typically the email claim from - * the OIDC token; for PASSKEY credentials it is the validated nickname provided at - * registration time. - */ - nickname: string; - - /** - * The type of authentication credential. - * - * - `OAUTH`: OpenID Connect (OIDC) token issued by an identity provider such as - * Google or Apple. - * - `EMAIL_OTP`: A one-time password delivered to the user's email address. - * - `PASSKEY`: A WebAuthn passkey bound to the user's device. - */ - type: AuthMethodType; - +/** + * Verify an SMS-OTP credential via the same secure two-leg flow as email OTP. The + * client HPKE-encrypts the OTP code (together with its public key) under the + * `otpEncryptionTargetBundle` returned from registration or + * `POST /auth/credentials/{id}/challenge`, submits the result here, and receives + * `202` with a `payloadToSign` carrying a `verificationToken` bound to the + * client's public key. The client signs that token with the matching private key + * and retries this request with `Grid-Wallet-Signature` + `Request-Id` headers to + * obtain the session. Plaintext OTP codes are never sent over the wire. + */ +export interface AuthCredentialVerifyRequestOneOf extends AuthCredentialVerifyRequest { /** - * Last update timestamp. + * HPKE-sealed OTP attempt. Same format and retry semantics as + * `EmailOtpCredentialVerifyRequest.encryptedOtpBundle`. */ - updatedAt: string; + encryptedOtpBundle: string; /** - * Base64url-encoded WebAuthn credential identifier for this passkey. Present only - * for `PASSKEY` authentication credentials. Corresponds to - * `PublicKeyCredential.rawId`; pass this value as `allowCredentials[].id` when - * requesting a passkey assertion for this auth method. + * Discriminator value identifying this as an SMS OTP verification. */ - credentialId?: string; + type: 'SMS_OTP'; } -/** - * Strict wrapper around `AuthMethod`. Used directly as the registration response - * on `POST /auth/credentials` (all three credential types) and inside - * `AuthCredentialResponseOneOf` for the `EMAIL_OTP` branch of - * `POST /auth/credentials/{id}/challenge`. The only difference from `AuthMethod` - * is `unevaluatedProperties: false`, which disambiguates the oneOf against - * `PasskeyAuthChallenge` — without the strictness, an `AuthMethod` with extra - * fields would ambiguously match both branches. - */ -export interface AuthMethodResponse { +export interface AuthMethod { /** * System-generated unique identifier for the authentication credential. */ @@ -332,9 +362,9 @@ export interface AuthMethodResponse { /** * Human-readable identifier for this credential. For EMAIL_OTP credentials this is - * the email address; for OAUTH credentials it is typically the email claim from - * the OIDC token; for PASSKEY credentials it is the validated nickname provided at - * registration time. + * the email address; for SMS_OTP credentials this is the E.164 phone number; for + * OAUTH credentials it is typically the email claim from the OIDC token; for + * PASSKEY credentials it is the validated nickname provided at registration time. */ nickname: string; @@ -344,6 +374,7 @@ export interface AuthMethodResponse { * - `OAUTH`: OpenID Connect (OIDC) token issued by an identity provider such as * Google or Apple. * - `EMAIL_OTP`: A one-time password delivered to the user's email address. + * - `SMS_OTP`: A one-time password delivered to the user's phone number. * - `PASSKEY`: A WebAuthn passkey bound to the user's device. */ type: AuthMethodType; @@ -362,15 +393,52 @@ export interface AuthMethodResponse { credentialId?: string; } +/** + * Strict wrapper around `AuthMethod`. Used directly as the registration response + * on `POST /auth/credentials` and inside `AuthCredentialResponseOneOf` for the + * `EMAIL_OTP` / `SMS_OTP` branches of `POST /auth/credentials/{id}/challenge`. The + * only difference from `AuthMethod` is `unevaluatedProperties: false`, which + * disambiguates the oneOf against `PasskeyAuthChallenge` — without the strictness, + * an `AuthMethod` with extra fields would ambiguously match both branches. + * + * For `EMAIL_OTP` and `SMS_OTP` credentials, responses that initiate or reissue an + * OTP challenge carry `otpEncryptionTargetBundle` so the client can HPKE-encrypt + * the OTP code in the subsequent `POST /auth/credentials/{id}/verify` call without + * the plaintext code ever transiting the server. First-time EMAIL_OTP wallet + * bootstrap registration can omit it; call `POST /auth/credentials/{id}/challenge` + * if it is absent. + */ +export interface AuthMethodResponse extends AuthMethod { + /** + * HPKE encryption target bundle for a freshly initiated OTP challenge. Returned + * only on `EMAIL_OTP` and `SMS_OTP` responses that initiate or reissue an OTP + * challenge, such as `POST /auth/credentials/{id}/challenge` and signed-retry add + * responses. It is omitted from first-time EMAIL_OTP wallet bootstrap + * registration; call `POST /auth/credentials/{id}/challenge` for the new + * credential if it is absent. The client generates an ephemeral P-256 keypair (the + * Target Encryption Key, or TEK) and uses this bundle as the recipient when + * HPKE-encrypting `{otp_code, public_key}`; the encrypted payload is submitted as + * `encryptedOtpBundle` on `POST /auth/credentials/{id}/verify`. The bundle is + * one-time-use per OTP issuance — re-issue via + * `POST /auth/credentials/{id}/challenge` to obtain a fresh bundle. The matching + * TEK private key must remain on the client and is used to sign the + * `verificationToken` returned on the subsequent signed-retry. Treat the bundle as + * opaque and pass it to your HPKE library; the Global Accounts client-keys guide + * shows how. + */ + otpEncryptionTargetBundle?: string; +} + /** * The type of authentication credential. * * - `OAUTH`: OpenID Connect (OIDC) token issued by an identity provider such as * Google or Apple. * - `EMAIL_OTP`: A one-time password delivered to the user's email address. + * - `SMS_OTP`: A one-time password delivered to the user's phone number. * - `PASSKEY`: A WebAuthn passkey bound to the user's device. */ -export type AuthMethodType = 'OAUTH' | 'EMAIL_OTP' | 'PASSKEY'; +export type AuthMethodType = 'OAUTH' | 'EMAIL_OTP' | 'SMS_OTP' | 'PASSKEY'; /** * An authentication session on an Embedded Wallet internal account. Returned from @@ -402,11 +470,12 @@ export interface AuthSession extends AuthMethod { * by AES-256-GCM ciphertext. The client decrypts this key with its private key and * uses it to sign subsequent Embedded Wallet requests until `expiresAt`. * - * Only returned from session-issuing responses like - * `POST /auth/credentials/{id}/verify` and `POST /auth/sessions/{id}/refresh`. - * Omitted from responses that simply surface existing sessions (e.g. - * `GET /auth/sessions`) — Grid does not retain the plaintext key after the client - * has decrypted it. + * Returned only by session-issuing responses for `OAUTH` and `PASSKEY` + * credentials. `EMAIL_OTP` and `SMS_OTP` sessions omit this field — the client + * generates a TEK keypair before verification and retains the private key + * throughout, so the server has nothing to deliver. Always omitted from list + * responses (`GET /auth/sessions`) since Grid does not retain the plaintext key + * after the client has decrypted it. */ encryptedSessionSigningKey?: string; } @@ -414,19 +483,32 @@ export interface AuthSession extends AuthMethod { /** * 202 response returned from Embedded Wallet Auth endpoints that require a signed * retry — `POST /auth/credentials` (adding an additional credential), - * `DELETE /auth/credentials/{id}` (revoking a credential), and - * `DELETE /auth/sessions/{id}` (revoking a session). Carries the signing fields - * from `SignedRequestChallenge` plus the `type` of the authentication credential - * involved (being added, revoked, or that issued the session being revoked). The - * client already knows the target resource id from the request path / body it just - * sent, so nothing beyond `type` is echoed in the response. + * `DELETE /auth/credentials/{id}` (revoking a credential), + * `DELETE /auth/sessions/{id}` (revoking a session), and the `EMAIL_OTP` / + * `SMS_OTP` branch of `POST /auth/credentials/{id}/verify` (the secure OTP login + * flow, where the client submits an `encryptedOtpBundle` and receives a + * `verificationToken` to sign for the second-leg session issuance). Carries the + * signing fields from `SignedRequestChallenge` plus the `type` of the + * authentication credential involved (being added, revoked, that issued the + * session being revoked, or being authenticated). The client already knows the + * target resource id from the request path / body it just sent, so nothing beyond + * `type` is echoed in the response. + * + * The keypair used to compute the stamp depends on the operation. For credential / + * session management retries, sign with the session API keypair of an existing + * verified credential on the same internal account. For OTP verify retries, sign + * with the ephemeral Target Encryption Key (TEK) the client generated for this + * login — its public key is the one carried inside the `encryptedOtpBundle` and + * bound into the `verificationToken`, and it becomes the client's session API key + * on successful completion. */ export interface AuthSignedRequestChallenge extends SignedRequestChallenge { /** * Credential type relevant to this challenge: the credential type being added - * (`POST /auth/credentials`) or revoked (`DELETE /auth/credentials/{id}`). For - * session revocation, this is the type of credential that issued the session - * (`DELETE /auth/sessions/{id}`). + * (`POST /auth/credentials`), revoked (`DELETE /auth/credentials/{id}`), or + * authenticated (`EMAIL_OTP` / `SMS_OTP` branch of + * `POST /auth/credentials/{id}/verify`). For session revocation, this is the type + * of credential that issued the session (`DELETE /auth/sessions/{id}`). */ type: AuthMethodType; } @@ -438,6 +520,17 @@ export interface EmailOtpCredentialCreateRequest extends AuthCredentialCreateReq type: 'EMAIL_OTP'; } +/** + * Verify an email-OTP credential via the secure two-leg flow. The client + * HPKE-encrypts the OTP code (together with its public key) under the + * `otpEncryptionTargetBundle` returned from registration when present, or from + * `POST /auth/credentials/{id}/challenge` when registration omitted it or the OTP + * must be reissued, submits the result here, and receives `202` with a + * `payloadToSign` carrying a `verificationToken` bound to the client's public key. + * The client signs that token with the matching private key and retries this + * request with `Grid-Wallet-Signature` + `Request-Id` headers to obtain the + * session. Plaintext OTP codes are never sent over the wire. + */ export type EmailOtpCredentialVerifyRequest = unknown; export interface OAuthCredentialCreateRequest extends AuthCredentialCreateRequest { @@ -460,6 +553,12 @@ export interface OAuthCredentialCreateRequest extends AuthCredentialCreateReques export type OAuthCredentialVerifyRequest = unknown; +/** + * WebAuthn assertion returned by `navigator.credentials.get()`. In sandbox, Grid + * validates the assertion against the registered passkey credential so the + * client-side flow can match production. In production, Grid validates the + * WebAuthn assertion. + */ export interface PasskeyAssertion { /** * Base64url-encoded authenticator data returned by the authenticator during the @@ -542,17 +641,20 @@ export interface PasskeyAttestation { * Extended `AuthMethod` shape returned for `PASSKEY` credentials from * `POST /auth/credentials/{id}/challenge`. Includes the WebAuthn `credentialId` * needed to target the passkey, plus the Grid-issued `challenge`, corresponding - * `requestId`, and challenge `expiresAt`. The client signs the challenge with the - * passkey to produce the assertion submitted to + * `requestId`, and challenge `expiresAt`. The `challenge` value is the lowercase + * hex-encoded SHA-256 digest of the canonical session-creation request body, not a + * base64url string. The client UTF-8 encodes this string as the WebAuthn challenge + * and signs it with the passkey to produce the assertion submitted to * `POST /auth/credentials/{id}/verify`. */ export interface PasskeyAuthChallenge extends AuthMethod { /** - * Base64url-encoded challenge issued by Grid for the pending passkey - * authentication. The client passes it into `navigator.credentials.get()` as the - * WebAuthn challenge; the resulting assertion is submitted to - * `POST /auth/credentials/{id}/verify`. Single-use; a new challenge is issued on - * the next call to `POST /auth/credentials/{id}/challenge`. + * Lowercase hex-encoded SHA-256 digest of the canonical session-creation request + * body for the pending passkey authentication. Do not base64url-decode this field; + * pass UTF-8 bytes of the string (for example, + * `new TextEncoder().encode(challenge)`) as the WebAuthn challenge to + * `navigator.credentials.get()`. Single-use; a new challenge is issued on the next + * call to `POST /auth/credentials/{id}/challenge`. */ challenge: string; @@ -690,29 +792,50 @@ export interface CredentialChallengeParams { * Required for `PASSKEY` credentials. Client-generated P-256 public key, * hex-encoded in uncompressed SEC1 format (`04` prefix followed by the 32-byte X * and 32-byte Y coordinates; 130 hex characters total). The matching private key - * must remain on the client. Grid bakes this key into the Turnkey session-creation - * payload that the returned `challenge` is computed from, so the resulting session - * signing key is sealed to the client. Ignored for `EMAIL_OTP`. + * must remain on the client. Grid bakes this key into the session-creation payload + * that the returned `challenge` is computed from, so the resulting session signing + * key is sealed to the client. Ignored for `EMAIL_OTP` and `SMS_OTP`. */ clientPublicKey?: string; } export interface CredentialVerifyParams { /** - * Body param + * Body param: Verify an SMS-OTP credential via the same secure two-leg flow as + * email OTP. The client HPKE-encrypts the OTP code (together with its public key) + * under the `otpEncryptionTargetBundle` returned from registration or + * `POST /auth/credentials/{id}/challenge`, submits the result here, and receives + * `202` with a `payloadToSign` carrying a `verificationToken` bound to the + * client's public key. The client signs that token with the matching private key + * and retries this request with `Grid-Wallet-Signature` + `Request-Id` headers to + * obtain the session. Plaintext OTP codes are never sent over the wire. */ AuthCredentialVerifyRequest: AuthCredentialVerifyRequestOneOf; /** - * Header param: The `requestId` returned alongside the Grid-issued `challenge` - * from `POST /auth/credentials/{id}/challenge`, echoed back exactly here so Grid - * can correlate the assertion with the pending challenge. + * Header param: Full API-key stamp built over the prior `payloadToSign` with the + * TEK (Target Encryption Key) keypair the client generated for this login. + * Required on the signed retry that completes an `EMAIL_OTP` or `SMS_OTP` + * verification. Not used by `OAUTH` or `PASSKEY` verification, which complete in a + * single call. + */ + 'Grid-Wallet-Signature'?: string; + + /** + * Header param: The `requestId` returned in a prior `202` response from this + * endpoint, echoed back exactly here so the server can correlate the signed retry + * with the issued challenge. Required on the signed retry that completes an + * `EMAIL_OTP` or `SMS_OTP` verification; must be paired with + * `Grid-Wallet-Signature`. For `PASSKEY` verification, the `requestId` issued from + * `POST /auth/credentials/{id}/challenge` is echoed here instead so the server can + * correlate the assertion with the pending challenge. */ 'Request-Id'?: string; } export declare namespace Credentials { export { + type AuthCredentialChallengeRequest as AuthCredentialChallengeRequest, type AuthCredentialCreateRequest as AuthCredentialCreateRequest, type AuthCredentialCreateRequestOneOf as AuthCredentialCreateRequestOneOf, type AuthCredentialListResponse as AuthCredentialListResponse, diff --git a/src/resources/auth/index.ts b/src/resources/auth/index.ts index bc6aaaec..1a83e57f 100644 --- a/src/resources/auth/index.ts +++ b/src/resources/auth/index.ts @@ -3,6 +3,7 @@ export { Auth } from './auth'; export { Credentials, + type AuthCredentialChallengeRequest, type AuthCredentialCreateRequest, type AuthCredentialCreateRequestOneOf, type AuthCredentialListResponse, @@ -32,6 +33,7 @@ export { } from './credentials'; export { Sessions, + type AuthSessionRefreshRequest, type SessionListResponse, type SessionListParams, type SessionDeleteParams, diff --git a/src/resources/auth/sessions.ts b/src/resources/auth/sessions.ts index a3bf8341..bc0545c8 100644 --- a/src/resources/auth/sessions.ts +++ b/src/resources/auth/sessions.ts @@ -82,10 +82,10 @@ export class Sessions extends APIResource { * key. Session refresh is a two-step signed-retry flow: * * 1. Call `POST /auth/sessions/{id}/refresh` with the request body - * `{ "clientPublicKey": "04..." }` and no signature headers. Grid builds a - * Turnkey create-read-write-session payload, binds the supplied - * `clientPublicKey` into that payload, persists it as a pending request, and - * returns `202` with `payloadToSign`, `requestId`, and `expiresAt`. + * `{ "clientPublicKey": "04..." }` and no signature headers. Grid builds a Grid + * session-refresh payload, binds the supplied `clientPublicKey` into that + * payload, persists it as a pending request, and returns `202` with + * `payloadToSign`, `requestId`, and `expiresAt`. * * 2. Sign `payloadToSign` with the current session signing key, then retry the * same request with the full API-key stamp as `Grid-Wallet-Signature`, the @@ -102,8 +102,10 @@ export class Sessions extends APIResource { * const authSession = await client.auth.sessions.refresh( * 'Session:019542f5-b3e7-1d02-0000-000000000003', * { - * clientPublicKey: - * '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + * AuthSessionRefreshRequest: { + * clientPublicKey: + * '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + * }, * }, * ); * ``` @@ -113,9 +115,13 @@ export class Sessions extends APIResource { params: SessionRefreshParams, options?: RequestOptions, ): APIPromise { - const { 'Grid-Wallet-Signature': gridWalletSignature, 'Request-Id': requestID, ...body } = params; + const { + AuthSessionRefreshRequest, + 'Grid-Wallet-Signature': gridWalletSignature, + 'Request-Id': requestID, + } = params; return this._client.post(path`/auth/sessions/${id}/refresh`, { - body, + body: AuthSessionRefreshRequest, ...options, headers: buildHeaders([ { @@ -129,6 +135,24 @@ export class Sessions extends APIResource { } } +/** + * Request body for refreshing an active authentication session. The + * `clientPublicKey` is required on both steps of the signed-retry flow. On the + * initial call, Grid binds this key into the session-creation payload returned as + * `payloadToSign`; on the signed retry, the client echoes the same key back and + * Grid uses it to encrypt the newly issued session signing key. + */ +export interface AuthSessionRefreshRequest { + /** + * Client-generated P-256 public key, hex-encoded in uncompressed SEC1 format (`04` + * prefix followed by the 32-byte X and 32-byte Y coordinates; 130 hex characters + * total). The matching private key must remain on the client. Grid binds this key + * into the session-creation payload on the initial call and seals the returned + * `encryptedSessionSigningKey` to it on the signed retry. + */ + clientPublicKey: string; +} + export interface SessionListResponse { /** * List of active authentication sessions for the internal account. @@ -161,13 +185,13 @@ export interface SessionDeleteParams { export interface SessionRefreshParams { /** - * Body param: Client-generated P-256 public key, hex-encoded in uncompressed SEC1 - * format (`04` prefix followed by the 32-byte X and 32-byte Y coordinates; 130 hex - * characters total). The matching private key must remain on the client. Grid - * binds this key into the session-creation payload on the initial call and seals - * the returned `encryptedSessionSigningKey` to it on the signed retry. + * Body param: Request body for refreshing an active authentication session. The + * `clientPublicKey` is required on both steps of the signed-retry flow. On the + * initial call, Grid binds this key into the session-creation payload returned as + * `payloadToSign`; on the signed retry, the client echoes the same key back and + * Grid uses it to encrypt the newly issued session signing key. */ - clientPublicKey: string; + AuthSessionRefreshRequest: AuthSessionRefreshRequest; /** * Header param: Full API-key stamp built over the prior `payloadToSign` with the @@ -186,6 +210,7 @@ export interface SessionRefreshParams { export declare namespace Sessions { export { + type AuthSessionRefreshRequest as AuthSessionRefreshRequest, type SessionListResponse as SessionListResponse, type SessionListParams as SessionListParams, type SessionDeleteParams as SessionDeleteParams, diff --git a/src/resources/beneficial-owners.ts b/src/resources/beneficial-owners.ts index dc7cc901..63084f39 100644 --- a/src/resources/beneficial-owners.ts +++ b/src/resources/beneficial-owners.ts @@ -109,6 +109,48 @@ export class BeneficialOwners extends APIResource { } } +export interface BeneficialOwnerCreateRequest { + /** + * The ID of the business customer this beneficial owner is associated with + */ + customerId: string; + + /** + * Percentage of ownership in the business (0-100). Relevant when role includes + * UBO. + */ + ownershipPercentage: number; + + personalInfo: BeneficialOwnerPersonalInfo; + + /** + * Roles of this person within the business + */ + roles: Array<'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'>; +} + +export interface BeneficialOwnerListResponse { + /** + * List of beneficial owners matching the filter criteria + */ + data: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of results matching the criteria + */ + totalCount?: number; +} + export interface BeneficialOwnerPersonalInfo { address: ExternalAccountsAPI.Address; @@ -163,6 +205,84 @@ export interface BeneficialOwnerPersonalInfo { phoneNumber?: string; } +export interface BeneficialOwnerUpdateRequest { + /** + * Percentage of ownership in the business (0-100) + */ + ownershipPercentage?: number; + + /** + * Partial update for beneficial owner personal information. Only provided fields + * are updated. + */ + personalInfo?: BeneficialOwnerUpdateRequest.PersonalInfo; + + /** + * Roles of this person within the business + */ + roles?: Array<'UBO' | 'DIRECTOR' | 'COMPANY_OFFICER' | 'CONTROL_PERSON' | 'TRUSTEE' | 'GENERAL_PARTNER'>; +} + +export namespace BeneficialOwnerUpdateRequest { + /** + * Partial update for beneficial owner personal information. Only provided fields + * are updated. + */ + export interface PersonalInfo { + address?: ExternalAccountsAPI.Address; + + /** + * Date of birth in ISO 8601 format (YYYY-MM-DD) + */ + birthDate?: string; + + /** + * Country that issued the identification (ISO 3166-1 alpha-2) + */ + countryOfIssuance?: string; + + /** + * Email address of the individual + */ + email?: string; + + /** + * First name of the individual + */ + firstName?: string; + + /** + * The identification number or value + */ + identifier?: string; + + /** + * Type of tax identification + */ + idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; + + /** + * Last name of the individual + */ + lastName?: string; + + /** + * Middle name of the individual + */ + middleName?: string; + + /** + * Country of nationality (ISO 3166-1 alpha-2) + */ + nationality?: string; + + /** + * Phone number in E.164 format + */ + phoneNumber?: string; + } +} + export interface BeneficialOwnerCreateParams { /** * The ID of the business customer this beneficial owner is associated with @@ -275,7 +395,10 @@ export interface BeneficialOwnerListParams extends DefaultPaginationParams { export declare namespace BeneficialOwners { export { + type BeneficialOwnerCreateRequest as BeneficialOwnerCreateRequest, + type BeneficialOwnerListResponse as BeneficialOwnerListResponse, type BeneficialOwnerPersonalInfo as BeneficialOwnerPersonalInfo, + type BeneficialOwnerUpdateRequest as BeneficialOwnerUpdateRequest, type BeneficialOwnerCreateParams as BeneficialOwnerCreateParams, type BeneficialOwnerUpdateParams as BeneficialOwnerUpdateParams, type BeneficialOwnerListParams as BeneficialOwnerListParams, diff --git a/src/resources/cards.ts b/src/resources/cards.ts index 7fa5bb8d..56ec3ee1 100644 --- a/src/resources/cards.ts +++ b/src/resources/cards.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; +import * as InvitationsAPI from './invitations'; +import * as SimulateAPI from './sandbox/cards/simulate'; import { APIPromise } from '../core/api-promise'; import { DefaultPagination, type DefaultPaginationParams, PagePromise } from '../core/pagination'; import { buildHeaders } from '../internal/headers'; @@ -12,14 +14,16 @@ import { path } from '../internal/utils/path'; */ export class Cards extends APIResource { /** - * Retrieve a card by its system-generated id. + * Retrieve a card by its system-generated id. To display the card's full PAN, CVV, + * and expiry to the cardholder, request a reveal with `POST /cards/{id}/reveal` — + * the card resource itself never carries the reveal URL. * * @example * ```ts * const card = await client.cards.retrieve('id'); * ``` */ - retrieve(id: string, options?: RequestOptions): APIPromise { + retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/cards/${id}`, { ...options, __security: { basicAuth: true } }); } @@ -77,7 +81,7 @@ export class Cards extends APIResource { * }); * ``` */ - update(id: string, params: CardUpdateParams, options?: RequestOptions): APIPromise { + update(id: string, params: CardUpdateParams, options?: RequestOptions): APIPromise { const { 'Grid-Wallet-Signature': gridWalletSignature, 'Request-Id': requestID, ...body } = params; return this._client.patch(path`/cards/${id}`, { body, @@ -101,7 +105,7 @@ export class Cards extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const cardListResponse of client.cards.list()) { + * for await (const card of client.cards.list()) { * // ... * } * ``` @@ -109,8 +113,8 @@ export class Cards extends APIResource { list( query: CardListParams | null | undefined = {}, options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/cards', DefaultPagination, { + ): PagePromise { + return this._client.getAPIList('/cards', DefaultPagination, { query, ...options, __security: { basicAuth: true }, @@ -123,13 +127,21 @@ export class Cards extends APIResource { * before a card can be issued; otherwise the request is rejected with * `CARDHOLDER_KYC_NOT_APPROVED`. * - * New cards start in `state: "PENDING_ISSUE"` while the card issuer provisions the - * card. The `card.state_change` webhook fires on the transition to `ACTIVE` (or to - * `CLOSED` with `stateReason: "ISSUER_REJECTED"` if provisioning fails). + * If any funding source is an Embedded Wallet internal account, the cardholder + * must authorize Grid to sign Spark token transactions for that card funding + * source by completing the delegated-key creation flow with + * `POST /auth/delegated-keys`. Until an active delegated key exists for that + * funding source, Authorization Decisioning cannot use it to fund card + * transactions. + * + * New cards start in `state: "PROCESSING"` while the card issuer provisions the + * card. The `card.state_change` webhook fires on each state transition, including + * the transition to `ACTIVE` (or to `CLOSED` with `stateReason: "ISSUER_REJECTED"` + * if provisioning fails). * * @example * ```ts - * const response = await client.cards.issue({ + * const card = await client.cards.issue({ * cardholderId: * 'Customer:019542f5-b3e7-1d02-0000-000000000001', * form: 'VIRTUAL', @@ -140,14 +152,14 @@ export class Cards extends APIResource { * }); * ``` */ - issue(body: CardIssueParams, options?: RequestOptions): APIPromise { + issue(body: CardIssueParams, options?: RequestOptions): APIPromise { return this._client.post('/cards', { body, ...options, __security: { basicAuth: true } }); } } -export type CardListResponsesDefaultPagination = DefaultPagination; +export type CardsDefaultPagination = DefaultPagination; -export interface CardRetrieveResponse { +export interface Card { /** * System-generated unique card identifier */ @@ -179,15 +191,15 @@ export interface CardRetrieveResponse { /** * Lifecycle state of a card. * - * | State | Description | - * | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | - * | `PENDING_ISSUE` | The card has been requested and is being provisioned with the issuer. | - * | `ACTIVE` | The card is live and can authorize transactions. | - * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | - * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | + * | State | Description | + * | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | + * | `PROCESSING` | The card has been requested and is being provisioned with the issuer. | + * | `ACTIVE` | The card is live and can authorize transactions. | + * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | + * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | */ - state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; + state: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; /** * Last update timestamp @@ -218,8 +230,9 @@ export interface CardRetrieveResponse { expYear?: number; /** - * Opaque identifier for the card on the underlying issuer. Useful for - * cross-referencing in issuer dashboards; not used for any Grid request routing. + * Opaque identifier for the card on the issuer of record (e.g. the Lead Bank + * account/card identifier). Useful for cross-referencing in issuer dashboards; not + * used for any Grid request routing. */ issuerRef?: string; @@ -228,13 +241,6 @@ export interface CardRetrieveResponse { */ last4?: string; - /** - * URL of the card issuer's iframe that securely displays the PAN, CVV, and expiry - * to the cardholder. The full PAN and CVV never cross Grid's servers — render this - * URL in an iframe in your client to reveal card details. - */ - panEmbedUrl?: string; - /** * Platform-specific card identifier. Optional on create — system-generated if * omitted, mirroring `platformCustomerId` semantics. @@ -242,105 +248,11 @@ export interface CardRetrieveResponse { platformCardId?: string; /** - * Reason associated with the current `state`. Populated when the card is `CLOSED` - * or when provisioning was rejected; otherwise null. - */ - stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID' | null; -} - -export interface CardUpdateResponse { - /** - * System-generated unique card identifier - */ - id: string; - - /** - * The id of the `Customer` who holds this card. - */ - cardholderId: string; - - /** - * Creation timestamp - */ - createdAt: string; - - /** - * Physical form factor of the card. Only `VIRTUAL` is supported in v1; `PHYSICAL` - * will be added in a later release. - */ - form: 'VIRTUAL'; - - /** - * Internal account ids bound to this card as funding sources, in priority order — - * the first entry is tried first by Authorization Decisioning. Every card has at - * least one funding source. - */ - fundingSources: Array; - - /** - * Lifecycle state of a card. - * - * | State | Description | - * | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | - * | `PENDING_ISSUE` | The card has been requested and is being provisioned with the issuer. | - * | `ACTIVE` | The card is live and can authorize transactions. | - * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | - * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | - */ - state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; - - /** - * Last update timestamp - */ - updatedAt: string; - - /** - * Card network brand. Read-only — determined by Grid when the card is provisioned - * with the issuer. - */ - brand?: 'VISA' | 'MASTERCARD'; - - /** - * Currency the card transacts in (ISO 4217 for fiat, tickers for crypto). Derived - * from the funding sources at issue time — all funding sources bound to a card - * must be denominated in the same card-eligible currency. - */ - currency?: string; - - /** - * Card expiration month (1–12). - */ - expMonth?: number; - - /** - * Card expiration year (four digits). + * Opaque processor-side reference for the card (e.g. the Lithic card token). + * Useful for cross-referencing in the processor's dashboards; not used for any + * Grid request routing. */ - expYear?: number; - - /** - * Opaque identifier for the card on the underlying issuer. Useful for - * cross-referencing in issuer dashboards; not used for any Grid request routing. - */ - issuerRef?: string; - - /** - * Last four digits of the card PAN. - */ - last4?: string; - - /** - * URL of the card issuer's iframe that securely displays the PAN, CVV, and expiry - * to the cardholder. The full PAN and CVV never cross Grid's servers — render this - * URL in an iframe in your client to reveal card details. - */ - panEmbedUrl?: string; - - /** - * Platform-specific card identifier. Optional on create — system-generated if - * omitted, mirroring `platformCustomerId` semantics. - */ - platformCardId?: string; + processorRef?: string; /** * Reason associated with the current `state`. Populated when the card is `CLOSED` @@ -349,22 +261,14 @@ export interface CardUpdateResponse { stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID' | null; } -export interface CardListResponse { +export interface CardCreateRequest { /** - * System-generated unique card identifier - */ - id: string; - - /** - * The id of the `Customer` who holds this card. + * The id of the `Customer` to issue the card to. The customer must have KYC status + * `APPROVED`; otherwise the request is rejected with + * `CARDHOLDER_KYC_NOT_APPROVED`. */ cardholderId: string; - /** - * Creation timestamp - */ - createdAt: string; - /** * Physical form factor of the card. Only `VIRTUAL` is supported in v1; `PHYSICAL` * will be added in a later release. @@ -372,183 +276,169 @@ export interface CardListResponse { form: 'VIRTUAL'; /** - * Internal account ids bound to this card as funding sources, in priority order — - * the first entry is tried first by Authorization Decisioning. Every card has at - * least one funding source. + * Internal account ids to bind as funding sources, in priority order. The first + * entry is tried first by Authorization Decisioning. Every card must be bound to + * at least one source, and every source must belong to the cardholder and be + * denominated in a card-eligible currency (USDB in v1); otherwise the request is + * rejected with `FUNDING_SOURCE_INELIGIBLE`. */ fundingSources: Array; /** - * Lifecycle state of a card. - * - * | State | Description | - * | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | - * | `PENDING_ISSUE` | The card has been requested and is being provisioned with the issuer. | - * | `ACTIVE` | The card is live and can authorize transactions. | - * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | - * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | + * Optional platform-specific card identifier. System-generated when omitted, + * mirroring `platformCustomerId` semantics. */ - state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; + platformCardId?: string; +} +export interface CardListResponse { /** - * Last update timestamp + * List of cards matching the filter criteria */ - updatedAt: string; + data: Array; /** - * Card network brand. Read-only — determined by Grid when the card is provisioned - * with the issuer. + * Indicates if more results are available beyond this page */ - brand?: 'VISA' | 'MASTERCARD'; + hasMore: boolean; /** - * Currency the card transacts in (ISO 4217 for fiat, tickers for crypto). Derived - * from the funding sources at issue time — all funding sources bound to a card - * must be denominated in the same card-eligible currency. + * Cursor to retrieve the next page of results (only present if hasMore is true) */ - currency?: string; + nextCursor?: string; /** - * Card expiration month (1–12). + * Total number of cards matching the criteria (excluding pagination) */ - expMonth?: number; + totalCount?: number; +} +/** + * Parent transaction row for a card authorization and all of the pulls / + * settlements / refunds that reconcile against it. Child events are rolled up into + * the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. + * Delivered as the payload of the generic transaction webhook stream (extends the + * Transaction model with a card destination type) on every transition. + */ +export interface CardTransaction { /** - * Card expiration year (four digits). + * System-generated unique card transaction identifier */ - expYear?: number; + id: string; /** - * Opaque identifier for the card on the underlying issuer. Useful for - * cross-referencing in issuer dashboards; not used for any Grid request routing. + * Internal account id that funded this transaction (the funding source selected by + * Authorization Decisioning at auth time). */ - issuerRef?: string; + accountId: string; - /** - * Last four digits of the card PAN. - */ - last4?: string; + authorizedAmount: InvitationsAPI.CurrencyAmount; /** - * URL of the card issuer's iframe that securely displays the PAN, CVV, and expiry - * to the cardholder. The full PAN and CVV never cross Grid's servers — render this - * URL in an iframe in your client to reveal card details. + * When the auth was approved. */ - panEmbedUrl?: string; + authorizedAt: string; /** - * Platform-specific card identifier. Optional on create — system-generated if - * omitted, mirroring `platformCustomerId` semantics. + * Creation timestamp (same as `authorizedAt` for card transactions). */ - platformCardId?: string; - - /** - * Reason associated with the current `state`. Populated when the card is `CLOSED` - * or when provisioning was rejected; otherwise null. - */ - stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID' | null; -} + createdAt: string; -export interface CardIssueResponse { /** - * System-generated unique card identifier + * System ID of the customer (cardholder) this transaction belongs to. */ - id: string; + customerId: string; /** - * The id of the `Customer` who holds this card. + * Card transactions debit the customer's account. */ - cardholderId: string; + direction: 'CREDIT' | 'DEBIT'; - /** - * Creation timestamp - */ - createdAt: string; + merchant: SimulateAPI.CardMerchant; /** - * Physical form factor of the card. Only `VIRTUAL` is supported in v1; `PHYSICAL` - * will be added in a later release. + * Platform-specific ID of the customer (cardholder) this transaction belongs to. */ - form: 'VIRTUAL'; + platformCustomerId: string; /** - * Internal account ids bound to this card as funding sources, in priority order — - * the first entry is tried first by Authorization Decisioning. Every card has at - * least one funding source. + * Lifecycle status of a card transaction. + * + * | Status | Description | + * | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `AUTHORIZED` | The auth has been approved and a hold placed on the funding source; no clearing has arrived yet. | + * | `PARTIALLY_SETTLED` | At least one clearing has arrived and posted, but more clearings are still expected (split shipments, tips, multi-leg trips). | + * | `SETTLED` | All clearings for the auth have posted and the transaction is closed against the funding source. | + * | `REFUNDED` | A `RETURN` was received from the merchant; the net settled amount has been refunded in part or whole. | + * | `EXCEPTION` | The transaction settled to the card network but the corresponding pull from the funding source failed (e.g. balance no longer covers the post-hoc clearing). Surfaces high-urgency alerts and is the dashboard query for stuck reconciliations. | */ - fundingSources: Array; + status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; /** - * Lifecycle state of a card. - * - * | State | Description | - * | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | - * | `PENDING_ISSUE` | The card has been requested and is being provisioned with the issuer. | - * | `ACTIVE` | The card is live and can authorize transactions. | - * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | - * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | + * Discriminator identifying this transaction as a card transaction in the + * `Transaction` list. */ - state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; + type: 'CARD'; /** - * Last update timestamp + * Last update timestamp. */ updatedAt: string; /** - * Card network brand. Read-only — determined by Grid when the card is provisioned - * with the issuer. + * The id of the `Card` this transaction was made on. */ - brand?: 'VISA' | 'MASTERCARD'; + cardId?: string; /** - * Currency the card transacts in (ISO 4217 for fiat, tickers for crypto). Derived - * from the funding sources at issue time — all funding sources bound to a card - * must be denominated in the same card-eligible currency. + * Opaque identifier for the transaction on the underlying issuer. Used to + * cross-reference Grid records against issuer dashboards and webhooks. */ - currency?: string; + issuerTransactionToken?: string; /** - * Card expiration month (1–12). + * Timestamp of the most recent reconcile event (pull / clearing / refund) against + * this transaction. */ - expMonth?: number; + lastEventAt?: string; - /** - * Card expiration year (four digits). - */ - expYear?: number; + pullSummary?: SimulateAPI.CardPullSummary; - /** - * Opaque identifier for the card on the underlying issuer. Useful for - * cross-referencing in issuer dashboards; not used for any Grid request routing. - */ - issuerRef?: string; + refundedAmount?: InvitationsAPI.CurrencyAmount; - /** - * Last four digits of the card PAN. - */ - last4?: string; + refundSummary?: SimulateAPI.CardRefundSummary; - /** - * URL of the card issuer's iframe that securely displays the PAN, CVV, and expiry - * to the cardholder. The full PAN and CVV never cross Grid's servers — render this - * URL in an iframe in your client to reveal card details. - */ - panEmbedUrl?: string; + settledAmount?: InvitationsAPI.CurrencyAmount; + settlementSummary?: SimulateAPI.CardSettlementSummary; +} + +/** + * Update request for `PATCH /cards/{id}`. At least one of `state` or + * `fundingSources` must be supplied. `state` transitions are limited to + * `ACTIVE ⇄ FROZEN` and `ACTIVE | FROZEN → CLOSED`; any other transition returns + * `409 INVALID_STATE_TRANSITION`. `CLOSED` is terminal and irreversible and cannot + * be combined with `fundingSources`. `fundingSources`, when supplied, fully + * replaces the card's bound funding sources — the array order determines the + * priority Authorization Decisioning tries them in. + */ +export interface CardUpdateRequest { /** - * Platform-specific card identifier. Optional on create — system-generated if - * omitted, mirroring `platformCustomerId` semantics. + * New ordered list of internal account ids to bind as funding sources. Fully + * replaces the previous binding. Each id must belong to the cardholder and be + * denominated in the card's currency. The list must contain at least one source — + * to stop a card from spending without removing all sources, transition it to + * `FROZEN` instead. Cannot be supplied alongside `state: CLOSED`. */ - platformCardId?: string; + fundingSources?: Array; /** - * Reason associated with the current `state`. Populated when the card is `CLOSED` - * or when provisioning was rejected; otherwise null. + * Target state for the card. Permitted transitions are `ACTIVE ⇄ FROZEN` and + * `ACTIVE | FROZEN → CLOSED`. `CLOSED` is terminal and irreversible; once closed, + * the card stays in the system for audit and reconciliation but cannot transact + * again. */ - stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID' | null; + state?: 'ACTIVE' | 'FROZEN' | 'CLOSED'; } export interface CardUpdateParams { @@ -615,7 +505,7 @@ export interface CardListParams extends DefaultPaginationParams { /** * Filter by card state. */ - state?: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; + state?: 'PENDING_KYC' | 'PROCESSING' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; } export interface CardIssueParams { @@ -650,11 +540,12 @@ export interface CardIssueParams { export declare namespace Cards { export { - type CardRetrieveResponse as CardRetrieveResponse, - type CardUpdateResponse as CardUpdateResponse, + type Card as Card, + type CardCreateRequest as CardCreateRequest, type CardListResponse as CardListResponse, - type CardIssueResponse as CardIssueResponse, - type CardListResponsesDefaultPagination as CardListResponsesDefaultPagination, + type CardTransaction as CardTransaction, + type CardUpdateRequest as CardUpdateRequest, + type CardsDefaultPagination as CardsDefaultPagination, type CardUpdateParams as CardUpdateParams, type CardListParams as CardListParams, type CardIssueParams as CardIssueParams, diff --git a/src/resources/config.ts b/src/resources/config.ts index ca75f9bc..879618a5 100644 --- a/src/resources/config.ts +++ b/src/resources/config.ts @@ -80,7 +80,9 @@ export type CustomerInfoFieldName = | 'ULTIMATE_INSTITUTION_COUNTRY' | 'IDENTIFIER' | 'BUSINESS_TYPE' - | 'COMPANY_LEGAL_NAME'; + | 'COMPANY_LEGAL_NAME' + | 'ID_TYPE' + | 'ID_NUMBER'; /** * Per-platform embedded-wallet configuration. Controls branding and OTP behavior @@ -181,6 +183,21 @@ export interface PlatformConfig { webhookEndpoint?: string; } +export interface PlatformConfigUpdateRequest { + /** + * Update or create the embedded-wallet configuration for this platform. Fields + * omitted from the nested object are left unchanged. Omit this field at the top + * level to leave the embedded-wallet configuration unchanged entirely. + */ + embeddedWalletConfig?: EmbeddedWalletConfig; + + supportedCurrencies?: Array; + + umaDomain?: string; + + webhookEndpoint?: string; +} + export interface PlatformCurrencyConfig { /** * Three-letter currency code (ISO 4217) @@ -246,6 +263,7 @@ export declare namespace Config { type CustomerInfoFieldName as CustomerInfoFieldName, type EmbeddedWalletConfig as EmbeddedWalletConfig, type PlatformConfig as PlatformConfig, + type PlatformConfigUpdateRequest as PlatformConfigUpdateRequest, type PlatformCurrencyConfig as PlatformCurrencyConfig, type ConfigUpdateParams as ConfigUpdateParams, }; diff --git a/src/resources/crypto.ts b/src/resources/crypto.ts index 4bbdea24..5f01ec65 100644 --- a/src/resources/crypto.ts +++ b/src/resources/crypto.ts @@ -15,21 +15,22 @@ export class Crypto extends APIResource { * * @example * ```ts - * const response = await client.crypto.estimateWithdrawalFee({ - * amount: 1000000, - * cryptoNetwork: 'SOLANA', - * currency: 'USDC', - * destinationAddress: - * '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU', - * internalAccountId: - * 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', - * }); + * const estimateCryptoWithdrawalFeeResponse = + * await client.crypto.estimateWithdrawalFee({ + * amount: 1000000, + * cryptoNetwork: 'SOLANA', + * currency: 'USDC', + * destinationAddress: + * '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU', + * internalAccountId: + * 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', + * }); * ``` */ estimateWithdrawalFee( body: CryptoEstimateWithdrawalFeeParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post('/crypto/estimate-withdrawal-fee', { body, ...options, @@ -38,7 +39,35 @@ export class Crypto extends APIResource { } } -export interface CryptoEstimateWithdrawalFeeResponse { +export interface EstimateCryptoWithdrawalFeeRequest { + /** + * The amount to withdraw in the smallest unit of the currency. + */ + amount: number; + + /** + * The blockchain network for the withdrawal. Example values: SOLANA, ETHEREUM, + * BASE, POLYGON, SPARK, LIGHTNING, BITCOIN. + */ + cryptoNetwork: string; + + /** + * The currency code of the asset to withdraw (e.g. USDC). + */ + currency: string; + + /** + * The blockchain address to withdraw funds to. + */ + destinationAddress: string; + + /** + * The ID of the crypto internal account to withdraw from. + */ + internalAccountId: string; +} + +export interface EstimateCryptoWithdrawalFeeResponse { /** * The application fee charged by the platform in the smallest unit of the * withdrawal currency. Zero if no application fee applies. @@ -104,7 +133,8 @@ export interface CryptoEstimateWithdrawalFeeParams { export declare namespace Crypto { export { - type CryptoEstimateWithdrawalFeeResponse as CryptoEstimateWithdrawalFeeResponse, + type EstimateCryptoWithdrawalFeeRequest as EstimateCryptoWithdrawalFeeRequest, + type EstimateCryptoWithdrawalFeeResponse as EstimateCryptoWithdrawalFeeResponse, type CryptoEstimateWithdrawalFeeParams as CryptoEstimateWithdrawalFeeParams, }; } diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts index 57573337..d52cb577 100644 --- a/src/resources/customers/customers.ts +++ b/src/resources/customers/customers.ts @@ -26,6 +26,7 @@ import { ExternalAccountCreateParams, ExternalAccountInfoOneOf, ExternalAccountListParams, + ExternalAccountListResponse, ExternalAccounts, ExternalAccountsDefaultPagination, GbpBeneficiary, @@ -91,12 +92,12 @@ export class Customers extends APIResource { * * @example * ```ts - * const customer = await client.customers.create({ + * const customerOneOf = await client.customers.create({ * CreateCustomerRequest: { customerType: 'INDIVIDUAL' }, * }); * ``` */ - create(params: CustomerCreateParams, options?: RequestOptions): APIPromise { + create(params: CustomerCreateParams, options?: RequestOptions): APIPromise { const { CreateCustomerRequest } = params; return this._client.post('/customers', { body: CreateCustomerRequest, @@ -110,12 +111,12 @@ export class Customers extends APIResource { * * @example * ```ts - * const customer = await client.customers.retrieve( + * const customerOneOf = await client.customers.retrieve( * 'customerId', * ); * ``` */ - retrieve(customerID: string, options?: RequestOptions): APIPromise { + retrieve(customerID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/customers/${customerID}`, { ...options, __security: { basicAuth: true } }); } @@ -124,19 +125,24 @@ export class Customers extends APIResource { * * Most customer updates complete synchronously and return `200` with the updated * customer. If the request changes `email` for a customer that has one or more - * tied Embedded Wallet internal accounts with `EMAIL_OTP` credentials, the email - * change uses the two-step signed-retry flow so the customer's wallet session - * authorizes the authentication credential update. On the signed retry, Grid - * updates the customer email and every tied `EMAIL_OTP` credential across all tied - * Embedded Wallets as one logical operation. If any tied credential cannot be - * updated, the customer email is not changed. + * tied Embedded Wallet internal accounts with `EMAIL_OTP` credentials, or changes + * `phoneNumber` for a customer that has one or more tied Embedded Wallet internal + * accounts with `SMS_OTP` credentials, the contact update uses the two-step + * signed-retry flow so the customer's wallet session authorizes the authentication + * credential update. On the signed retry, Grid updates the customer contact field + * and every tied matching OTP credential across all tied Embedded Wallets as one + * logical operation. If any tied credential cannot be updated, the customer + * contact field is not changed. * - * For an Embedded Wallet email update: + * Update `email` and `phoneNumber` in separate PATCH calls. A request that + * includes both fields is rejected. + * + * For an Embedded Wallet email or SMS auth phone update: * * 1. Call `PATCH /customers/{customerId}` with the full update body and no * signature headers. Grid returns `202` with `payloadToSign`, `requestId`, and * `expiresAt`. The pending challenge binds the submitted update fields and the - * set of tied Embedded Wallet email OTP credentials that must be updated. + * set of tied Embedded Wallet OTP credentials that must be updated. * * 2. Use the session API keypair of a verified authentication credential on one of * the customer's tied Embedded Wallets to build an API-key stamp over @@ -148,7 +154,7 @@ export class Customers extends APIResource { * * @example * ```ts - * const customer = await client.customers.update( + * const customerOneOf = await client.customers.update( * 'customerId', * { UpdateCustomerRequest: { customerType: 'INDIVIDUAL' } }, * ); @@ -158,7 +164,7 @@ export class Customers extends APIResource { customerID: string, params: CustomerUpdateParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { const { UpdateCustomerRequest, 'Grid-Wallet-Signature': gridWalletSignature, @@ -186,7 +192,7 @@ export class Customers extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const customerListResponse of client.customers.list()) { + * for await (const customerOneOf of client.customers.list()) { * // ... * } * ``` @@ -194,8 +200,8 @@ export class Customers extends APIResource { list( query: CustomerListParams | null | undefined = {}, options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/customers', DefaultPagination, { + ): PagePromise { + return this._client.getAPIList('/customers', DefaultPagination, { query, ...options, __security: { basicAuth: true }, @@ -207,18 +213,54 @@ export class Customers extends APIResource { * * @example * ```ts - * const customer = await client.customers.delete( + * const customerOneOf = await client.customers.delete( * 'customerId', * ); * ``` */ - delete(customerID: string, options?: RequestOptions): APIPromise { + delete(customerID: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/customers/${customerID}`, { ...options, __security: { basicAuth: true }, }); } + /** + * Generate a single-use hosted URL the customer can complete to verify their + * identity, and (where supported) a provider-specific `token` for embedding the + * verification flow directly via the provider's SDK. + * + * The customer must already exist — create them with `POST /customers` first. + * Calling this endpoint does not change the customer's `kycStatus`; the customer + * remains `PENDING` until they complete (or fail) the hosted flow. + * + * Each call returns a fresh link. Previously-issued links are not invalidated, but + * they remain single-use and will expire on their own. For request-level retry + * safety, include an `Idempotency-Key` header. + * + * @example + * ```ts + * const kycLinkResponse = + * await client.customers.createKYCLink('customerId'); + * ``` + */ + createKYCLink( + customerID: string, + params: CustomerCreateKYCLinkParams | null | undefined = undefined, + options?: RequestOptions, + ): APIPromise { + const { KycLinkCreateRequest, 'Idempotency-Key': idempotencyKey } = params ?? {}; + return this._client.post(path`/customers/${customerID}/kyc-link`, { + body: KycLinkCreateRequest, + ...options, + headers: buildHeaders([ + { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) }, + options?.headers, + ]), + __security: { basicAuth: true }, + }); + } + /** * Export the wallet credentials of an Embedded Wallet internal account. The * returned wallet credentials are HPKE-encrypted to the `clientPublicKey` supplied @@ -249,17 +291,18 @@ export class Customers extends APIResource { * * @example * ```ts - * const response = await client.customers.export('id', { - * clientPublicKey: - * '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', - * }); + * const internalAccountExportResponse = + * await client.customers.export('id', { + * clientPublicKey: + * '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + * }); * ``` */ export( id: string, params: CustomerExportParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { const { 'Grid-Wallet-Signature': gridWalletSignature, 'Request-Id': requestID, ...body } = params; return this._client.post(path`/internal-accounts/${id}/export`, { body, @@ -275,43 +318,6 @@ export class Customers extends APIResource { }); } - /** - * Generate a single-use hosted URL the customer can complete to verify their - * identity, and (where supported) a provider-specific `token` for embedding the - * verification flow directly via the provider's SDK. - * - * The customer must already exist — create them with `POST /customers` first. - * Calling this endpoint does not change the customer's `kycStatus`; the customer - * remains `PENDING` until they complete (or fail) the hosted flow. - * - * Each call returns a fresh link. Previously-issued links are not invalidated, but - * they remain single-use and will expire on their own. For request-level retry - * safety, include an `Idempotency-Key` header. - * - * @example - * ```ts - * const response = await client.customers.generateKYCLink( - * 'customerId', - * ); - * ``` - */ - generateKYCLink( - customerID: string, - params: CustomerGenerateKYCLinkParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - const { 'Idempotency-Key': idempotencyKey, ...body } = params ?? {}; - return this._client.post(path`/customers/${customerID}/kyc-link`, { - body, - ...options, - headers: buildHeaders([ - { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) }, - options?.headers, - ]), - __security: { basicAuth: true }, - }); - } - /** * Retrieve a list of internal accounts with optional filtering parameters. Returns * all internal accounts that match the specified filters. If no filters are @@ -361,7 +367,7 @@ export class Customers extends APIResource { * const internalAccount = * await client.customers.updateInternalAccount( * 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002', - * { privateEnabled: true }, + * { InternalAccountUpdateRequest: {} }, * ); * ``` */ @@ -370,9 +376,13 @@ export class Customers extends APIResource { params: CustomerUpdateInternalAccountParams, options?: RequestOptions, ): APIPromise { - const { 'Grid-Wallet-Signature': gridWalletSignature, 'Request-Id': requestID, ...body } = params; + const { + InternalAccountUpdateRequest, + 'Grid-Wallet-Signature': gridWalletSignature, + 'Request-Id': requestID, + } = params; return this._client.patch(path`/internal-accounts/${id}`, { - body, + body: InternalAccountUpdateRequest, ...options, headers: buildHeaders([ { @@ -386,460 +396,857 @@ export class Customers extends APIResource { } } -export type CustomerListResponsesDefaultPagination = DefaultPagination; - -export type CustomerCreateResponse = Shared.IndividualCustomer | Shared.BusinessCustomer; +export type CustomerOneovesDefaultPagination = DefaultPagination; -export type CustomerRetrieveResponse = Shared.IndividualCustomer | Shared.BusinessCustomer; +export interface BusinessCustomerCreateRequest { + customerType: 'BUSINESS'; -export type CustomerUpdateResponse = Shared.IndividualCustomer | Shared.BusinessCustomer; + address?: ExternalAccountsAPI.Address; -export type CustomerListResponse = Shared.IndividualCustomer | Shared.BusinessCustomer; - -export type CustomerDeleteResponse = Shared.IndividualCustomer | Shared.BusinessCustomer; + /** + * Additional information required for business entities + */ + businessInfo?: BusinessCustomerCreateRequest.BusinessInfo; -export interface CustomerExportResponse { /** - * The id of the internal account that was exported. + * List of currency codes the customer will use (ISO 4217 for fiat, e.g. "USD", + * "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Required if the customer will + * use more than one sending currency, since the correct currencies cannot always + * be inferred. If not provided, currencies will be inferred from the customer's + * region. Some currency combinations may require separate customers — if so, the + * request will be rejected with details. */ - id: string; + currencies?: Array; /** - * Encrypted wallet mnemonic, sealed to the `clientPublicKey` from the request body - * using HPKE: DHKEM(P-256, HKDF-SHA256) + HKDF-SHA256 + AES-256-GCM. Decrypt with - * the matching private key, then manage the mnemonic securely because it is the - * master key of the self-custodial Embedded Wallet. The value is a JSON string of - * the form - * `{"version": "v1.0.0", "data": "", "dataSignature": "", "enclaveQuorumPublic": ""}`. - * `data` hex-decodes to JSON - * `{"encappedPublic": "", "ciphertext": "", "organizationId": ""}`, - * where `encappedPublic` is the uncompressed SEC1 ephemeral public key. - * `dataSignature` is an ECDSA-P256-SHA256 signature over the `data` bytes produced - * by the issuer key in `enclaveQuorumPublic`; verify before decrypting. In - * sandbox, `dataSignature` and `enclaveQuorumPublic` are empty strings. Clients - * should bypass attestation verification when calling against sandbox. + * Email address for the customer. */ - encryptedWalletCredentials: string; -} + email?: string; -/** - * A hosted KYC link that the customer can complete to verify their identity. - */ -export interface CustomerGenerateKYCLinkResponse { /** - * Time at which the hosted link expires and can no longer be used. + * The current KYB status of a business customer. `HOLD` means the customer is + * placed on hold and may be required to update or provide more information. */ - expiresAt: string; + kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; /** - * Hosted URL the customer should be sent to in order to complete verification. The - * URL is single-use and expires at `expiresAt`. To generate a new link (for - * example, after the previous one expires or is abandoned), call this endpoint - * again. + * Phone number for the customer in strict E.164 format. */ - kycUrl: string; + phoneNumber?: string; /** - * The KYC provider that will perform identity verification for the customer. Grid - * selects the provider based on the customer's region and platform configuration; - * the value is informational for platforms that want to integrate directly with - * the provider's SDK. + * Platform-specific customer identifier. If not provided, one will be generated by + * the system. */ - provider: 'SUMSUB'; + platformCustomerId?: string; /** - * Provider-specific token that can be used in place of the hosted URL — for - * example, to embed the provider's SDK directly in your application. Only returned - * for providers that support direct SDK integration. Whether to use the hosted URL - * or the embedded SDK is up to you; both flows result in the same `kycStatus` - * update on the customer. + * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity. + * This determines the regulatory jurisdiction and KYC requirements for the + * customer. Required if the customer will use currencies with different KYC + * requirements across regions. A customer with accounts in multiple regions should + * be registered as separate customers. This field is immutable after creation. */ - token?: string; -} + region?: string; -export interface CustomerCreateParams { - CreateCustomerRequest: - | CustomerCreateParams.IndividualCustomerCreateRequest - | CustomerCreateParams.BusinessCustomerCreateRequest; + /** + * Optional UMA address identifier. If not provided during customer creation, one + * will be generated by the system. If provided during customer update, the UMA + * address will be updated to the provided value. This is an optional identifier to + * route payments to the customer. This is an optional identifier to route payments + * to the customer. + */ + umaAddress?: string; } -export namespace CustomerCreateParams { - export interface IndividualCustomerCreateRequest { - customerType: 'INDIVIDUAL'; - - address?: ExternalAccountsAPI.Address; - +export namespace BusinessCustomerCreateRequest { + /** + * Additional information required for business entities + */ + export interface BusinessInfo { /** - * Date of birth in ISO 8601 format (YYYY-MM-DD) + * Date of incorporation in ISO 8601 format (YYYY-MM-DD) */ - birthDate?: string; + incorporatedOn: string; /** - * List of currency codes the customer will use (ISO 4217 for fiat, e.g. "USD", - * "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Required if the customer will - * use more than one sending currency, since the correct currencies cannot always - * be inferred. If not provided, currencies will be inferred from the customer's - * region. Some currency combinations may require separate customers — if so, the - * request will be rejected with details. + * Legal name of the business */ - currencies?: Array; + legalName: string; /** - * Email address for the customer. + * Tax identification number */ - email?: string; + taxId: string; /** - * Individual's full name + * The high-level industry category of the business */ - fullName?: string; + businessType?: + | 'AGRICULTURE_FORESTRY_FISHING_AND_HUNTING' + | 'MINING_QUARRYING_AND_OIL_AND_GAS_EXTRACTION' + | 'UTILITIES' + | 'CONSTRUCTION' + | 'MANUFACTURING' + | 'WHOLESALE_TRADE' + | 'RETAIL_TRADE' + | 'TRANSPORTATION_AND_WAREHOUSING' + | 'INFORMATION' + | 'FINANCE_AND_INSURANCE' + | 'REAL_ESTATE_AND_RENTAL_AND_LEASING' + | 'PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_SERVICES' + | 'MANAGEMENT_OF_COMPANIES_AND_ENTERPRISES' + | 'ADMINISTRATIVE_AND_SUPPORT_AND_WASTE_MANAGEMENT_AND_REMEDIATION_SERVICES' + | 'EDUCATIONAL_SERVICES' + | 'HEALTH_CARE_AND_SOCIAL_ASSISTANCE' + | 'ARTS_ENTERTAINMENT_AND_RECREATION' + | 'ACCOMMODATION_AND_FOOD_SERVICES' + | 'OTHER_SERVICES' + | 'PUBLIC_ADMINISTRATION'; /** - * The current KYC status of a customer + * List of countries where the business operates (ISO 3166-1 alpha-2) */ - kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; + countriesOfOperation?: Array; /** - * Country code (ISO 3166-1 alpha-2) + * Country of incorporation or registration (ISO 3166-1 alpha-2) */ - nationality?: string; + country?: string; /** - * Platform-specific customer identifier. If not provided, one will be generated by - * the system. + * Trade name or DBA name of the business, if different from the legal name */ - platformCustomerId?: string; + doingBusinessAs?: string; /** - * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity. - * This determines the regulatory jurisdiction and KYC requirements for the - * customer. Required if the customer will use currencies with different KYC - * requirements across regions. A customer with accounts in multiple regions should - * be registered as separate customers. This field is immutable after creation. + * Legal entity type of the business */ - region?: string; + entityType?: + | 'SOLE_PROPRIETORSHIP' + | 'PARTNERSHIP' + | 'LLC' + | 'CORPORATION' + | 'S_CORPORATION' + | 'NON_PROFIT' + | 'OTHER'; /** - * Optional UMA address identifier. If not provided during customer creation, one - * will be generated by the system. If provided during customer update, the UMA - * address will be updated to the provided value. This is an optional identifier to - * route payments to the customer. This is an optional identifier to route payments - * to the customer. + * List of countries of the business's expected transaction counterparties (ISO + * 3166-1 alpha-2) */ - umaAddress?: string; - } + expectedCounterpartyCountries?: Array; - export interface BusinessCustomerCreateRequest { - customerType: 'BUSINESS'; + /** + * Expected number of transactions per month + */ + expectedMonthlyTransactionCount?: + | 'COUNT_UNDER_10' + | 'COUNT_10_TO_100' + | 'COUNT_100_TO_500' + | 'COUNT_500_TO_1000' + | 'COUNT_OVER_1000'; - address?: ExternalAccountsAPI.Address; + /** + * Expected total transaction volume per month in USD equivalent + */ + expectedMonthlyTransactionVolume?: + | 'VOLUME_UNDER_10K' + | 'VOLUME_10K_TO_100K' + | 'VOLUME_100K_TO_1M' + | 'VOLUME_1M_TO_10M' + | 'VOLUME_OVER_10M'; /** - * Additional information for business entities + * List of countries where the business expects to send payments (ISO 3166-1 + * alpha-2) */ - businessInfo?: BusinessCustomerCreateRequest.BusinessInfo; + expectedRecipientJurisdictions?: Array; /** - * List of currency codes the customer will use (ISO 4217 for fiat, e.g. "USD", - * "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Required if the customer will - * use more than one sending currency, since the correct currencies cannot always - * be inferred. If not provided, currencies will be inferred from the customer's - * region. Some currency combinations may require separate customers — if so, the - * request will be rejected with details. + * NAICS code describing the nature of the business (2-6 digits) */ - currencies?: Array; + naicsCode?: string; /** - * Email address for the customer. + * The intended purpose for using the Grid account */ - email?: string; + purposeOfAccount?: + | 'CONTRACTOR_PAYOUTS' + | 'CREATOR_PAYOUTS' + | 'EMPLOYEE_PAYOUTS' + | 'MARKETPLACE_SELLER_PAYOUTS' + | 'SUPPLIER_PAYMENTS' + | 'CROSS_BORDER_B2B' + | 'AR_AUTOMATION' + | 'AP_AUTOMATION' + | 'EMBEDDED_PAYMENTS' + | 'PLATFORM_FEE_COLLECTION' + | 'P2P_TRANSFERS' + | 'CHARITABLE_DONATIONS' + | 'OTHER'; /** - * The current KYB status of a business customer + * Description of the account purpose when OTHER is selected */ - kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; + purposeOfAccountOtherDescription?: string; /** - * Platform-specific customer identifier. If not provided, one will be generated by - * the system. + * Business registration number */ - platformCustomerId?: string; + registrationNumber?: string; /** - * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity. - * This determines the regulatory jurisdiction and KYC requirements for the - * customer. Required if the customer will use currencies with different KYC - * requirements across regions. A customer with accounts in multiple regions should - * be registered as separate customers. This field is immutable after creation. + * The primary source of funds for the business */ - region?: string; + sourceOfFunds?: string; /** - * Optional UMA address identifier. If not provided during customer creation, one - * will be generated by the system. If provided during customer update, the UMA - * address will be updated to the provided value. This is an optional identifier to - * route payments to the customer. This is an optional identifier to route payments - * to the customer. + * Structured source-of-funds categories for the business */ - umaAddress?: string; - } + sourceOfFundsCategories?: Array; - export namespace BusinessCustomerCreateRequest { /** - * Additional information for business entities + * Description of the source of funds when OTHER is selected */ - export interface BusinessInfo extends Shared.BusinessInfoUpdate { - /** - * Date of incorporation in ISO 8601 format (YYYY-MM-DD) - */ - incorporatedOn: string; - - /** - * Legal name of the business - */ - legalName: string; - - /** - * Tax identification number - */ - taxId: string; - - /** - * The high-level industry category of the business - */ - businessType?: - | 'AGRICULTURE_FORESTRY_FISHING_AND_HUNTING' - | 'MINING_QUARRYING_AND_OIL_AND_GAS_EXTRACTION' - | 'UTILITIES' - | 'CONSTRUCTION' - | 'MANUFACTURING' - | 'WHOLESALE_TRADE' - | 'RETAIL_TRADE' - | 'TRANSPORTATION_AND_WAREHOUSING' - | 'INFORMATION' - | 'FINANCE_AND_INSURANCE' - | 'REAL_ESTATE_AND_RENTAL_AND_LEASING' - | 'PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_SERVICES' - | 'MANAGEMENT_OF_COMPANIES_AND_ENTERPRISES' - | 'ADMINISTRATIVE_AND_SUPPORT_AND_WASTE_MANAGEMENT_AND_REMEDIATION_SERVICES' - | 'EDUCATIONAL_SERVICES' - | 'HEALTH_CARE_AND_SOCIAL_ASSISTANCE' - | 'ARTS_ENTERTAINMENT_AND_RECREATION' - | 'ACCOMMODATION_AND_FOOD_SERVICES' - | 'OTHER_SERVICES' - | 'PUBLIC_ADMINISTRATION'; - - /** - * List of countries where the business operates (ISO 3166-1 alpha-2) - */ - countriesOfOperation?: Array; - - /** - * Country of incorporation or registration (ISO 3166-1 alpha-2) - */ - country?: string; - - /** - * Trade name or DBA name of the business, if different from the legal name - */ - doingBusinessAs?: string; - - /** - * Legal entity type of the business - */ - entityType?: - | 'SOLE_PROPRIETORSHIP' - | 'PARTNERSHIP' - | 'LLC' - | 'CORPORATION' - | 'S_CORPORATION' - | 'NON_PROFIT' - | 'OTHER'; - - /** - * Expected number of transactions per month - */ - expectedMonthlyTransactionCount?: - | 'COUNT_UNDER_10' - | 'COUNT_10_TO_100' - | 'COUNT_100_TO_500' - | 'COUNT_500_TO_1000' - | 'COUNT_OVER_1000'; - - /** - * Expected total transaction volume per month in USD equivalent - */ - expectedMonthlyTransactionVolume?: - | 'VOLUME_UNDER_10K' - | 'VOLUME_10K_TO_100K' - | 'VOLUME_100K_TO_1M' - | 'VOLUME_1M_TO_10M' - | 'VOLUME_OVER_10M'; - - /** - * List of countries where the business expects to send payments (ISO 3166-1 - * alpha-2) - */ - expectedRecipientJurisdictions?: Array; - - /** - * The intended purpose for using the Grid account - */ - purposeOfAccount?: - | 'CONTRACTOR_PAYOUTS' - | 'CREATOR_PAYOUTS' - | 'EMPLOYEE_PAYOUTS' - | 'MARKETPLACE_SELLER_PAYOUTS' - | 'SUPPLIER_PAYMENTS' - | 'CROSS_BORDER_B2B' - | 'AR_AUTOMATION' - | 'AP_AUTOMATION' - | 'EMBEDDED_PAYMENTS' - | 'PLATFORM_FEE_COLLECTION' - | 'P2P_TRANSFERS' - | 'CHARITABLE_DONATIONS' - | 'OTHER'; - - /** - * Business registration number - */ - registrationNumber?: string; - - /** - * The primary source of funds for the business - */ - sourceOfFunds?: string; - } + sourceOfFundsOtherDescription?: string; } } -export interface CustomerUpdateParams { +/** + * Request body for `PATCH /customers/{customerId}`. When `email` changes for a + * customer with tied Embedded Wallet internal accounts, Grid updates the customer + * email and every tied `EMAIL_OTP` credential through the endpoint's signed-retry + * flow. When `phoneNumber` changes for a customer with tied Embedded Wallet + * internal accounts, Grid updates the customer phone number and every tied + * `SMS_OTP` credential through the same signed-retry flow. Update `email` and + * `phoneNumber` in separate PATCH calls. + */ +export interface BusinessCustomerUpdateRequest { + customerType: 'BUSINESS'; + + address?: ExternalAccountsAPI.Address; + /** - * Body param: Request body for `PATCH /customers/{customerId}`. When `email` - * changes for a customer with tied Embedded Wallet internal accounts, Grid updates - * the customer email and every tied `EMAIL_OTP` credential across all tied - * Embedded Wallets through the endpoint's signed-retry flow. + * Additional information for business entities */ - UpdateCustomerRequest: - | CustomerUpdateParams.IndividualCustomerUpdateRequest - | CustomerUpdateParams.BusinessCustomerUpdateRequest; + businessInfo?: BusinessCustomerUpdateRequest.BusinessInfo; /** - * Header param: Full API-key stamp built over the prior `payloadToSign` with the - * session API keypair of a verified authentication credential on one of the - * customer's tied Embedded Wallets. Required on the signed retry for Embedded - * Wallet email updates; ignored on the initial call and on customer updates that - * complete synchronously. + * Updated list of currency codes the customer will use (ISO 4217 for fiat, e.g. + * "USD", "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Replaces the existing + * list. Some currency combinations may require separate customers — if so, the + * request will be rejected with details. */ - 'Grid-Wallet-Signature'?: string; + currencies?: Array; /** - * Header param: The `requestId` returned in a prior `202` response, echoed back on - * the signed retry so the server can correlate it with the issued challenge. - * Required on the signed retry for Embedded Wallet email updates; must be paired - * with `Grid-Wallet-Signature`. + * Email address for the customer. For customers with tied Embedded Wallet internal + * accounts, changing this value also updates every tied `EMAIL_OTP` credential + * across all tied Embedded Wallets. */ - 'Request-Id'?: string; + email?: string; + + /** + * The current KYB status of a business customer. `HOLD` means the customer is + * placed on hold and may be required to update or provide more information. + */ + kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; + + /** + * Phone number for the customer in strict E.164 format. For customers with tied + * Embedded Wallet internal accounts, changing this value also updates every tied + * `SMS_OTP` credential across all tied Embedded Wallets. Send phone number and + * email updates as separate PATCH calls. + */ + phoneNumber?: string; + + /** + * Optional UMA address identifier. If provided, the customer's UMA address will be + * updated. This is an optional identifier to route payments to the customer. + */ + umaAddress?: string; } -export namespace CustomerUpdateParams { +export namespace BusinessCustomerUpdateRequest { /** - * Request body for `PATCH /customers/{customerId}`. When `email` changes for a - * customer with tied Embedded Wallet internal accounts, Grid updates the customer - * email and every tied `EMAIL_OTP` credential across all tied Embedded Wallets - * through the endpoint's signed-retry flow. + * Additional information for business entities */ - export interface IndividualCustomerUpdateRequest { - customerType: 'INDIVIDUAL'; + export interface BusinessInfo { + /** + * The high-level industry category of the business + */ + businessType?: + | 'AGRICULTURE_FORESTRY_FISHING_AND_HUNTING' + | 'MINING_QUARRYING_AND_OIL_AND_GAS_EXTRACTION' + | 'UTILITIES' + | 'CONSTRUCTION' + | 'MANUFACTURING' + | 'WHOLESALE_TRADE' + | 'RETAIL_TRADE' + | 'TRANSPORTATION_AND_WAREHOUSING' + | 'INFORMATION' + | 'FINANCE_AND_INSURANCE' + | 'REAL_ESTATE_AND_RENTAL_AND_LEASING' + | 'PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_SERVICES' + | 'MANAGEMENT_OF_COMPANIES_AND_ENTERPRISES' + | 'ADMINISTRATIVE_AND_SUPPORT_AND_WASTE_MANAGEMENT_AND_REMEDIATION_SERVICES' + | 'EDUCATIONAL_SERVICES' + | 'HEALTH_CARE_AND_SOCIAL_ASSISTANCE' + | 'ARTS_ENTERTAINMENT_AND_RECREATION' + | 'ACCOMMODATION_AND_FOOD_SERVICES' + | 'OTHER_SERVICES' + | 'PUBLIC_ADMINISTRATION'; - address?: ExternalAccountsAPI.Address; + /** + * List of countries where the business operates (ISO 3166-1 alpha-2) + */ + countriesOfOperation?: Array; /** - * Date of birth in ISO 8601 format (YYYY-MM-DD) + * Country of incorporation or registration (ISO 3166-1 alpha-2) */ - birthDate?: string; + country?: string; /** - * Updated list of currency codes the customer will use (ISO 4217 for fiat, e.g. - * "USD", "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Replaces the existing - * list. Some currency combinations may require separate customers — if so, the - * request will be rejected with details. + * Trade name or DBA name of the business, if different from the legal name */ - currencies?: Array; + doingBusinessAs?: string; /** - * Email address for the customer. For customers with tied Embedded Wallet internal - * accounts, changing this value also updates every tied `EMAIL_OTP` credential - * across all tied Embedded Wallets. + * Legal entity type of the business */ - email?: string; + entityType?: + | 'SOLE_PROPRIETORSHIP' + | 'PARTNERSHIP' + | 'LLC' + | 'CORPORATION' + | 'S_CORPORATION' + | 'NON_PROFIT' + | 'OTHER'; /** - * Individual's full name + * List of countries of the business's expected transaction counterparties (ISO + * 3166-1 alpha-2) */ - fullName?: string; + expectedCounterpartyCountries?: Array; /** - * The current KYC status of a customer + * Expected number of transactions per month */ - kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; + expectedMonthlyTransactionCount?: + | 'COUNT_UNDER_10' + | 'COUNT_10_TO_100' + | 'COUNT_100_TO_500' + | 'COUNT_500_TO_1000' + | 'COUNT_OVER_1000'; /** - * Country code (ISO 3166-1 alpha-2) + * Expected total transaction volume per month in USD equivalent */ - nationality?: string; + expectedMonthlyTransactionVolume?: + | 'VOLUME_UNDER_10K' + | 'VOLUME_10K_TO_100K' + | 'VOLUME_100K_TO_1M' + | 'VOLUME_1M_TO_10M' + | 'VOLUME_OVER_10M'; /** - * Optional UMA address identifier. If provided, the customer's UMA address will be - * updated. This is an optional identifier to route payments to the customer. + * List of countries where the business expects to send payments (ISO 3166-1 + * alpha-2) */ - umaAddress?: string; - } + expectedRecipientJurisdictions?: Array; - /** - * Request body for `PATCH /customers/{customerId}`. When `email` changes for a - * customer with tied Embedded Wallet internal accounts, Grid updates the customer - * email and every tied `EMAIL_OTP` credential across all tied Embedded Wallets - * through the endpoint's signed-retry flow. - */ - export interface BusinessCustomerUpdateRequest { - customerType: 'BUSINESS'; + /** + * Date of incorporation in ISO 8601 format (YYYY-MM-DD) + */ + incorporatedOn?: string; + + /** + * Legal name of the business + */ + legalName?: string; + + /** + * NAICS code describing the nature of the business (2-6 digits) + */ + naicsCode?: string; - address?: ExternalAccountsAPI.Address; + /** + * The intended purpose for using the Grid account + */ + purposeOfAccount?: + | 'CONTRACTOR_PAYOUTS' + | 'CREATOR_PAYOUTS' + | 'EMPLOYEE_PAYOUTS' + | 'MARKETPLACE_SELLER_PAYOUTS' + | 'SUPPLIER_PAYMENTS' + | 'CROSS_BORDER_B2B' + | 'AR_AUTOMATION' + | 'AP_AUTOMATION' + | 'EMBEDDED_PAYMENTS' + | 'PLATFORM_FEE_COLLECTION' + | 'P2P_TRANSFERS' + | 'CHARITABLE_DONATIONS' + | 'OTHER'; /** - * Additional information for business entities + * Description of the account purpose when OTHER is selected */ - businessInfo?: Shared.BusinessInfoUpdate; + purposeOfAccountOtherDescription?: string; /** - * Updated list of currency codes the customer will use (ISO 4217 for fiat, e.g. - * "USD", "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Replaces the existing - * list. Some currency combinations may require separate customers — if so, the - * request will be rejected with details. + * Business registration number */ - currencies?: Array; + registrationNumber?: string; /** - * Email address for the customer. For customers with tied Embedded Wallet internal - * accounts, changing this value also updates every tied `EMAIL_OTP` credential - * across all tied Embedded Wallets. + * The primary source of funds for the business */ - email?: string; + sourceOfFunds?: string; /** - * The current KYB status of a business customer + * Structured source-of-funds categories for the business */ - kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; + sourceOfFundsCategories?: Array< + | 'OPERATING_REVENUE' + | 'INVESTMENT_INCOME' + | 'LOANS' + | 'VENTURE_CAPITAL' + | 'PERSONAL_SAVINGS' + | 'DONATIONS' + | 'OTHER' + >; /** - * Optional UMA address identifier. If provided, the customer's UMA address will be - * updated. This is an optional identifier to route payments to the customer. + * Description of the source of funds when OTHER is selected */ - umaAddress?: string; + sourceOfFundsOtherDescription?: string; + + /** + * Tax identification number + */ + taxId?: string; } } +export interface Customer { + customerType: unknown; + + /** + * Platform-specific customer identifier + */ + platformCustomerId: string; + + /** + * Full UMA address (always present in responses, even if system-generated). This + * is an optional identifier to route payments to the customer. + */ + umaAddress: string; + + /** + * System-generated unique identifier + */ + id?: string; + + /** + * Email and phone verification state. **Only present when the customer's payment + * provider requires it** (e.g. EU customers); omitted otherwise. + */ + contactVerification?: Customer.ContactVerification; + + /** + * Creation timestamp + */ + createdAt?: string; + + /** + * List of currency codes enabled for this customer. + */ + currencies?: Array; + + /** + * Email address for the customer. + */ + email?: string; + + /** + * Whether the customer is marked as deleted + */ + isDeleted?: boolean; + + /** + * Phone number for the customer in strict E.164 format. + */ + phoneNumber?: string; + + /** + * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity + * and regulatory jurisdiction. + */ + region?: string; + + /** + * Last update timestamp + */ + updatedAt?: string; +} + +export namespace Customer { + /** + * Email and phone verification state. **Only present when the customer's payment + * provider requires it** (e.g. EU customers); omitted otherwise. + */ + export interface ContactVerification { + /** + * Verification status of the customer's email address. Present only when the + * provider requires email verification. + */ + email?: 'PENDING' | 'VERIFIED'; + + /** + * Verification status of the customer's phone number. Present only when the + * provider requires phone verification. + */ + phone?: 'PENDING' | 'VERIFIED'; + } +} + +export type CustomerCreateRequestOneOf = IndividualCustomerCreateRequest | BusinessCustomerCreateRequest; + +export interface CustomerListResponse { + /** + * List of customers matching the filter criteria + */ + data: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of customers matching the criteria (excluding pagination) + */ + totalCount?: number; +} + +export type CustomerOneOf = Shared.IndividualCustomer | Shared.BusinessCustomer; + +/** + * Request body for `PATCH /customers/{customerId}`. When `email` changes for a + * customer with tied Embedded Wallet internal accounts, Grid updates the customer + * email and every tied `EMAIL_OTP` credential through the endpoint's signed-retry + * flow. When `phoneNumber` changes for a customer with tied Embedded Wallet + * internal accounts, Grid updates the customer phone number and every tied + * `SMS_OTP` credential through the same signed-retry flow. Update `email` and + * `phoneNumber` in separate PATCH calls. + */ +export type CustomerUpdateRequestOneOf = IndividualCustomerUpdateRequest | BusinessCustomerUpdateRequest; + +export interface IndividualCustomerCreateRequest { + customerType: 'INDIVIDUAL'; + + address?: ExternalAccountsAPI.Address; + + /** + * Date of birth in ISO 8601 format (YYYY-MM-DD) + */ + birthDate?: string; + + /** + * List of currency codes the customer will use (ISO 4217 for fiat, e.g. "USD", + * "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Required if the customer will + * use more than one sending currency, since the correct currencies cannot always + * be inferred. If not provided, currencies will be inferred from the customer's + * region. Some currency combinations may require separate customers — if so, the + * request will be rejected with details. + */ + currencies?: Array; + + /** + * Email address for the customer. + */ + email?: string; + + /** + * Individual's full name + */ + fullName?: string; + + /** + * Type of tax identification + */ + idType?: 'SSN' | 'ITIN' | 'EIN' | 'NON_US_TAX_ID'; + + /** + * The current KYC status of a customer. `HOLD` means the customer is placed on + * hold and may be required to update or provide more information. + */ + kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; + + /** + * Country code (ISO 3166-1 alpha-2) + */ + nationality?: string; + + /** + * Phone number for the customer in strict E.164 format. + */ + phoneNumber?: string; + + /** + * Platform-specific customer identifier. If not provided, one will be generated by + * the system. + */ + platformCustomerId?: string; + + /** + * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity. + * This determines the regulatory jurisdiction and KYC requirements for the + * customer. Required if the customer will use currencies with different KYC + * requirements across regions. A customer with accounts in multiple regions should + * be registered as separate customers. This field is immutable after creation. + */ + region?: string; + + /** + * Optional UMA address identifier. If not provided during customer creation, one + * will be generated by the system. If provided during customer update, the UMA + * address will be updated to the provided value. This is an optional identifier to + * route payments to the customer. This is an optional identifier to route payments + * to the customer. + */ + umaAddress?: string; +} + +/** + * Request body for `PATCH /customers/{customerId}`. When `email` changes for a + * customer with tied Embedded Wallet internal accounts, Grid updates the customer + * email and every tied `EMAIL_OTP` credential through the endpoint's signed-retry + * flow. When `phoneNumber` changes for a customer with tied Embedded Wallet + * internal accounts, Grid updates the customer phone number and every tied + * `SMS_OTP` credential through the same signed-retry flow. Update `email` and + * `phoneNumber` in separate PATCH calls. + */ +export interface IndividualCustomerUpdateRequest { + customerType: 'INDIVIDUAL'; + + address?: ExternalAccountsAPI.Address; + + /** + * Date of birth in ISO 8601 format (YYYY-MM-DD) + */ + birthDate?: string; + + /** + * Updated list of currency codes the customer will use (ISO 4217 for fiat, e.g. + * "USD", "EUR"; tickers for crypto, e.g. "BTC", "USDC"). Replaces the existing + * list. Some currency combinations may require separate customers — if so, the + * request will be rejected with details. + */ + currencies?: Array; + + /** + * Email address for the customer. For customers with tied Embedded Wallet internal + * accounts, changing this value also updates every tied `EMAIL_OTP` credential + * across all tied Embedded Wallets. + */ + email?: string; + + /** + * Individual's full name + */ + fullName?: string; + + /** + * The current KYC status of a customer. `HOLD` means the customer is placed on + * hold and may be required to update or provide more information. + */ + kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; + + /** + * Country code (ISO 3166-1 alpha-2) + */ + nationality?: string; + + /** + * Phone number for the customer in strict E.164 format. For customers with tied + * Embedded Wallet internal accounts, changing this value also updates every tied + * `SMS_OTP` credential across all tied Embedded Wallets. Send phone number and + * email updates as separate PATCH calls. + */ + phoneNumber?: string; + + /** + * Optional UMA address identifier. If provided, the customer's UMA address will be + * updated. This is an optional identifier to route payments to the customer. + */ + umaAddress?: string; +} + +/** + * Request body for `POST /internal-accounts/{id}/export`. The `clientPublicKey` is + * required on both steps of the signed-retry flow. On step 1 Grid binds it into + * `payloadToSign` so the subsequent stamp in `Grid-Wallet-Signature` commits to + * the target pubkey; on step 2 the client echoes the same `clientPublicKey` back + * and Grid uses it to encrypt the wallet credentials returned in the `200` + * response. + */ +export interface InternalAccountExportRequest { + /** + * Fresh P-256 public key, uncompressed SEC1 hex — 130 hex chars where the first + * two are `04` (the uncompressed-point indicator). Generate a new keypair for each + * export and discard the private key after decrypting the response. + */ + clientPublicKey: string; +} + +export interface InternalAccountExportResponse { + /** + * The id of the internal account that was exported. + */ + id: string; + + /** + * Encrypted wallet mnemonic, sealed to the `clientPublicKey` from the request body + * using HPKE: DHKEM(P-256, HKDF-SHA256) + HKDF-SHA256 + AES-256-GCM. Decrypt with + * the matching private key, then manage the mnemonic securely because it is the + * master key of the self-custodial Embedded Wallet. The value is a JSON string of + * the form + * `{"version": "v1.0.0", "data": "", "dataSignature": "", "enclaveQuorumPublic": ""}`. + * `data` hex-decodes to JSON + * `{"encappedPublic": "", "ciphertext": "", "organizationId": ""}`, + * where `encappedPublic` is the uncompressed SEC1 ephemeral public key. + * `dataSignature` is an ECDSA-P256-SHA256 signature over the `data` bytes produced + * by the issuer key in `enclaveQuorumPublic`; verify before decrypting. In + * sandbox, `dataSignature` and `enclaveQuorumPublic` are empty strings. Clients + * should bypass attestation verification when calling against sandbox. + */ + encryptedWalletCredentials: string; +} + +export interface InternalAccountListResponse { + /** + * List of internal accounts matching the filter criteria + */ + data: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of customers matching the criteria (excluding pagination) + */ + totalCount?: number; +} + +/** + * Partial request body for `PATCH /internal-accounts/{id}`. At least one update + * field must be provided. On step 1 of the signed-retry flow Grid binds the + * submitted update fields into `payloadToSign`; on step 2 the client echoes the + * same fields back and Grid applies the update to the internal account. + */ +export interface InternalAccountUpdateRequest { + /** + * Whether wallet privacy should be enabled for the Embedded Wallet. + */ + privateEnabled?: boolean; +} + +/** + * Request body for generating a hosted KYC link for an existing customer. + */ +export interface KYCLinkCreateRequest { + /** + * URI the customer is redirected to after completing the hosted KYC flow. Must + * start with `https://` (or `http://` for local development). Embedded in the + * returned `kycUrl`. + */ + redirectUri?: string; +} + +/** + * A hosted KYC link that the customer can complete to verify their identity. + */ +export interface KYCLinkResponse { + /** + * Time at which the hosted link expires and can no longer be used. + */ + expiresAt: string; + + /** + * Hosted URL the customer should be sent to in order to complete verification. The + * URL is single-use and expires at `expiresAt`. To generate a new link (for + * example, after the previous one expires or is abandoned), call this endpoint + * again. + */ + kycUrl: string; + + /** + * The KYC provider that will perform identity verification for the customer. Grid + * selects the provider based on the customer's region and platform configuration; + * the value is informational for platforms that want to integrate directly with + * the provider's SDK. + */ + provider: 'SUMSUB'; + + /** + * Provider-specific token that can be used in place of the hosted URL — for + * example, to embed the provider's SDK directly in your application. Only returned + * for providers that support direct SDK integration. Whether to use the hosted URL + * or the embedded SDK is up to you; both flows result in the same `kycStatus` + * update on the customer. + */ + token?: string; +} + +export interface CustomerCreateParams { + CreateCustomerRequest: CustomerCreateRequestOneOf; +} + +export interface CustomerUpdateParams { + /** + * Body param: Request body for `PATCH /customers/{customerId}`. When `email` + * changes for a customer with tied Embedded Wallet internal accounts, Grid updates + * the customer email and every tied `EMAIL_OTP` credential through the endpoint's + * signed-retry flow. When `phoneNumber` changes for a customer with tied Embedded + * Wallet internal accounts, Grid updates the customer phone number and every tied + * `SMS_OTP` credential through the same signed-retry flow. Update `email` and + * `phoneNumber` in separate PATCH calls. + */ + UpdateCustomerRequest: CustomerUpdateRequestOneOf; + + /** + * Header param: Full API-key stamp built over the prior `payloadToSign` with the + * session API keypair of a verified authentication credential on one of the + * customer's tied Embedded Wallets. Required on the signed retry for Embedded + * Wallet email or SMS auth phone updates; ignored on the initial call and on + * customer updates that complete synchronously. + */ + 'Grid-Wallet-Signature'?: string; + + /** + * Header param: The `requestId` returned in a prior `202` response, echoed back on + * the signed retry so the server can correlate it with the issued challenge. + * Required on the signed retry for Embedded Wallet email or SMS auth phone + * updates; must be paired with `Grid-Wallet-Signature`. + */ + 'Request-Id'?: string; +} + export interface CustomerListParams extends DefaultPaginationParams { /** * Filter customers created after this timestamp (inclusive) @@ -898,6 +1305,20 @@ export interface CustomerListParams extends DefaultPaginationParams { updatedBefore?: string; } +export interface CustomerCreateKYCLinkParams { + /** + * Body param: Request body for generating a hosted KYC link for an existing + * customer. + */ + KycLinkCreateRequest?: KYCLinkCreateRequest; + + /** + * Header param: A unique identifier for the request. If the same key is sent + * multiple times, the server will return the same response as the first request. + */ + 'Idempotency-Key'?: string; +} + export interface CustomerExportParams { /** * Body param: Fresh P-256 public key, uncompressed SEC1 hex — 130 hex chars where @@ -923,21 +1344,6 @@ export interface CustomerExportParams { 'Request-Id'?: string; } -export interface CustomerGenerateKYCLinkParams { - /** - * Body param: URI the customer is redirected to after completing the hosted KYC - * flow. Must start with `https://` (or `http://` for local development). Embedded - * in the returned `kycUrl`. - */ - redirectUri?: string; - - /** - * Header param: A unique identifier for the request. If the same key is sent - * multiple times, the server will return the same response as the first request. - */ - 'Idempotency-Key'?: string; -} - export interface CustomerListInternalAccountsParams extends DefaultPaginationParams { /** * Filter by currency code @@ -964,9 +1370,12 @@ export interface CustomerListInternalAccountsParams extends DefaultPaginationPar export interface CustomerUpdateInternalAccountParams { /** - * Body param: Whether wallet privacy should be enabled for the Embedded Wallet. + * Body param: Partial request body for `PATCH /internal-accounts/{id}`. At least + * one update field must be provided. On step 1 of the signed-retry flow Grid binds + * the submitted update fields into `payloadToSign`; on step 2 the client echoes + * the same fields back and Grid applies the update to the internal account. */ - privateEnabled?: boolean; + InternalAccountUpdateRequest: InternalAccountUpdateRequest; /** * Header param: Full API-key stamp built over the prior `payloadToSign` with the @@ -988,19 +1397,27 @@ Customers.Bulk = Bulk; export declare namespace Customers { export { - type CustomerCreateResponse as CustomerCreateResponse, - type CustomerRetrieveResponse as CustomerRetrieveResponse, - type CustomerUpdateResponse as CustomerUpdateResponse, + type BusinessCustomerCreateRequest as BusinessCustomerCreateRequest, + type BusinessCustomerUpdateRequest as BusinessCustomerUpdateRequest, + type Customer as Customer, + type CustomerCreateRequestOneOf as CustomerCreateRequestOneOf, type CustomerListResponse as CustomerListResponse, - type CustomerDeleteResponse as CustomerDeleteResponse, - type CustomerExportResponse as CustomerExportResponse, - type CustomerGenerateKYCLinkResponse as CustomerGenerateKYCLinkResponse, - type CustomerListResponsesDefaultPagination as CustomerListResponsesDefaultPagination, + type CustomerOneOf as CustomerOneOf, + type CustomerUpdateRequestOneOf as CustomerUpdateRequestOneOf, + type IndividualCustomerCreateRequest as IndividualCustomerCreateRequest, + type IndividualCustomerUpdateRequest as IndividualCustomerUpdateRequest, + type InternalAccountExportRequest as InternalAccountExportRequest, + type InternalAccountExportResponse as InternalAccountExportResponse, + type InternalAccountListResponse as InternalAccountListResponse, + type InternalAccountUpdateRequest as InternalAccountUpdateRequest, + type KYCLinkCreateRequest as KYCLinkCreateRequest, + type KYCLinkResponse as KYCLinkResponse, + type CustomerOneovesDefaultPagination as CustomerOneovesDefaultPagination, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, + type CustomerCreateKYCLinkParams as CustomerCreateKYCLinkParams, type CustomerExportParams as CustomerExportParams, - type CustomerGenerateKYCLinkParams as CustomerGenerateKYCLinkParams, type CustomerListInternalAccountsParams as CustomerListInternalAccountsParams, type CustomerUpdateInternalAccountParams as CustomerUpdateInternalAccountParams, }; @@ -1025,6 +1442,7 @@ export declare namespace Customers { type ExternalAccount as ExternalAccount, type ExternalAccountCreate as ExternalAccountCreate, type ExternalAccountInfoOneOf as ExternalAccountInfoOneOf, + type ExternalAccountListResponse as ExternalAccountListResponse, type GbpBeneficiary as GbpBeneficiary, type GbpExternalAccountInfo as GbpExternalAccountInfo, type GhsExternalAccountInfo as GhsExternalAccountInfo, diff --git a/src/resources/customers/external-accounts.ts b/src/resources/customers/external-accounts.ts index d4820ab5..821ca9b3 100644 --- a/src/resources/customers/external-accounts.ts +++ b/src/resources/customers/external-accounts.ts @@ -157,8 +157,8 @@ export type BaseWalletInfo = unknown; /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export type BdtExternalAccountInfo = unknown; @@ -250,8 +250,8 @@ export type CadExternalAccountInfo = unknown; /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: bankName, accountNumber, bankAccountType - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankAccountType, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export type CopExternalAccountInfo = unknown; @@ -293,6 +293,12 @@ export interface DkkBeneficiary { export type DkkExternalAccountInfo = unknown; +/** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: bankName, iban + * - MOBILE_MONEY: bankName, phoneNumber + */ export type EgpExternalAccountInfo = unknown; export type EurExternalAccountInfo = unknown; @@ -364,8 +370,8 @@ export interface ExternalAccountCreate { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ accountInfo: | Shared.AedExternalAccountCreateInfo @@ -373,6 +379,7 @@ export interface ExternalAccountCreate { | Shared.BrlExternalAccountCreateInfo | Shared.BwpExternalAccountCreateInfo | Shared.CadExternalAccountCreateInfo + | ExternalAccountCreate.CnyAccount | Shared.CopExternalAccountCreateInfo | Shared.DkkExternalAccountCreateInfo | Shared.EgpExternalAccountCreateInfo @@ -436,6 +443,73 @@ export interface ExternalAccountCreate { platformAccountId?: string; } +export namespace ExternalAccountCreate { + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + beneficiary: CnyAccount.IndividualBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + + export namespace CnyAccount { + export interface IndividualBeneficiary { + beneficiaryType: 'INDIVIDUAL'; + + /** + * The full name of the beneficiary + */ + fullName: string; + + address?: ExternalAccountsAPI.Address; + + /** + * The birth date of the beneficiary + */ + birthDate?: string; + + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + + /** + * The email of the beneficiary + */ + email?: string; + + /** + * The nationality of the beneficiary + */ + nationality?: string; + + /** + * The phone number of the beneficiary + */ + phoneNumber?: string; + } + } +} + /** * Required fields depend on the selected paymentRails: * @@ -444,7 +518,8 @@ export interface ExternalAccountCreate { */ export type ExternalAccountInfoOneOf = | ExternalAccountInfoOneOf.SlvAccount - | ExternalAccountInfoOneOf.SwiftAccount; + | ExternalAccountInfoOneOf.SwiftAccount + | ExternalAccountInfoOneOf.CnyAccount; export namespace ExternalAccountInfoOneOf { /** @@ -515,6 +590,95 @@ export namespace ExternalAccountInfoOneOf { */ iban?: string; } + + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + beneficiary: CnyAccount.IndividualBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + + export namespace CnyAccount { + export interface IndividualBeneficiary { + beneficiaryType: 'INDIVIDUAL'; + + /** + * The full name of the beneficiary + */ + fullName: string; + + address?: ExternalAccountsAPI.Address; + + /** + * The birth date of the beneficiary + */ + birthDate?: string; + + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + + /** + * The email of the beneficiary + */ + email?: string; + + /** + * The nationality of the beneficiary + */ + nationality?: string; + + /** + * The phone number of the beneficiary + */ + phoneNumber?: string; + } + } +} + +export interface ExternalAccountListResponse { + /** + * List of external accounts matching the filter criteria + */ + data: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of external accounts matching the criteria (excluding pagination) + */ + totalCount?: number; } export interface GbpBeneficiary { @@ -558,8 +722,8 @@ export type GbpExternalAccountInfo = unknown; /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export type GhsExternalAccountInfo = unknown; @@ -679,6 +843,13 @@ export interface InrBeneficiary { phoneNumber?: string; } +/** + * Required fields depend on the selected paymentRails: + * + * - NEFT: accountNumber, ifsc, rail + * - RTGS: accountNumber, ifsc, rail + * - UPI: vpa + */ export type InrExternalAccountInfo = unknown; export type JmdExternalAccountInfo = unknown; @@ -812,7 +983,7 @@ export type PhpExternalAccountInfo = unknown; /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber + * - BANK_TRANSFER: accountNumber, bankName * - MOBILE_MONEY: bankName, phoneNumber */ export type PkrExternalAccountInfo = unknown; @@ -995,8 +1166,8 @@ export interface ExternalAccountCreateParams { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ accountInfo: | Shared.AedExternalAccountCreateInfo @@ -1004,6 +1175,7 @@ export interface ExternalAccountCreateParams { | Shared.BrlExternalAccountCreateInfo | Shared.BwpExternalAccountCreateInfo | Shared.CadExternalAccountCreateInfo + | ExternalAccountCreateParams.CnyAccount | Shared.CopExternalAccountCreateInfo | Shared.DkkExternalAccountCreateInfo | Shared.EgpExternalAccountCreateInfo @@ -1067,6 +1239,73 @@ export interface ExternalAccountCreateParams { platformAccountId?: string; } +export namespace ExternalAccountCreateParams { + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + beneficiary: CnyAccount.IndividualBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + + export namespace CnyAccount { + export interface IndividualBeneficiary { + beneficiaryType: 'INDIVIDUAL'; + + /** + * The full name of the beneficiary + */ + fullName: string; + + address?: ExternalAccountsAPI.Address; + + /** + * The birth date of the beneficiary + */ + birthDate?: string; + + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + + /** + * The email of the beneficiary + */ + email?: string; + + /** + * The nationality of the beneficiary + */ + nationality?: string; + + /** + * The phone number of the beneficiary + */ + phoneNumber?: string; + } + } +} + export interface ExternalAccountListParams extends DefaultPaginationParams { /** * Filter by currency code @@ -1104,6 +1343,7 @@ export declare namespace ExternalAccounts { type ExternalAccount as ExternalAccount, type ExternalAccountCreate as ExternalAccountCreate, type ExternalAccountInfoOneOf as ExternalAccountInfoOneOf, + type ExternalAccountListResponse as ExternalAccountListResponse, type GbpBeneficiary as GbpBeneficiary, type GbpExternalAccountInfo as GbpExternalAccountInfo, type GhsExternalAccountInfo as GhsExternalAccountInfo, diff --git a/src/resources/customers/index.ts b/src/resources/customers/index.ts index 4d12d3c9..e0a0bcae 100644 --- a/src/resources/customers/index.ts +++ b/src/resources/customers/index.ts @@ -8,21 +8,29 @@ export { } from './bulk'; export { Customers, - type CustomerCreateResponse, - type CustomerRetrieveResponse, - type CustomerUpdateResponse, + type BusinessCustomerCreateRequest, + type BusinessCustomerUpdateRequest, + type Customer, + type CustomerCreateRequestOneOf, type CustomerListResponse, - type CustomerDeleteResponse, - type CustomerExportResponse, - type CustomerGenerateKYCLinkResponse, + type CustomerOneOf, + type CustomerUpdateRequestOneOf, + type IndividualCustomerCreateRequest, + type IndividualCustomerUpdateRequest, + type InternalAccountExportRequest, + type InternalAccountExportResponse, + type InternalAccountListResponse, + type InternalAccountUpdateRequest, + type KYCLinkCreateRequest, + type KYCLinkResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, + type CustomerCreateKYCLinkParams, type CustomerExportParams, - type CustomerGenerateKYCLinkParams, type CustomerListInternalAccountsParams, type CustomerUpdateInternalAccountParams, - type CustomerListResponsesDefaultPagination, + type CustomerOneovesDefaultPagination, } from './customers'; export { ExternalAccounts, @@ -44,6 +52,7 @@ export { type ExternalAccount, type ExternalAccountCreate, type ExternalAccountInfoOneOf, + type ExternalAccountListResponse, type GbpBeneficiary, type GbpExternalAccountInfo, type GhsExternalAccountInfo, diff --git a/src/resources/documents.ts b/src/resources/documents.ts index 10d77cda..2daf2405 100644 --- a/src/resources/documents.ts +++ b/src/resources/documents.ts @@ -15,34 +15,19 @@ import { path } from '../internal/utils/path'; export class Documents extends APIResource { /** * Retrieve details and metadata of a specific document by ID. - * - * @example - * ```ts - * const document = await client.documents.retrieve( - * 'documentId', - * ); - * ``` */ - retrieve(documentID: string, options?: RequestOptions): APIPromise { + retrieve(documentID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/documents/${documentID}`, { ...options, __security: { basicAuth: true } }); } /** * Retrieve a list of documents with optional filtering by document holder. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const documentListResponse of client.documents.list()) { - * // ... - * } - * ``` */ list( query: DocumentListParams | null | undefined = {}, options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/documents', DefaultPagination, { + ): PagePromise { + return this._client.getAPIList('/documents', DefaultPagination, { query, ...options, __security: { basicAuth: true }, @@ -52,11 +37,6 @@ export class Documents extends APIResource { /** * Delete an uploaded document. This cannot be undone. Documents that have already * been submitted for verification may not be deletable. - * - * @example - * ```ts - * await client.documents.delete('documentId'); - * ``` */ delete(documentID: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/documents/${documentID}`, { @@ -70,27 +50,15 @@ export class Documents extends APIResource { * Replace an existing document with a new file and/or updated metadata. This is * useful when a document was rejected and needs to be re-uploaded. The request * must use multipart/form-data. - * - * @example - * ```ts - * const response = await client.documents.replace( - * 'documentId', - * { - * country: 'US', - * documentType: 'PASSPORT', - * file: fs.createReadStream('path/to/file'), - * }, - * ); - * ``` */ - replace( - documentID: string, - body: DocumentReplaceParams, - options?: RequestOptions, - ): APIPromise { + replace(documentID: string, params: DocumentReplaceParams, options?: RequestOptions): APIPromise { + const { DocumentReplaceRequest } = params; return this._client.put( path`/documents/${documentID}`, - multipartFormRequestOptions({ body, ...options, __security: { basicAuth: true } }, this._client), + multipartFormRequestOptions( + { body: DocumentReplaceRequest, ...options, __security: { basicAuth: true } }, + this._client, + ), ); } @@ -100,29 +68,22 @@ export class Documents extends APIResource { * the remaining fields. * * Supported file types: PDF, JPEG, PNG. Maximum file size: 10 MB. - * - * @example - * ```ts - * const response = await client.documents.upload({ - * country: 'US', - * documentHolder: - * 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001', - * documentType: 'PASSPORT', - * file: fs.createReadStream('path/to/file'), - * }); - * ``` */ - upload(body: DocumentUploadParams, options?: RequestOptions): APIPromise { + upload(params: DocumentUploadParams, options?: RequestOptions): APIPromise { + const { DocumentUploadRequest } = params; return this._client.post( '/documents', - multipartFormRequestOptions({ body, ...options, __security: { basicAuth: true } }, this._client), + multipartFormRequestOptions( + { body: DocumentUploadRequest, ...options, __security: { basicAuth: true } }, + this._client, + ), ); } } -export type DocumentListResponsesDefaultPagination = DefaultPagination; +export type DocumentsDefaultPagination = DefaultPagination; -export interface DocumentRetrieveResponse { +export interface Document { /** * Unique identifier for this document */ @@ -212,266 +173,24 @@ export interface DocumentRetrieveResponse { export interface DocumentListResponse { /** - * Unique identifier for this document - */ - id: string; - - /** - * Country that issued the document (ISO 3166-1 alpha-2) - */ - country: string; - - /** - * When this document was uploaded - */ - createdAt: string; - - /** - * ID of the entity that owns this document. Can be a Customer ID or a - * BeneficialOwner ID. - */ - documentHolder: string; - - /** - * Type of identity or business verification document. Document types are grouped - * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID - * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, - * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT - * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, - * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership - * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT - * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, - * BANK_STATEMENT, TAX_RETURN - */ - documentType: - | 'PASSPORT' - | 'DRIVERS_LICENSE' - | 'NATIONAL_ID' - | 'PROOF_OF_ADDRESS' - | 'BANK_STATEMENT' - | 'TAX_RETURN' - | 'CERTIFICATE_OF_INCORPORATION' - | 'ARTICLES_OF_INCORPORATION' - | 'ARTICLES_OF_ASSOCIATION' - | 'STATE_REGISTRY_EXCERPT' - | 'GOOD_STANDING_CERTIFICATE' - | 'INFORMATION_STATEMENT' - | 'INCUMBENCY_CERTIFICATE' - | 'BUSINESS_LICENSE' - | 'SHAREHOLDER_REGISTER' - | 'POWER_OF_ATTORNEY' - | 'UTILITY_BILL' - | 'ELECTRICITY_BILL' - | 'RENT_OR_LEASE_AGREEMENT' - | 'DIRECTOR_REGISTRY' - | 'TRUST_AGREEMENT' - | 'STATE_COMPANY_REGISTRY' - | 'PARTNERSHIP_CONTROL_AGREEMENT' - | 'PARTNERSHIP_AGREEMENT' - | 'SELFIE' - | 'OTHER'; - - /** - * Original file name of the uploaded document - */ - fileName: string; - - /** - * Document identification number (e.g., passport number) - */ - documentNumber?: string; - - /** - * Name of the government agency or organization that issued the document - */ - issuingAuthority?: string; - - /** - * Which side of the document this upload represents. Relevant for two-sided - * documents like driver's licenses or national IDs. - */ - side?: 'FRONT' | 'BACK'; - - /** - * When this document was last updated - */ - updatedAt?: string; -} - -export interface DocumentReplaceResponse { - /** - * Unique identifier for this document - */ - id: string; - - /** - * Country that issued the document (ISO 3166-1 alpha-2) - */ - country: string; - - /** - * When this document was uploaded - */ - createdAt: string; - - /** - * ID of the entity that owns this document. Can be a Customer ID or a - * BeneficialOwner ID. - */ - documentHolder: string; - - /** - * Type of identity or business verification document. Document types are grouped - * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID - * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, - * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT - * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, - * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership - * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT - * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, - * BANK_STATEMENT, TAX_RETURN - */ - documentType: - | 'PASSPORT' - | 'DRIVERS_LICENSE' - | 'NATIONAL_ID' - | 'PROOF_OF_ADDRESS' - | 'BANK_STATEMENT' - | 'TAX_RETURN' - | 'CERTIFICATE_OF_INCORPORATION' - | 'ARTICLES_OF_INCORPORATION' - | 'ARTICLES_OF_ASSOCIATION' - | 'STATE_REGISTRY_EXCERPT' - | 'GOOD_STANDING_CERTIFICATE' - | 'INFORMATION_STATEMENT' - | 'INCUMBENCY_CERTIFICATE' - | 'BUSINESS_LICENSE' - | 'SHAREHOLDER_REGISTER' - | 'POWER_OF_ATTORNEY' - | 'UTILITY_BILL' - | 'ELECTRICITY_BILL' - | 'RENT_OR_LEASE_AGREEMENT' - | 'DIRECTOR_REGISTRY' - | 'TRUST_AGREEMENT' - | 'STATE_COMPANY_REGISTRY' - | 'PARTNERSHIP_CONTROL_AGREEMENT' - | 'PARTNERSHIP_AGREEMENT' - | 'SELFIE' - | 'OTHER'; - - /** - * Original file name of the uploaded document - */ - fileName: string; - - /** - * Document identification number (e.g., passport number) - */ - documentNumber?: string; - - /** - * Name of the government agency or organization that issued the document - */ - issuingAuthority?: string; - - /** - * Which side of the document this upload represents. Relevant for two-sided - * documents like driver's licenses or national IDs. - */ - side?: 'FRONT' | 'BACK'; - - /** - * When this document was last updated - */ - updatedAt?: string; -} - -export interface DocumentUploadResponse { - /** - * Unique identifier for this document - */ - id: string; - - /** - * Country that issued the document (ISO 3166-1 alpha-2) - */ - country: string; - - /** - * When this document was uploaded - */ - createdAt: string; - - /** - * ID of the entity that owns this document. Can be a Customer ID or a - * BeneficialOwner ID. - */ - documentHolder: string; - - /** - * Type of identity or business verification document. Document types are grouped - * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID - * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, - * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT - * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, - * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership - * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT - * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, - * BANK_STATEMENT, TAX_RETURN - */ - documentType: - | 'PASSPORT' - | 'DRIVERS_LICENSE' - | 'NATIONAL_ID' - | 'PROOF_OF_ADDRESS' - | 'BANK_STATEMENT' - | 'TAX_RETURN' - | 'CERTIFICATE_OF_INCORPORATION' - | 'ARTICLES_OF_INCORPORATION' - | 'ARTICLES_OF_ASSOCIATION' - | 'STATE_REGISTRY_EXCERPT' - | 'GOOD_STANDING_CERTIFICATE' - | 'INFORMATION_STATEMENT' - | 'INCUMBENCY_CERTIFICATE' - | 'BUSINESS_LICENSE' - | 'SHAREHOLDER_REGISTER' - | 'POWER_OF_ATTORNEY' - | 'UTILITY_BILL' - | 'ELECTRICITY_BILL' - | 'RENT_OR_LEASE_AGREEMENT' - | 'DIRECTOR_REGISTRY' - | 'TRUST_AGREEMENT' - | 'STATE_COMPANY_REGISTRY' - | 'PARTNERSHIP_CONTROL_AGREEMENT' - | 'PARTNERSHIP_AGREEMENT' - | 'SELFIE' - | 'OTHER'; - - /** - * Original file name of the uploaded document - */ - fileName: string; - - /** - * Document identification number (e.g., passport number) + * List of documents matching the filter criteria */ - documentNumber?: string; + data: Array; /** - * Name of the government agency or organization that issued the document + * Indicates if more results are available beyond this page */ - issuingAuthority?: string; + hasMore: boolean; /** - * Which side of the document this upload represents. Relevant for two-sided - * documents like driver's licenses or national IDs. + * Cursor to retrieve the next page of results (only present if hasMore is true) */ - side?: 'FRONT' | 'BACK'; + nextCursor?: string; /** - * When this document was last updated + * Total number of results matching the criteria */ - updatedAt?: string; + totalCount?: number; } export interface DocumentListParams extends DefaultPaginationParams { @@ -487,150 +206,160 @@ export interface DocumentListParams extends DefaultPaginationParams { } export interface DocumentReplaceParams { - /** - * Country that issued the document (ISO 3166-1 alpha-2) - */ - country: string; - - /** - * Type of identity or business verification document. Document types are grouped - * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID - * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, - * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT - * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, - * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership - * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT - * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, - * BANK_STATEMENT, TAX_RETURN - */ - documentType: - | 'PASSPORT' - | 'DRIVERS_LICENSE' - | 'NATIONAL_ID' - | 'PROOF_OF_ADDRESS' - | 'BANK_STATEMENT' - | 'TAX_RETURN' - | 'CERTIFICATE_OF_INCORPORATION' - | 'ARTICLES_OF_INCORPORATION' - | 'ARTICLES_OF_ASSOCIATION' - | 'STATE_REGISTRY_EXCERPT' - | 'GOOD_STANDING_CERTIFICATE' - | 'INFORMATION_STATEMENT' - | 'INCUMBENCY_CERTIFICATE' - | 'BUSINESS_LICENSE' - | 'SHAREHOLDER_REGISTER' - | 'POWER_OF_ATTORNEY' - | 'UTILITY_BILL' - | 'ELECTRICITY_BILL' - | 'RENT_OR_LEASE_AGREEMENT' - | 'DIRECTOR_REGISTRY' - | 'TRUST_AGREEMENT' - | 'STATE_COMPANY_REGISTRY' - | 'PARTNERSHIP_CONTROL_AGREEMENT' - | 'PARTNERSHIP_AGREEMENT' - | 'SELFIE' - | 'OTHER'; - - /** - * The document file (PDF, JPEG, or PNG, max 10 MB) - */ - file: Uploadable; - - /** - * Document identification number (e.g., passport number) - */ - documentNumber?: string; - - /** - * Name of the government agency or organization that issued the document - */ - issuingAuthority?: string; + DocumentReplaceRequest: DocumentReplaceParams.DocumentReplaceRequest; +} - /** - * Which side of the document (for two-sided documents like driver's licenses) - */ - side?: 'FRONT' | 'BACK'; +export namespace DocumentReplaceParams { + export interface DocumentReplaceRequest { + /** + * Country that issued the document (ISO 3166-1 alpha-2) + */ + country: string; + + /** + * Type of identity or business verification document. Document types are grouped + * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID + * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, + * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT + * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, + * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership + * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT + * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, + * BANK_STATEMENT, TAX_RETURN + */ + documentType: + | 'PASSPORT' + | 'DRIVERS_LICENSE' + | 'NATIONAL_ID' + | 'PROOF_OF_ADDRESS' + | 'BANK_STATEMENT' + | 'TAX_RETURN' + | 'CERTIFICATE_OF_INCORPORATION' + | 'ARTICLES_OF_INCORPORATION' + | 'ARTICLES_OF_ASSOCIATION' + | 'STATE_REGISTRY_EXCERPT' + | 'GOOD_STANDING_CERTIFICATE' + | 'INFORMATION_STATEMENT' + | 'INCUMBENCY_CERTIFICATE' + | 'BUSINESS_LICENSE' + | 'SHAREHOLDER_REGISTER' + | 'POWER_OF_ATTORNEY' + | 'UTILITY_BILL' + | 'ELECTRICITY_BILL' + | 'RENT_OR_LEASE_AGREEMENT' + | 'DIRECTOR_REGISTRY' + | 'TRUST_AGREEMENT' + | 'STATE_COMPANY_REGISTRY' + | 'PARTNERSHIP_CONTROL_AGREEMENT' + | 'PARTNERSHIP_AGREEMENT' + | 'SELFIE' + | 'OTHER'; + + /** + * The document file (PDF, JPEG, or PNG, max 10 MB) + */ + file: Uploadable; + + /** + * Document identification number (e.g., passport number) + */ + documentNumber?: string; + + /** + * Name of the government agency or organization that issued the document + */ + issuingAuthority?: string; + + /** + * Which side of the document (for two-sided documents like driver's licenses) + */ + side?: 'FRONT' | 'BACK'; + } } export interface DocumentUploadParams { - /** - * Country that issued the document (ISO 3166-1 alpha-2) - */ - country: string; - - /** - * ID of the entity that owns this document. Can be a Customer ID or a - * BeneficialOwner ID. - */ - documentHolder: string; - - /** - * Type of identity or business verification document. Document types are grouped - * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID - * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, - * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT - * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, - * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership - * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT - * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, - * BANK_STATEMENT, TAX_RETURN - */ - documentType: - | 'PASSPORT' - | 'DRIVERS_LICENSE' - | 'NATIONAL_ID' - | 'PROOF_OF_ADDRESS' - | 'BANK_STATEMENT' - | 'TAX_RETURN' - | 'CERTIFICATE_OF_INCORPORATION' - | 'ARTICLES_OF_INCORPORATION' - | 'ARTICLES_OF_ASSOCIATION' - | 'STATE_REGISTRY_EXCERPT' - | 'GOOD_STANDING_CERTIFICATE' - | 'INFORMATION_STATEMENT' - | 'INCUMBENCY_CERTIFICATE' - | 'BUSINESS_LICENSE' - | 'SHAREHOLDER_REGISTER' - | 'POWER_OF_ATTORNEY' - | 'UTILITY_BILL' - | 'ELECTRICITY_BILL' - | 'RENT_OR_LEASE_AGREEMENT' - | 'DIRECTOR_REGISTRY' - | 'TRUST_AGREEMENT' - | 'STATE_COMPANY_REGISTRY' - | 'PARTNERSHIP_CONTROL_AGREEMENT' - | 'PARTNERSHIP_AGREEMENT' - | 'SELFIE' - | 'OTHER'; - - /** - * The document file (PDF, JPEG, or PNG, max 10 MB) - */ - file: Uploadable; - - /** - * Document identification number (e.g., passport number) - */ - documentNumber?: string; - - /** - * Name of the government agency or organization that issued the document - */ - issuingAuthority?: string; + DocumentUploadRequest: DocumentUploadParams.DocumentUploadRequest; +} - /** - * Which side of the document (for two-sided documents like driver's licenses) - */ - side?: 'FRONT' | 'BACK'; +export namespace DocumentUploadParams { + export interface DocumentUploadRequest { + /** + * Country that issued the document (ISO 3166-1 alpha-2) + */ + country: string; + + /** + * ID of the entity that owns this document. Can be a Customer ID or a + * BeneficialOwner ID. + */ + documentHolder: string; + + /** + * Type of identity or business verification document. Document types are grouped + * by verification category: **Identity** — PASSPORT, DRIVERS_LICENSE, NATIONAL_ID + * **Business — Legal presence** — CERTIFICATE_OF_INCORPORATION, + * ARTICLES_OF_INCORPORATION, ARTICLES_OF_ASSOCIATION, STATE_REGISTRY_EXCERPT + * **Business — Control structure** — DIRECTOR_REGISTRY, TRUST_AGREEMENT, + * STATE_COMPANY_REGISTRY, PARTNERSHIP_CONTROL_AGREEMENT **Business — Ownership + * structure** — SHAREHOLDER_REGISTER, TRUST_AGREEMENT, PARTNERSHIP_AGREEMENT + * **Proof of address** — UTILITY_BILL, RENT_OR_LEASE_AGREEMENT, ELECTRICITY_BILL, + * BANK_STATEMENT, TAX_RETURN + */ + documentType: + | 'PASSPORT' + | 'DRIVERS_LICENSE' + | 'NATIONAL_ID' + | 'PROOF_OF_ADDRESS' + | 'BANK_STATEMENT' + | 'TAX_RETURN' + | 'CERTIFICATE_OF_INCORPORATION' + | 'ARTICLES_OF_INCORPORATION' + | 'ARTICLES_OF_ASSOCIATION' + | 'STATE_REGISTRY_EXCERPT' + | 'GOOD_STANDING_CERTIFICATE' + | 'INFORMATION_STATEMENT' + | 'INCUMBENCY_CERTIFICATE' + | 'BUSINESS_LICENSE' + | 'SHAREHOLDER_REGISTER' + | 'POWER_OF_ATTORNEY' + | 'UTILITY_BILL' + | 'ELECTRICITY_BILL' + | 'RENT_OR_LEASE_AGREEMENT' + | 'DIRECTOR_REGISTRY' + | 'TRUST_AGREEMENT' + | 'STATE_COMPANY_REGISTRY' + | 'PARTNERSHIP_CONTROL_AGREEMENT' + | 'PARTNERSHIP_AGREEMENT' + | 'SELFIE' + | 'OTHER'; + + /** + * The document file (PDF, JPEG, or PNG, max 10 MB) + */ + file: Uploadable; + + /** + * Document identification number (e.g., passport number) + */ + documentNumber?: string; + + /** + * Name of the government agency or organization that issued the document + */ + issuingAuthority?: string; + + /** + * Which side of the document (for two-sided documents like driver's licenses) + */ + side?: 'FRONT' | 'BACK'; + } } export declare namespace Documents { export { - type DocumentRetrieveResponse as DocumentRetrieveResponse, + type Document as Document, type DocumentListResponse as DocumentListResponse, - type DocumentReplaceResponse as DocumentReplaceResponse, - type DocumentUploadResponse as DocumentUploadResponse, - type DocumentListResponsesDefaultPagination as DocumentListResponsesDefaultPagination, + type DocumentsDefaultPagination as DocumentsDefaultPagination, type DocumentListParams as DocumentListParams, type DocumentReplaceParams as DocumentReplaceParams, type DocumentUploadParams as DocumentUploadParams, diff --git a/src/resources/exchange-rates.ts b/src/resources/exchange-rates.ts index 89b60ca9..815cc30f 100644 --- a/src/resources/exchange-rates.ts +++ b/src/resources/exchange-rates.ts @@ -28,80 +28,85 @@ export class ExchangeRates extends APIResource { } } -export interface ExchangeRateListResponse { +/** + * Exchange rate information for a currency corridor + */ +export interface ExchangeRate { + destinationCurrency: QuotesAPI.Currency; + /** - * List of exchange rates matching the filter criteria + * The payment rail used for the destination (e.g., UPI, SEPA_INSTANT, + * MOBILE_MONEY, FASTER_PAYMENTS) */ - data: Array; -} + destinationPaymentRail: unknown; -export namespace ExchangeRateListResponse { /** - * Exchange rate information for a currency corridor + * Number of sending currency units per receiving currency unit. */ - export interface Data { - destinationCurrency: QuotesAPI.Currency; + exchangeRate: number; - /** - * The payment rail used for the destination (e.g., UPI, SEPA_INSTANT, - * MOBILE_MONEY, FASTER_PAYMENTS) - */ - destinationPaymentRail: unknown; - - /** - * Number of sending currency units per receiving currency unit. - */ - exchangeRate: number; + /** + * Fees associated with an exchange rate + */ + fees: ExchangeRate.Fees; - /** - * Fees associated with an exchange rate - */ - fees: Data.Fees; + /** + * The maximum supported sending amount in the smallest unit of the source + * currency. + */ + maxSendingAmount: number; - /** - * The maximum supported sending amount in the smallest unit of the source - * currency. - */ - maxSendingAmount: number; + /** + * The minimum supported sending amount in the smallest unit of the source + * currency. + */ + minSendingAmount: number; - /** - * The minimum supported sending amount in the smallest unit of the source - * currency. - */ - minSendingAmount: number; + /** + * The receiving amount in the smallest unit of the destination currency + */ + receivingAmount: number; - /** - * The receiving amount in the smallest unit of the destination currency - */ - receivingAmount: number; + /** + * The sending amount in the smallest unit of the source currency (e.g., cents for + * USD). Echoed back from the request if provided. + */ + sendingAmount: number; - /** - * The sending amount in the smallest unit of the source currency (e.g., cents for - * USD). Echoed back from the request if provided. - */ - sendingAmount: number; + sourceCurrency: QuotesAPI.Currency; - sourceCurrency: QuotesAPI.Currency; + /** + * Timestamp when this exchange rate was last refreshed + */ + updatedAt: string; +} +export namespace ExchangeRate { + /** + * Fees associated with an exchange rate + */ + export interface Fees { /** - * Timestamp when this exchange rate was last refreshed + * Fixed fee in the smallest unit of the sending currency (e.g., cents for USD) */ - updatedAt: string; - } + fixed?: number; - export namespace Data { /** - * Fees associated with an exchange rate + * Total fees in the smallest unit of the sending currency (e.g., cents for USD). + * This value may change depending on the sending amount used; if no sending amount + * is specified, it falls back to the default. */ - export interface Fees { - /** - * Fixed fee in the smallest unit of the sending currency (e.g., cents for USD) - */ - fixed?: number; - } + total?: number; } } +export interface ExchangeRateListResponse { + /** + * List of exchange rates matching the filter criteria + */ + data: Array; +} + export interface ExchangeRateListParams { /** * Filter by destination currency code(s). Can be repeated for multiple currencies @@ -124,6 +129,7 @@ export interface ExchangeRateListParams { export declare namespace ExchangeRates { export { + type ExchangeRate as ExchangeRate, type ExchangeRateListResponse as ExchangeRateListResponse, type ExchangeRateListParams as ExchangeRateListParams, }; diff --git a/src/resources/index.ts b/src/resources/index.ts index 36b10231..98d46812 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -17,6 +17,7 @@ export { type AgentDeviceCodeStatusResponse, type AgentListResponse, type AgentPolicy, + type AgentPolicyUpdateRequest, type AgentUpdateRequest, type AgentUsage, type AgentCreateParams, @@ -30,76 +31,95 @@ export { export { Auth } from './auth/auth'; export { BeneficialOwners, + type BeneficialOwnerCreateRequest, + type BeneficialOwnerListResponse, type BeneficialOwnerPersonalInfo, + type BeneficialOwnerUpdateRequest, type BeneficialOwnerCreateParams, type BeneficialOwnerUpdateParams, type BeneficialOwnerListParams, } from './beneficial-owners'; export { Cards, - type CardRetrieveResponse, - type CardUpdateResponse, + type Card, + type CardCreateRequest, type CardListResponse, - type CardIssueResponse, + type CardTransaction, + type CardUpdateRequest, type CardUpdateParams, type CardListParams, type CardIssueParams, - type CardListResponsesDefaultPagination, + type CardsDefaultPagination, } from './cards'; export { Config, type CustomerInfoFieldName, type EmbeddedWalletConfig, type PlatformConfig, + type PlatformConfigUpdateRequest, type PlatformCurrencyConfig, type ConfigUpdateParams, } from './config'; export { Crypto, - type CryptoEstimateWithdrawalFeeResponse, + type EstimateCryptoWithdrawalFeeRequest, + type EstimateCryptoWithdrawalFeeResponse, type CryptoEstimateWithdrawalFeeParams, } from './crypto'; export { Customers, - type CustomerCreateResponse, - type CustomerRetrieveResponse, - type CustomerUpdateResponse, + type BusinessCustomerCreateRequest, + type BusinessCustomerUpdateRequest, + type Customer, + type CustomerCreateRequestOneOf, type CustomerListResponse, - type CustomerDeleteResponse, - type CustomerExportResponse, - type CustomerGenerateKYCLinkResponse, + type CustomerOneOf, + type CustomerUpdateRequestOneOf, + type IndividualCustomerCreateRequest, + type IndividualCustomerUpdateRequest, + type InternalAccountExportRequest, + type InternalAccountExportResponse, + type InternalAccountListResponse, + type InternalAccountUpdateRequest, + type KYCLinkCreateRequest, + type KYCLinkResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, + type CustomerCreateKYCLinkParams, type CustomerExportParams, - type CustomerGenerateKYCLinkParams, type CustomerListInternalAccountsParams, type CustomerUpdateInternalAccountParams, - type CustomerListResponsesDefaultPagination, + type CustomerOneovesDefaultPagination, } from './customers/customers'; export { Discoveries, type DiscoveryListResponse, type DiscoveryListParams } from './discoveries'; export { Documents, - type DocumentRetrieveResponse, + type Document, type DocumentListResponse, - type DocumentReplaceResponse, - type DocumentUploadResponse, type DocumentListParams, type DocumentReplaceParams, type DocumentUploadParams, - type DocumentListResponsesDefaultPagination, + type DocumentsDefaultPagination, } from './documents'; -export { ExchangeRates, type ExchangeRateListResponse, type ExchangeRateListParams } from './exchange-rates'; +export { + ExchangeRates, + type ExchangeRate, + type ExchangeRateListResponse, + type ExchangeRateListParams, +} from './exchange-rates'; export { Invitations, type CurrencyAmount, type UmaInvitation, + type UmaInvitationClaimRequest, + type UmaInvitationCreateRequest, type InvitationCreateParams, type InvitationClaimParams, } from './invitations'; export { Platform, - type PlatformListInternalAccountsResponse, + type PlatformInternalAccountListResponse, type PlatformListInternalAccountsParams, } from './platform/platform'; export { @@ -111,6 +131,7 @@ export { type PaymentInstructions, type Quote, type QuoteDestinationOneOf, + type QuoteRequest, type QuoteSourceOneOf, type QuoteCreateParams, type QuoteExecuteParams, @@ -118,17 +139,19 @@ export { export { Receiver, type CounterpartyFieldDefinition, + type ExternalAccountLookupResponse, type LookupResponse, - type ReceiverLookupExternalAccountResponse, - type ReceiverLookupUmaResponse, + type UmaLookupResponse, type ReceiverLookupExternalAccountParams, type ReceiverLookupUmaParams, } from './receiver'; -export { Sandbox, type SandboxSendFundsParams } from './sandbox/sandbox'; +export { Sandbox, type SendRequest, type SandboxSendFundsParams } from './sandbox/sandbox'; export { Tokens, type APIToken, + type APITokenCreateRequest, type Permission, + type TokenListResponse, type TokenCreateParams, type TokenListParams, type APITokensDefaultPagination, @@ -141,6 +164,7 @@ export { type OutgoingTransaction, type OutgoingTransactionStatus, type ReconciliationInstructions, + type TransactionListResponse, type TransactionSourceOneOf, type TransactionStatus, type TransactionType, @@ -154,31 +178,32 @@ export { type ExternalAccountReference, type InternalAccountReference, type Transaction, + type TransferInRequest, type TransferInCreateParams, type TransactionsDefaultPagination, } from './transfer-in'; -export { TransferOut, type TransferOutCreateParams } from './transfer-out'; +export { TransferOut, type TransferOutRequest, type TransferOutCreateParams } from './transfer-out'; export { UmaProviders, + type UmaProvider, type UmaProviderListResponse, type UmaProviderListParams, - type UmaProviderListResponsesDefaultPagination, + type UmaProvidersDefaultPagination, } from './uma-providers'; export { Verifications, - type VerificationRetrieveResponse, + type Verification, type VerificationListResponse, - type VerificationSubmitResponse, + type VerificationRequest, type VerificationListParams, type VerificationSubmitParams, - type VerificationListResponsesDefaultPagination, + type VerificationsDefaultPagination, } from './verifications'; export { Webhooks, type AgentActionWebhookEvent, type IncomingPaymentWebhookEvent, type OutgoingPaymentWebhookEvent, - type TestWebhookWebhookEvent, type BulkUploadWebhookEvent, type InvitationClaimedWebhookEvent, type CustomerUpdateWebhookEvent, diff --git a/src/resources/invitations.ts b/src/resources/invitations.ts index c3858037..cf17b918 100644 --- a/src/resources/invitations.ts +++ b/src/resources/invitations.ts @@ -175,6 +175,41 @@ export interface UmaInvitation { inviteeUma?: string; } +export interface UmaInvitationClaimRequest { + /** + * The UMA address of the customer claiming the invitation + */ + inviteeUma: string; +} + +export interface UmaInvitationCreateRequest { + /** + * The UMA address of the customer creating the invitation + */ + inviterUma: string; + + /** + * An amount to send (in the smallest unit of the customer's currency) to the + * invitee when the invitation is claimed. This is optional and if not provided, + * the invitee will not receive any amount. Note that the actual sending of the + * amount must be done by the inviter platform once the INVITATION_CLAIMED webhook + * is received. If the inviter platform either does not send the payment or the + * payment fails, the invitee will not receive this amount. This field is primarily + * used for display purposes on the claiming side of the invitation. + */ + amountToSend?: number; + + /** + * When the invitation expires (if at all) + */ + expiresAt?: string; + + /** + * First name of the invitee to show as part of the invite + */ + firstName?: string; +} + export interface InvitationCreateParams { /** * The UMA address of the customer creating the invitation @@ -214,6 +249,8 @@ export declare namespace Invitations { export { type CurrencyAmount as CurrencyAmount, type UmaInvitation as UmaInvitation, + type UmaInvitationClaimRequest as UmaInvitationClaimRequest, + type UmaInvitationCreateRequest as UmaInvitationCreateRequest, type InvitationCreateParams as InvitationCreateParams, type InvitationClaimParams as InvitationClaimParams, }; diff --git a/src/resources/platform/external-accounts.ts b/src/resources/platform/external-accounts.ts index 25c6a091..a8ddf2f4 100644 --- a/src/resources/platform/external-accounts.ts +++ b/src/resources/platform/external-accounts.ts @@ -139,12 +139,17 @@ export interface AedAccountInfo { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export interface BdtAccountInfo { accountType: 'BDT_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; /** @@ -229,31 +234,31 @@ export interface CadAccountInfo { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: bankName, accountNumber, bankAccountType - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankAccountType, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export interface CopAccountInfo { accountType: 'COP_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; /** - * The account number of the bank (BANK_TRANSFER only) + * The account number of the bank */ accountNumber?: string; /** - * The bank account type (BANK_TRANSFER only) + * The bank account type */ bankAccountType?: 'CHECKING' | 'SAVINGS'; /** - * The name of the bank (BANK_TRANSFER only) - */ - bankName?: string; - - /** - * The phone number in international format (MOBILE_MONEY only — Nequi, Daviplata) + * The phone number in international format */ phoneNumber?: string; } @@ -274,12 +279,13 @@ export interface DkkAccountInfo { swiftCode?: string; } +/** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: bankName, iban + * - MOBILE_MONEY: bankName, phoneNumber + */ export interface EgpAccountInfo { - /** - * The account number of the bank - */ - accountNumber: string; - accountType: 'EGP_ACCOUNT'; /** @@ -287,7 +293,7 @@ export interface EgpAccountInfo { */ bankName: string; - paymentRails: Array<'BANK_TRANSFER'>; + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; /** * Egyptian IBAN (29 characters, starting with EG) @@ -295,9 +301,9 @@ export interface EgpAccountInfo { iban?: string; /** - * The SWIFT/BIC code of the bank + * The phone number in international format */ - swiftCode?: string; + phoneNumber?: string; } export interface EurAccountInfo { @@ -335,12 +341,17 @@ export interface GbpAccountInfo { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export interface GhsAccountInfo { accountType: 'GHS_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; /** @@ -367,6 +378,11 @@ export interface GtqAccountInfo { */ bankAccountType: 'CHECKING' | 'SAVINGS'; + /** + * The name of the beneficiary's bank + */ + bankName: string; + paymentRails: Array<'BANK_TRANSFER'>; } @@ -428,15 +444,44 @@ export interface IdrAccountInfo { swiftCode: string; } +/** + * Required fields depend on the selected paymentRails: + * + * - NEFT: accountNumber, ifsc, rail + * - RTGS: accountNumber, ifsc, rail + * - UPI: vpa + */ export interface InrAccountInfo { accountType: 'INR_ACCOUNT'; - paymentRails: Array<'UPI'>; + paymentRails: Array<'UPI' | 'NEFT' | 'RTGS'>; + + /** + * Indian bank account number (9–18 digits) + */ + accountNumber?: string; + + /** + * The name of the bank + */ + bankName?: string; + + /** + * The Indian Financial System Code (IFSC) of the beneficiary's bank branch + * (NEFT/RTGS) + */ + ifsc?: string; + + /** + * The payment rail to route the payout over, for currencies that support more than + * one (e.g. NEFT or RTGS for INR). + */ + rail?: string; /** * The UPI Virtual Payment Address */ - vpa: string; + vpa?: string; } export interface JmdAccountInfo { @@ -452,6 +497,11 @@ export interface JmdAccountInfo { */ bankAccountType: 'CHECKING' | 'SAVINGS'; + /** + * The name of the bank + */ + bankName: string; + /** * The branch code */ @@ -559,12 +609,17 @@ export interface PhpAccountInfo { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber + * - BANK_TRANSFER: accountNumber, bankName * - MOBILE_MONEY: bankName, phoneNumber */ export interface PkrAccountInfo { accountType: 'PKR_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; /** @@ -572,11 +627,6 @@ export interface PkrAccountInfo { */ accountNumber?: string; - /** - * The name of the bank - */ - bankName?: string; - /** * Pakistani IBAN (24 characters, starting with PK) */ @@ -588,6 +638,132 @@ export interface PkrAccountInfo { phoneNumber?: string; } +export interface PlatformExternalAccountCreateRequest { + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + accountInfo: + | Shared.AedExternalAccountCreateInfo + | Shared.BdtExternalAccountCreateInfo + | Shared.BrlExternalAccountCreateInfo + | Shared.BwpExternalAccountCreateInfo + | Shared.CadExternalAccountCreateInfo + | PlatformExternalAccountCreateRequest.CnyAccount + | Shared.CopExternalAccountCreateInfo + | Shared.DkkExternalAccountCreateInfo + | Shared.EgpExternalAccountCreateInfo + | Shared.EurExternalAccountCreateInfo + | Shared.GbpExternalAccountCreateInfo + | Shared.GhsExternalAccountCreateInfo + | Shared.GtqExternalAccountCreateInfo + | Shared.HkdExternalAccountCreateInfo + | Shared.HtgExternalAccountCreateInfo + | Shared.IdrExternalAccountCreateInfo + | Shared.InrExternalAccountCreateInfo + | Shared.JmdExternalAccountCreateInfo + | Shared.KesExternalAccountCreateInfo + | Shared.MwkExternalAccountCreateInfo + | Shared.MxnExternalAccountCreateInfo + | Shared.MyrExternalAccountCreateInfo + | Shared.NgnExternalAccountCreateInfo + | Shared.PhpExternalAccountCreateInfo + | Shared.PkrExternalAccountCreateInfo + | Shared.RwfExternalAccountCreateInfo + | Shared.SgdExternalAccountCreateInfo + | Shared.SlvExternalAccountCreateInfo + | Shared.ThbExternalAccountCreateInfo + | Shared.TzsExternalAccountCreateInfo + | Shared.UgxExternalAccountCreateInfo + | Shared.UsdExternalAccountCreateInfo + | Shared.VndExternalAccountCreateInfo + | Shared.XafExternalAccountCreateInfo + | Shared.XofExternalAccountCreateInfo + | Shared.ZarExternalAccountCreateInfo + | Shared.ZmwExternalAccountCreateInfo + | Shared.SwiftExternalAccountCreateInfo; + + /** + * The ISO 4217 currency code + */ + currency: string; + + /** + * Your platform's identifier for the account in your system. This can be used to + * reference the account by your own identifier. + */ + platformAccountId?: string; +} + +export namespace PlatformExternalAccountCreateRequest { + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + beneficiary: CnyAccount.IndividualBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + + export namespace CnyAccount { + export interface IndividualBeneficiary { + beneficiaryType: 'INDIVIDUAL'; + + /** + * The full name of the beneficiary + */ + fullName: string; + + address?: ExternalAccountsAPI.Address; + + /** + * The birth date of the beneficiary + */ + birthDate?: string; + + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + + /** + * The email of the beneficiary + */ + email?: string; + + /** + * The nationality of the beneficiary + */ + nationality?: string; + + /** + * The phone number of the beneficiary + */ + phoneNumber?: string; + } + } +} + export interface RwfAccountInfo { accountType: 'RWF_ACCOUNT'; @@ -612,17 +788,18 @@ export interface SgdAccountInfo { accountType: 'SGD_ACCOUNT'; - /** - * Name of the beneficiary's bank - */ - bankName: string; - paymentRails: Array<'PAYNOW' | 'FAST' | 'BANK_TRANSFER'>; /** * The SWIFT/BIC code of the bank */ swiftCode: string; + + /** + * Name of the beneficiary's bank. When omitted, resolved from swiftCode via the + * payout partner bank directory at account creation. + */ + bankName?: string; } export interface ThbAccountInfo { @@ -793,8 +970,8 @@ export interface ExternalAccountCreateParams { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ accountInfo: | Shared.AedExternalAccountCreateInfo @@ -802,6 +979,7 @@ export interface ExternalAccountCreateParams { | Shared.BrlExternalAccountCreateInfo | Shared.BwpExternalAccountCreateInfo | Shared.CadExternalAccountCreateInfo + | ExternalAccountCreateParams.CnyAccount | Shared.CopExternalAccountCreateInfo | Shared.DkkExternalAccountCreateInfo | Shared.EgpExternalAccountCreateInfo @@ -847,6 +1025,73 @@ export interface ExternalAccountCreateParams { platformAccountId?: string; } +export namespace ExternalAccountCreateParams { + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + beneficiary: CnyAccount.IndividualBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + + export namespace CnyAccount { + export interface IndividualBeneficiary { + beneficiaryType: 'INDIVIDUAL'; + + /** + * The full name of the beneficiary + */ + fullName: string; + + address?: ExternalAccountsAPI.Address; + + /** + * The birth date of the beneficiary + */ + birthDate?: string; + + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + + /** + * The email of the beneficiary + */ + email?: string; + + /** + * The nationality of the beneficiary + */ + nationality?: string; + + /** + * The phone number of the beneficiary + */ + phoneNumber?: string; + } + } +} + export interface ExternalAccountListParams extends DefaultPaginationParams { /** * Filter by currency code @@ -885,6 +1130,7 @@ export declare namespace ExternalAccounts { type NgnAccountInfo as NgnAccountInfo, type PhpAccountInfo as PhpAccountInfo, type PkrAccountInfo as PkrAccountInfo, + type PlatformExternalAccountCreateRequest as PlatformExternalAccountCreateRequest, type RwfAccountInfo as RwfAccountInfo, type SgdAccountInfo as SgdAccountInfo, type ThbAccountInfo as ThbAccountInfo, diff --git a/src/resources/platform/index.ts b/src/resources/platform/index.ts index 9dc05a7b..8135d122 100644 --- a/src/resources/platform/index.ts +++ b/src/resources/platform/index.ts @@ -26,6 +26,7 @@ export { type NgnAccountInfo, type PhpAccountInfo, type PkrAccountInfo, + type PlatformExternalAccountCreateRequest, type RwfAccountInfo, type SgdAccountInfo, type ThbAccountInfo, @@ -42,6 +43,6 @@ export { } from './external-accounts'; export { Platform, - type PlatformListInternalAccountsResponse, + type PlatformInternalAccountListResponse, type PlatformListInternalAccountsParams, } from './platform'; diff --git a/src/resources/platform/platform.ts b/src/resources/platform/platform.ts index 17099f6d..3db1260f 100644 --- a/src/resources/platform/platform.ts +++ b/src/resources/platform/platform.ts @@ -30,6 +30,7 @@ import { NgnAccountInfo, PhpAccountInfo, PkrAccountInfo, + PlatformExternalAccountCreateRequest, RwfAccountInfo, SgdAccountInfo, ThbAccountInfo, @@ -64,14 +65,14 @@ export class Platform extends APIResource { * * @example * ```ts - * const response = + * const platformInternalAccountListResponse = * await client.platform.listInternalAccounts(); * ``` */ listInternalAccounts( query: PlatformListInternalAccountsParams | null | undefined = {}, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.get('/platform/internal-accounts', { query, ...options, @@ -80,7 +81,7 @@ export class Platform extends APIResource { } } -export interface PlatformListInternalAccountsResponse { +export interface PlatformInternalAccountListResponse { /** * List of internal accounts matching the filter criteria */ @@ -105,7 +106,7 @@ Platform.ExternalAccounts = ExternalAccounts; export declare namespace Platform { export { - type PlatformListInternalAccountsResponse as PlatformListInternalAccountsResponse, + type PlatformInternalAccountListResponse as PlatformInternalAccountListResponse, type PlatformListInternalAccountsParams as PlatformListInternalAccountsParams, }; @@ -135,6 +136,7 @@ export declare namespace Platform { type NgnAccountInfo as NgnAccountInfo, type PhpAccountInfo as PhpAccountInfo, type PkrAccountInfo as PkrAccountInfo, + type PlatformExternalAccountCreateRequest as PlatformExternalAccountCreateRequest, type RwfAccountInfo as RwfAccountInfo, type SgdAccountInfo as SgdAccountInfo, type ThbAccountInfo as ThbAccountInfo, diff --git a/src/resources/quotes.ts b/src/resources/quotes.ts index 9721b35d..f6a2cf33 100644 --- a/src/resources/quotes.ts +++ b/src/resources/quotes.ts @@ -92,7 +92,7 @@ export class Quotes extends APIResource { * * When the quote's `source` is an internal account of type `EMBEDDED_WALLET`, the * request must include a `Grid-Wallet-Signature` header. The header value is the - * full Turnkey API-key stamp built over the `payloadToSign` value from the quote's + * full Grid wallet signature built over the `payloadToSign` value from the quote's * `paymentInstructions[].accountOrWalletInfo` entry with the session private key * of a verified authentication credential on the source Embedded Wallet. * @@ -212,6 +212,8 @@ export interface PaymentInstructions { accountOrWalletInfo: | PaymentInstructions.ArsAccount | PaymentInstructions.SlvAccount + | PaymentInstructions.SwiftAccount + | PaymentInstructions.CnyAccount | PaymentInstructions.EmbeddedWallet; /** @@ -273,6 +275,78 @@ export namespace PaymentInstructions { phoneNumber?: string; } + export interface SwiftAccount { + accountType: 'SWIFT_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + /** + * The ISO 3166-1 alpha-2 country code of the bank account + */ + country: string; + + paymentRails: Array<'SWIFT'>; + + /** + * Unique reference code that must be included with the payment to properly credit + * it + */ + reference: string; + + /** + * The SWIFT/BIC code of the bank + */ + swiftCode: string; + + /** + * The bank account number. Required for most corridors. Use iban instead for + * IBAN-only corridors (e.g. BR, GB). + */ + accountNumber?: string; + + /** + * The IBAN of the bank account. Required for IBAN-only corridors (e.g. BR, GB). + * Use accountNumber for all other corridors. + */ + iban?: string; + } + + /** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber + */ + export interface CnyAccount { + accountType: 'CNY_ACCOUNT'; + + /** + * The name of the bank + */ + bankName: string; + + paymentRails: Array<'BANK_TRANSFER' | 'MOBILE_MONEY'>; + + /** + * Unique reference code that must be included with the payment to properly credit + * it + */ + reference: string; + + /** + * The account number of the bank + */ + accountNumber?: string; + + /** + * The phone number in international format + */ + phoneNumber?: string; + } + export interface EmbeddedWallet { /** * Discriminator value identifying this as Embedded Wallet payment instructions. @@ -283,7 +357,7 @@ export namespace PaymentInstructions { * JSON-encoded transaction signing payload that must be stamped, as-is * (byte-for-byte, without re-serialization), with the session private key of a * verified authentication credential on the source Embedded Wallet. The resulting - * Turnkey API-key stamp is passed as the `Grid-Wallet-Signature` header on + * Grid wallet signature is passed as the `Grid-Wallet-Signature` header on * `POST /quotes/{quoteId}/execute` to authorize the outbound transfer from the * wallet. */ @@ -378,10 +452,111 @@ export interface Quote { * Details about the rate and fees for the transaction. */ rateDetails?: OutgoingRateDetails; + + /** + * Free-form information about the payment that travels with it to the recipient, + * as provided on the quote request. The field this populates depends on the + * payment rail: for ACH it populates the Addenda record, for FedNow and RTP it + * populates the remittanceInformation field, and for wires it populates the OBI + * (Originator to Beneficiary Information) / beneficiary information. + */ + remittanceInformation?: string; } export type QuoteDestinationOneOf = unknown; +export interface QuoteRequest { + destination: QuoteDestinationOneOf; + + /** + * The amount to send/receive in the smallest unit of the locked currency (eg. + * cents). See `lockedCurrencySide` for more information. + */ + lockedCurrencyAmount: number; + + /** + * The side of the quote which should be locked and specified in the + * `lockedCurrencyAmount`. For example, if I want to send exactly $5 MXN from my + * wallet, I would set this to "sending", and the `lockedCurrencyAmount` to 500 (in + * cents). If I want the receiver to receive exactly $10 USD, I would set this to + * "receiving" and the `lockedCurrencyAmount` to 10000 (in cents). + */ + lockedCurrencySide: 'SENDING' | 'RECEIVING'; + + source: QuoteSourceOneOf; + + /** + * Optional description/memo for the transfer + */ + description?: string; + + /** + * Whether to immediately execute the quote after creation. If true, the quote will + * be executed and the transaction will be created at the current exchange rate. It + * should only be used if you don't want to lock and view rate details before + * executing the quote. If you are executing a pre-existing quote, use the + * `/quotes/{quoteId}/execute` endpoint instead. This is false by default. This can + * only be used for quotes with a `source` which is either an internal account, or + * has direct pull functionality (e.g. ACH pull with an external account). Not + * supported when the `source` is an internal account of type `EMBEDDED_WALLET`: + * those transfers require a `Grid-Wallet-Signature` over the `payloadToSign` + * returned in the quote response, which is not available in a combined + * create-and-execute call. Create the quote first with `immediatelyExecute: false` + * and then call `POST /quotes/{quoteId}/execute` with the `Grid-Wallet-Signature` + * stamp header. + */ + immediatelyExecute?: boolean; + + /** + * Lookup ID from a previous receiver lookup request. If provided, this can make + * the quote creation more efficient by reusing cached lookup data. NOTE: This is + * required for UMA destinations due to counterparty institution requirements. See + * `senderCustomerInfo` for more information. + */ + lookupId?: string; + + /** + * The purpose of the payment. This may be required when sending to certain + * geographies (e.g. India). + */ + purposeOfPayment?: + | 'GIFT' + | 'SELF' + | 'GOODS_OR_SERVICES' + | 'EDUCATION' + | 'HEALTH_OR_MEDICAL' + | 'REAL_ESTATE_PURCHASE' + | 'TAX_PAYMENT' + | 'LOAN_PAYMENT' + | 'UTILITY_BILL' + | 'DONATION' + | 'TRAVEL' + | 'FAMILY_SUPPORT' + | 'SALARY_PAYMENT' + | 'OTHER'; + + /** + * Free-form information about the payment that travels with it to the recipient. + * The field this populates depends on the payment rail: for ACH it populates the + * Addenda record, for FedNow and RTP it populates the remittanceInformation field, + * and for wires it populates the OBI (Originator to Beneficiary Information) / + * beneficiary information. + */ + remittanceInformation?: string; + + /** + * Key-value pairs of additional information about the sender which was requested + * by the destination. This is relevant when the destination requires more sender + * info than was provided during customer creation. Any fields specified in + * `requiredPayerDataFields` from the response of the + * `/receiver/uma/{receiverUmaAddress}` (lookupUma) or + * `/receiver/external-account/{accountId}` (lookupExternalAccount) endpoints MUST + * be provided here if they were requested. If the destination did not request any + * additional information, this field can be omitted. + */ + senderCustomerInfo?: { [key: string]: unknown }; +} + export type QuoteSourceOneOf = unknown; export interface QuoteCreateParams { @@ -456,8 +631,19 @@ export interface QuoteCreateParams { | 'UTILITY_BILL' | 'DONATION' | 'TRAVEL' + | 'FAMILY_SUPPORT' + | 'SALARY_PAYMENT' | 'OTHER'; + /** + * Body param: Free-form information about the payment that travels with it to the + * recipient. The field this populates depends on the payment rail: for ACH it + * populates the Addenda record, for FedNow and RTP it populates the + * remittanceInformation field, and for wires it populates the OBI (Originator to + * Beneficiary Information) / beneficiary information. + */ + remittanceInformation?: string; + /** * Body param: Key-value pairs of additional information about the sender which was * requested by the destination. This is relevant when the destination requires @@ -479,7 +665,7 @@ export interface QuoteCreateParams { export interface QuoteExecuteParams { /** - * Full Turnkey API-key stamp over the `payloadToSign` returned in the quote's + * Full Grid wallet signature over the `payloadToSign` returned in the quote's * `paymentInstructions[].accountOrWalletInfo` entry, produced with the session * private key of a verified authentication credential on the source Embedded * Wallet. Required when the quote's source is an internal account of type @@ -503,6 +689,7 @@ export declare namespace Quotes { type PaymentInstructions as PaymentInstructions, type Quote as Quote, type QuoteDestinationOneOf as QuoteDestinationOneOf, + type QuoteRequest as QuoteRequest, type QuoteSourceOneOf as QuoteSourceOneOf, type QuoteCreateParams as QuoteCreateParams, type QuoteExecuteParams as QuoteExecuteParams, diff --git a/src/resources/receiver.ts b/src/resources/receiver.ts index 308376cf..e2cef2d5 100644 --- a/src/resources/receiver.ts +++ b/src/resources/receiver.ts @@ -21,7 +21,7 @@ export class Receiver extends APIResource { accountID: string, query: ReceiverLookupExternalAccountParams | null | undefined = {}, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.get(path`/receiver/external-account/${accountID}`, { query, ...options, @@ -38,7 +38,7 @@ export class Receiver extends APIResource { receiverUmaAddress: string, query: ReceiverLookupUmaParams | null | undefined = {}, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.get(path`/receiver/uma/${receiverUmaAddress}`, { query, ...options, @@ -60,6 +60,13 @@ export interface CounterpartyFieldDefinition { name: ConfigAPI.CustomerInfoFieldName; } +export interface ExternalAccountLookupResponse extends LookupResponse { + /** + * The external account ID that was looked up + */ + accountId: string; +} + export interface LookupResponse { /** * Unique identifier for the lookup. Needed in the subsequent create quote request. @@ -100,14 +107,7 @@ export namespace LookupResponse { } } -export interface ReceiverLookupExternalAccountResponse extends LookupResponse { - /** - * The external account ID that was looked up - */ - accountId: string; -} - -export interface ReceiverLookupUmaResponse extends LookupResponse { +export interface UmaLookupResponse extends LookupResponse { /** * The UMA address that was looked up */ @@ -141,9 +141,9 @@ export interface ReceiverLookupUmaParams { export declare namespace Receiver { export { type CounterpartyFieldDefinition as CounterpartyFieldDefinition, + type ExternalAccountLookupResponse as ExternalAccountLookupResponse, type LookupResponse as LookupResponse, - type ReceiverLookupExternalAccountResponse as ReceiverLookupExternalAccountResponse, - type ReceiverLookupUmaResponse as ReceiverLookupUmaResponse, + type UmaLookupResponse as UmaLookupResponse, type ReceiverLookupExternalAccountParams as ReceiverLookupExternalAccountParams, type ReceiverLookupUmaParams as ReceiverLookupUmaParams, }; diff --git a/src/resources/sandbox/cards/cards.ts b/src/resources/sandbox/cards/cards.ts index 1e007e75..2cc0922f 100644 --- a/src/resources/sandbox/cards/cards.ts +++ b/src/resources/sandbox/cards/cards.ts @@ -3,17 +3,18 @@ import { APIResource } from '../../../core/resource'; import * as SimulateAPI from './simulate'; import { + AuthorizationRequest, CardMerchant, CardPullSummary, CardRefundSummary, CardSettlementSummary, + ClearingRequest, + Refund, + RefundRequest, Simulate, SimulateAuthorizationParams, - SimulateAuthorizationResponse, SimulateClearingParams, - SimulateClearingResponse, SimulateReturnParams, - SimulateReturnResponse, } from './simulate'; export class Cards extends APIResource { @@ -25,13 +26,14 @@ Cards.Simulate = Simulate; export declare namespace Cards { export { Simulate as Simulate, + type AuthorizationRequest as AuthorizationRequest, type CardMerchant as CardMerchant, type CardPullSummary as CardPullSummary, type CardRefundSummary as CardRefundSummary, type CardSettlementSummary as CardSettlementSummary, - type SimulateAuthorizationResponse as SimulateAuthorizationResponse, - type SimulateClearingResponse as SimulateClearingResponse, - type SimulateReturnResponse as SimulateReturnResponse, + type ClearingRequest as ClearingRequest, + type Refund as Refund, + type RefundRequest as RefundRequest, type SimulateAuthorizationParams as SimulateAuthorizationParams, type SimulateClearingParams as SimulateClearingParams, type SimulateReturnParams as SimulateReturnParams, diff --git a/src/resources/sandbox/cards/index.ts b/src/resources/sandbox/cards/index.ts index 2c36d5e0..6289e418 100644 --- a/src/resources/sandbox/cards/index.ts +++ b/src/resources/sandbox/cards/index.ts @@ -3,13 +3,14 @@ export { Cards } from './cards'; export { Simulate, + type AuthorizationRequest, type CardMerchant, type CardPullSummary, type CardRefundSummary, type CardSettlementSummary, - type SimulateAuthorizationResponse, - type SimulateClearingResponse, - type SimulateReturnResponse, + type ClearingRequest, + type Refund, + type RefundRequest, type SimulateAuthorizationParams, type SimulateClearingParams, type SimulateReturnParams, diff --git a/src/resources/sandbox/cards/simulate.ts b/src/resources/sandbox/cards/simulate.ts index d2b69565..01776784 100644 --- a/src/resources/sandbox/cards/simulate.ts +++ b/src/resources/sandbox/cards/simulate.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; -import * as InvitationsAPI from '../../invitations'; +import * as CardsAPI from '../../cards'; import * as QuotesAPI from '../../quotes'; import { APIPromise } from '../../../core/api-promise'; import { RequestOptions } from '../../../internal/request-options'; @@ -31,7 +31,7 @@ export class Simulate extends APIResource { * * @example * ```ts - * const response = + * const cardTransaction = * await client.sandbox.cards.simulate.authorization( * 'Card:019542f5-b3e7-1d02-0000-000000000010', * { @@ -50,7 +50,7 @@ export class Simulate extends APIResource { id: string, body: SimulateAuthorizationParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post(path`/sandbox/cards/${id}/simulate/authorization`, { body, ...options, @@ -74,7 +74,7 @@ export class Simulate extends APIResource { * * @example * ```ts - * const response = + * const cardTransaction = * await client.sandbox.cards.simulate.clearing( * 'Card:019542f5-b3e7-1d02-0000-000000000010', * { @@ -89,7 +89,7 @@ export class Simulate extends APIResource { id: string, body: SimulateClearingParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post(path`/sandbox/cards/${id}/simulate/clearing`, { body, ...options, @@ -107,21 +107,22 @@ export class Simulate extends APIResource { * * @example * ```ts - * const response = await client.sandbox.cards.simulate.return( - * 'Card:019542f5-b3e7-1d02-0000-000000000010', - * { - * amount: 1500, - * cardTransactionId: - * 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100', - * }, - * ); + * const cardTransaction = + * await client.sandbox.cards.simulate.return( + * 'Card:019542f5-b3e7-1d02-0000-000000000010', + * { + * amount: 1500, + * cardTransactionId: + * 'CardTransaction:019542f5-b3e7-1d02-0000-000000000100', + * }, + * ); * ``` */ return( id: string, body: SimulateReturnParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post(path`/sandbox/cards/${id}/simulate/return`, { body, ...options, @@ -130,6 +131,24 @@ export class Simulate extends APIResource { } } +/** + * Sandbox-only request body for `POST /sandbox/cards/{id}/simulate/authorization`. + * Drives the same internal authorization + reconcile paths that the issuer would + * call in production. The decisioning outcome is controlled by the last three + * characters of `merchant.descriptor` — see the endpoint documentation for the + * suffix table. + */ +export interface AuthorizationRequest { + /** + * Authorization amount in the smallest unit of `currency` (e.g. cents for USD). + */ + amount: number; + + currency: QuotesAPI.Currency; + + merchant: CardMerchant; +} + export interface CardMerchant { /** * Merchant descriptor string captured from the card network at authorization time. @@ -194,240 +213,72 @@ export interface CardSettlementSummary { } /** - * Parent transaction row for a card authorization and all of the pulls / - * settlements / refunds that reconcile against it. Child events are rolled up into - * the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. - * Delivered as the payload of the generic transaction webhook stream (extends the - * Transaction model with a card destination type) on every transition. + * Sandbox-only request body for `POST /sandbox/cards/{id}/simulate/clearing`. + * Drives a clearing event against an existing `CardTransaction`. Pass an `amount` + * greater than the authorized amount to exercise the over-auth / restaurant-tip + * post-hoc-pull path; pass `0` to exercise `AUTHORIZATION_EXPIRY`. Suffix-driven + * outcomes on the parent transaction's id govern whether the post-hoc pull + * succeeds. */ -export interface SimulateAuthorizationResponse { - /** - * System-generated unique card transaction identifier - */ - id: string; - - /** - * Internal account id that funded this transaction (the funding source selected by - * Authorization Decisioning at auth time). - */ - accountId: string; - - authorizedAmount: InvitationsAPI.CurrencyAmount; - - /** - * When the auth was approved. - */ - authorizedAt: string; - +export interface ClearingRequest { /** - * The id of the `Card` this transaction was made on. - */ - cardId: string; - - /** - * Creation timestamp (same as `authorizedAt` for card transactions). - */ - createdAt: string; - - merchant: CardMerchant; - - pullSummary: CardPullSummary; - - refundSummary: CardRefundSummary; - - settlementSummary: CardSettlementSummary; - - /** - * Lifecycle status of a card transaction. - * - * | Status | Description | - * | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `AUTHORIZED` | The auth has been approved and a hold placed on the funding source; no clearing has arrived yet. | - * | `PARTIALLY_SETTLED` | At least one clearing has arrived and posted, but more clearings are still expected (split shipments, tips, multi-leg trips). | - * | `SETTLED` | All clearings for the auth have posted and the transaction is closed against the funding source. | - * | `REFUNDED` | A `RETURN` was received from the merchant; the net settled amount has been refunded in part or whole. | - * | `EXCEPTION` | The transaction settled to the card network but the corresponding pull from the funding source failed (e.g. balance no longer covers the post-hoc clearing). Surfaces high-urgency alerts and is the dashboard query for stuck reconciliations. | - */ - status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; - - /** - * Last update timestamp. - */ - updatedAt: string; - - /** - * Opaque identifier for the transaction on the underlying issuer. Used to - * cross-reference Grid records against issuer dashboards and webhooks. + * Clearing amount in the smallest unit of the transaction's currency. Set to `0` + * to simulate an authorization expiry with no clearing. */ - issuerTransactionToken?: string; + amount: number; /** - * Timestamp of the most recent reconcile event (pull / clearing / refund) against - * this transaction. + * The id of the `CardTransaction` to clear against. Must be in `AUTHORIZED` or + * `PARTIALLY_SETTLED` state. */ - lastEventAt?: string; - - refundedAmount?: InvitationsAPI.CurrencyAmount; - - settledAmount?: InvitationsAPI.CurrencyAmount; + cardTransactionId: string; } -/** - * Parent transaction row for a card authorization and all of the pulls / - * settlements / refunds that reconcile against it. Child events are rolled up into - * the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. - * Delivered as the payload of the generic transaction webhook stream (extends the - * Transaction model with a card destination type) on every transition. - */ -export interface SimulateClearingResponse { - /** - * System-generated unique card transaction identifier - */ - id: string; - +export interface Refund { /** - * Internal account id that funded this transaction (the funding source selected by - * Authorization Decisioning at auth time). + * When the refund was initiated */ - accountId: string; - - authorizedAmount: InvitationsAPI.CurrencyAmount; + initiatedAt: string; /** - * When the auth was approved. + * The unique reference ID of the refund */ - authorizedAt: string; + reference: string; /** - * The id of the `Card` this transaction was made on. + * Current status of the refund */ - cardId: string; + status: 'PENDING' | 'COMPLETED' | 'FAILED'; /** - * Creation timestamp (same as `authorizedAt` for card transactions). + * Reason for the refund */ - createdAt: string; - - merchant: CardMerchant; - - pullSummary: CardPullSummary; - - refundSummary: CardRefundSummary; - - settlementSummary: CardSettlementSummary; + reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; /** - * Lifecycle status of a card transaction. - * - * | Status | Description | - * | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `AUTHORIZED` | The auth has been approved and a hold placed on the funding source; no clearing has arrived yet. | - * | `PARTIALLY_SETTLED` | At least one clearing has arrived and posted, but more clearings are still expected (split shipments, tips, multi-leg trips). | - * | `SETTLED` | All clearings for the auth have posted and the transaction is closed against the funding source. | - * | `REFUNDED` | A `RETURN` was received from the merchant; the net settled amount has been refunded in part or whole. | - * | `EXCEPTION` | The transaction settled to the card network but the corresponding pull from the funding source failed (e.g. balance no longer covers the post-hoc clearing). Surfaces high-urgency alerts and is the dashboard query for stuck reconciliations. | + * When the refund was settled */ - status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; - - /** - * Last update timestamp. - */ - updatedAt: string; - - /** - * Opaque identifier for the transaction on the underlying issuer. Used to - * cross-reference Grid records against issuer dashboards and webhooks. - */ - issuerTransactionToken?: string; - - /** - * Timestamp of the most recent reconcile event (pull / clearing / refund) against - * this transaction. - */ - lastEventAt?: string; - - refundedAmount?: InvitationsAPI.CurrencyAmount; - - settledAmount?: InvitationsAPI.CurrencyAmount; + settledAt?: string; } /** - * Parent transaction row for a card authorization and all of the pulls / - * settlements / refunds that reconcile against it. Child events are rolled up into - * the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. - * Delivered as the payload of the generic transaction webhook stream (extends the - * Transaction model with a card destination type) on every transition. + * Sandbox-only request body for `POST /sandbox/cards/{id}/simulate/return`. Drives + * a `RETURN` event against an existing settled `CardTransaction`, which creates a + * `CardRefund` and pushes the parent transaction towards `REFUNDED` (full) or + * keeps it `SETTLED` (partial). */ -export interface SimulateReturnResponse { - /** - * System-generated unique card transaction identifier - */ - id: string; - +export interface RefundRequest { /** - * Internal account id that funded this transaction (the funding source selected by - * Authorization Decisioning at auth time). - */ - accountId: string; - - authorizedAmount: InvitationsAPI.CurrencyAmount; - - /** - * When the auth was approved. - */ - authorizedAt: string; - - /** - * The id of the `Card` this transaction was made on. - */ - cardId: string; - - /** - * Creation timestamp (same as `authorizedAt` for card transactions). - */ - createdAt: string; - - merchant: CardMerchant; - - pullSummary: CardPullSummary; - - refundSummary: CardRefundSummary; - - settlementSummary: CardSettlementSummary; - - /** - * Lifecycle status of a card transaction. - * - * | Status | Description | - * | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `AUTHORIZED` | The auth has been approved and a hold placed on the funding source; no clearing has arrived yet. | - * | `PARTIALLY_SETTLED` | At least one clearing has arrived and posted, but more clearings are still expected (split shipments, tips, multi-leg trips). | - * | `SETTLED` | All clearings for the auth have posted and the transaction is closed against the funding source. | - * | `REFUNDED` | A `RETURN` was received from the merchant; the net settled amount has been refunded in part or whole. | - * | `EXCEPTION` | The transaction settled to the card network but the corresponding pull from the funding source failed (e.g. balance no longer covers the post-hoc clearing). Surfaces high-urgency alerts and is the dashboard query for stuck reconciliations. | - */ - status: 'AUTHORIZED' | 'PARTIALLY_SETTLED' | 'SETTLED' | 'REFUNDED' | 'EXCEPTION'; - - /** - * Last update timestamp. - */ - updatedAt: string; - - /** - * Opaque identifier for the transaction on the underlying issuer. Used to - * cross-reference Grid records against issuer dashboards and webhooks. + * Return amount in the smallest unit of the transaction's currency. Must be less + * than or equal to the net settled amount (settled minus previously-refunded). */ - issuerTransactionToken?: string; + amount: number; /** - * Timestamp of the most recent reconcile event (pull / clearing / refund) against - * this transaction. + * The id of the `CardTransaction` to refund against. Must have at least one + * settled clearing. */ - lastEventAt?: string; - - refundedAmount?: InvitationsAPI.CurrencyAmount; - - settledAmount?: InvitationsAPI.CurrencyAmount; + cardTransactionId: string; } export interface SimulateAuthorizationParams { @@ -471,13 +322,14 @@ export interface SimulateReturnParams { export declare namespace Simulate { export { + type AuthorizationRequest as AuthorizationRequest, type CardMerchant as CardMerchant, type CardPullSummary as CardPullSummary, type CardRefundSummary as CardRefundSummary, type CardSettlementSummary as CardSettlementSummary, - type SimulateAuthorizationResponse as SimulateAuthorizationResponse, - type SimulateClearingResponse as SimulateClearingResponse, - type SimulateReturnResponse as SimulateReturnResponse, + type ClearingRequest as ClearingRequest, + type Refund as Refund, + type RefundRequest as RefundRequest, type SimulateAuthorizationParams as SimulateAuthorizationParams, type SimulateClearingParams as SimulateClearingParams, type SimulateReturnParams as SimulateReturnParams, diff --git a/src/resources/sandbox/index.ts b/src/resources/sandbox/index.ts index 2e058a3c..00dc2dc8 100644 --- a/src/resources/sandbox/index.ts +++ b/src/resources/sandbox/index.ts @@ -3,10 +3,11 @@ export { Cards } from './cards/index'; export { InternalAccounts, + type FundRequest, type InternalAccount, type InternalAccountFundParams, type InternalAccountsDefaultPagination, } from './internal-accounts'; -export { Sandbox, type SandboxSendFundsParams } from './sandbox'; -export { Uma, type UmaReceivePaymentParams } from './uma'; -export { Webhooks, type WebhookSendTestResponse } from './webhooks'; +export { Sandbox, type SendRequest, type SandboxSendFundsParams } from './sandbox'; +export { Uma, type ReceiveRequest, type UmaReceivePaymentParams } from './uma'; +export { Webhooks, type TestWebhookRequest, type TestWebhookResponse } from './webhooks'; diff --git a/src/resources/sandbox/internal-accounts.ts b/src/resources/sandbox/internal-accounts.ts index 5e712108..e614a86f 100644 --- a/src/resources/sandbox/internal-accounts.ts +++ b/src/resources/sandbox/internal-accounts.ts @@ -43,12 +43,23 @@ export class InternalAccounts extends APIResource { export type InternalAccountsDefaultPagination = DefaultPagination; +export interface FundRequest { + /** + * Amount to add in the smallest unit of the account's currency (e.g., cents for + * USD/EUR, satoshis for BTC) + */ + amount: number; +} + export interface InternalAccount { /** * The ID of the internal account */ id: string; + /** + * The balance available to spend, excluding pending and held funds + */ balance: InvitationsAPI.CurrencyAmount; /** @@ -74,8 +85,16 @@ export interface InternalAccount { * - `FROZEN`: The account cannot send or receive payments. Grid may freeze an * account in response to compliance or fraud signals; payments are blocked while * the account remains frozen. + * - `FAILED`: The account could not be provisioned. Grid was unable to create the + * underlying account, so it cannot send or receive payments and requires + * remediation. + */ + status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN' | 'FAILED'; + + /** + * The total balance, including pending and held funds */ - status: 'PENDING' | 'ACTIVE' | 'CLOSED' | 'FROZEN'; + totalBalance: InvitationsAPI.CurrencyAmount; /** * Classification of an internal account. @@ -118,6 +137,7 @@ export interface InternalAccountFundParams { export declare namespace InternalAccounts { export { + type FundRequest as FundRequest, type InternalAccount as InternalAccount, type InternalAccountFundParams as InternalAccountFundParams, }; diff --git a/src/resources/sandbox/sandbox.ts b/src/resources/sandbox/sandbox.ts index e6e74c1c..635f3f79 100644 --- a/src/resources/sandbox/sandbox.ts +++ b/src/resources/sandbox/sandbox.ts @@ -3,11 +3,16 @@ import { APIResource } from '../../core/resource'; import * as TransactionsAPI from '../transactions'; import * as InternalAccountsAPI from './internal-accounts'; -import { InternalAccount, InternalAccountFundParams, InternalAccounts } from './internal-accounts'; +import { + FundRequest, + InternalAccount, + InternalAccountFundParams, + InternalAccounts, +} from './internal-accounts'; import * as UmaAPI from './uma'; -import { Uma, UmaReceivePaymentParams } from './uma'; +import { ReceiveRequest, Uma, UmaReceivePaymentParams } from './uma'; import * as WebhooksAPI from './webhooks'; -import { WebhookSendTestResponse, Webhooks } from './webhooks'; +import { TestWebhookRequest, TestWebhookResponse, Webhooks } from './webhooks'; import * as CardsAPI from './cards/cards'; import { Cards } from './cards/cards'; import { APIPromise } from '../../core/api-promise'; @@ -45,6 +50,24 @@ export class Sandbox extends APIResource { } } +export interface SendRequest { + /** + * Currency code for the funds to be sent + */ + currencyCode: string; + + /** + * The unique identifier of the quote + */ + quoteId: string; + + /** + * The amount to send in the smallest unit of the currency (eg. cents). If not + * provided, the amount will be derived from the quote. + */ + currencyAmount?: number; +} + export interface SandboxSendFundsParams { /** * Currency code for the funds to be sent @@ -69,17 +92,26 @@ Sandbox.Webhooks = Webhooks; Sandbox.Cards = Cards; export declare namespace Sandbox { - export { type SandboxSendFundsParams as SandboxSendFundsParams }; + export { type SendRequest as SendRequest, type SandboxSendFundsParams as SandboxSendFundsParams }; - export { Uma as Uma, type UmaReceivePaymentParams as UmaReceivePaymentParams }; + export { + Uma as Uma, + type ReceiveRequest as ReceiveRequest, + type UmaReceivePaymentParams as UmaReceivePaymentParams, + }; export { InternalAccounts as InternalAccounts, + type FundRequest as FundRequest, type InternalAccount as InternalAccount, type InternalAccountFundParams as InternalAccountFundParams, }; - export { Webhooks as Webhooks, type WebhookSendTestResponse as WebhookSendTestResponse }; + export { + Webhooks as Webhooks, + type TestWebhookRequest as TestWebhookRequest, + type TestWebhookResponse as TestWebhookResponse, + }; export { Cards as Cards }; } diff --git a/src/resources/sandbox/uma.ts b/src/resources/sandbox/uma.ts index 626d1827..1db1fb51 100644 --- a/src/resources/sandbox/uma.ts +++ b/src/resources/sandbox/uma.ts @@ -32,6 +32,33 @@ export class Uma extends APIResource { } } +export interface ReceiveRequest { + /** + * The amount to be received in the smallest unit of the currency (eg. cents) + */ + receivingCurrencyAmount: number; + + /** + * The currency code for the receiving amount + */ + receivingCurrencyCode: string; + + /** + * UMA address of the sender from the sandbox + */ + senderUmaAddress: string; + + /** + * System ID of the receiver (optional if receiverUmaAddress is provided) + */ + customerId?: string; + + /** + * UMA address of the receiver (optional if customerId is provided) + */ + receiverUmaAddress?: string; +} + export interface UmaReceivePaymentParams { /** * The amount to be received in the smallest unit of the currency (eg. cents) @@ -60,5 +87,5 @@ export interface UmaReceivePaymentParams { } export declare namespace Uma { - export { type UmaReceivePaymentParams as UmaReceivePaymentParams }; + export { type ReceiveRequest as ReceiveRequest, type UmaReceivePaymentParams as UmaReceivePaymentParams }; } diff --git a/src/resources/sandbox/webhooks.ts b/src/resources/sandbox/webhooks.ts index 59290bf1..7192772f 100644 --- a/src/resources/sandbox/webhooks.ts +++ b/src/resources/sandbox/webhooks.ts @@ -13,15 +13,30 @@ export class Webhooks extends APIResource { * * @example * ```ts - * const response = await client.sandbox.webhooks.sendTest(); + * const testWebhookResponse = + * await client.sandbox.webhooks.sendTest(); * ``` */ - sendTest(options?: RequestOptions): APIPromise { + sendTest(options?: RequestOptions): APIPromise { return this._client.post('/sandbox/webhooks/test', { ...options, __security: { basicAuth: true } }); } } -export interface WebhookSendTestResponse { +export interface TestWebhookRequest { + /** + * Unique identifier for this webhook delivery (can be used for idempotency) + */ + id: string; + + /** + * ISO 8601 timestamp of when the webhook was sent + */ + timestamp: string; + + type: 'TEST'; +} + +export interface TestWebhookResponse { /** * The HTTP status code returned by the webhook endpoint */ @@ -39,5 +54,5 @@ export interface WebhookSendTestResponse { } export declare namespace Webhooks { - export { type WebhookSendTestResponse as WebhookSendTestResponse }; + export { type TestWebhookRequest as TestWebhookRequest, type TestWebhookResponse as TestWebhookResponse }; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 2fd9145f..14bc22be 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Shared from './shared'; import * as BeneficialOwnersAPI from './beneficial-owners'; +import * as CustomersAPI from './customers/customers'; import * as ExternalAccountsAPI from './customers/external-accounts'; import { DefaultPagination } from '../core/pagination'; @@ -121,12 +121,17 @@ export interface BdtBeneficiary { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export interface BdtExternalAccountCreateInfo { accountType: 'BDT_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + beneficiary: BdtBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** @@ -167,9 +172,10 @@ export interface BeneficialOwner { customerId: string; /** - * The current KYC status of a customer + * The current KYC status of a customer. `HOLD` means the customer is placed on + * hold and may be required to update or provide more information. */ - kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; + kycStatus: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; /** * Percentage of ownership in the business (0-100) @@ -235,76 +241,34 @@ export interface BulkCustomerImportErrorEntry { message?: string; } -export interface BusinessCustomer { +export interface BusinessCustomer extends CustomersAPI.Customer { customerType: 'BUSINESS'; - /** - * Platform-specific customer identifier - */ - platformCustomerId: string; - - /** - * Full UMA address (always present in responses, even if system-generated). This - * is an optional identifier to route payments to the customer. - */ - umaAddress: string; - - /** - * System-generated unique identifier - */ - id?: string; - address?: ExternalAccountsAPI.Address; beneficialOwners?: Array; /** - * Additional information for business entities + * Business information returned on a customer. `taxId` and `incorporatedOn` are + * required on creation but may be absent on legacy customers that pre-date the + * requirement, so both are optional in responses. */ businessInfo?: BusinessCustomer.BusinessInfo; /** - * Creation timestamp - */ - createdAt?: string; - - /** - * List of currency codes enabled for this customer. - */ - currencies?: Array; - - /** - * Email address for the customer. - */ - email?: string; - - /** - * Whether the customer is marked as deleted - */ - isDeleted?: boolean; - - /** - * The current KYB status of a business customer - */ - kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; - - /** - * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity - * and regulatory jurisdiction. - */ - region?: string; - - /** - * Last update timestamp + * The current KYB status of a business customer. `HOLD` means the customer is + * placed on hold and may be required to update or provide more information. */ - updatedAt?: string; + kybStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; } export namespace BusinessCustomer { /** - * Additional information for business entities + * Business information returned on a customer. `taxId` and `incorporatedOn` are + * required on creation but may be absent on legacy customers that pre-date the + * requirement, so both are optional in responses. */ - export interface BusinessInfo extends Shared.BusinessInfoUpdate { + export interface BusinessInfo { /** * Legal name of the business */ @@ -362,6 +326,12 @@ export namespace BusinessCustomer { | 'NON_PROFIT' | 'OTHER'; + /** + * List of countries of the business's expected transaction counterparties (ISO + * 3166-1 alpha-2) + */ + expectedCounterpartyCountries?: Array; + /** * Expected number of transactions per month */ @@ -393,6 +363,11 @@ export namespace BusinessCustomer { */ incorporatedOn?: string; + /** + * NAICS code describing the nature of the business (2-6 digits) + */ + naicsCode?: string; + /** * The intended purpose for using the Grid account */ @@ -411,6 +386,11 @@ export namespace BusinessCustomer { | 'CHARITABLE_DONATIONS' | 'OTHER'; + /** + * Description of the account purpose when OTHER is selected + */ + purposeOfAccountOtherDescription?: string; + /** * Business registration number */ @@ -421,6 +401,16 @@ export namespace BusinessCustomer { */ sourceOfFunds?: string; + /** + * Structured source-of-funds categories for the business + */ + sourceOfFundsCategories?: Array; + + /** + * Description of the source of funds when OTHER is selected + */ + sourceOfFundsOtherDescription?: string; + /** * Tax identification number */ @@ -428,132 +418,6 @@ export namespace BusinessCustomer { } } -/** - * Additional information for business entities - */ -export interface BusinessInfoUpdate { - /** - * The high-level industry category of the business - */ - businessType?: - | 'AGRICULTURE_FORESTRY_FISHING_AND_HUNTING' - | 'MINING_QUARRYING_AND_OIL_AND_GAS_EXTRACTION' - | 'UTILITIES' - | 'CONSTRUCTION' - | 'MANUFACTURING' - | 'WHOLESALE_TRADE' - | 'RETAIL_TRADE' - | 'TRANSPORTATION_AND_WAREHOUSING' - | 'INFORMATION' - | 'FINANCE_AND_INSURANCE' - | 'REAL_ESTATE_AND_RENTAL_AND_LEASING' - | 'PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_SERVICES' - | 'MANAGEMENT_OF_COMPANIES_AND_ENTERPRISES' - | 'ADMINISTRATIVE_AND_SUPPORT_AND_WASTE_MANAGEMENT_AND_REMEDIATION_SERVICES' - | 'EDUCATIONAL_SERVICES' - | 'HEALTH_CARE_AND_SOCIAL_ASSISTANCE' - | 'ARTS_ENTERTAINMENT_AND_RECREATION' - | 'ACCOMMODATION_AND_FOOD_SERVICES' - | 'OTHER_SERVICES' - | 'PUBLIC_ADMINISTRATION'; - - /** - * List of countries where the business operates (ISO 3166-1 alpha-2) - */ - countriesOfOperation?: Array; - - /** - * Country of incorporation or registration (ISO 3166-1 alpha-2) - */ - country?: string; - - /** - * Trade name or DBA name of the business, if different from the legal name - */ - doingBusinessAs?: string; - - /** - * Legal entity type of the business - */ - entityType?: - | 'SOLE_PROPRIETORSHIP' - | 'PARTNERSHIP' - | 'LLC' - | 'CORPORATION' - | 'S_CORPORATION' - | 'NON_PROFIT' - | 'OTHER'; - - /** - * Expected number of transactions per month - */ - expectedMonthlyTransactionCount?: - | 'COUNT_UNDER_10' - | 'COUNT_10_TO_100' - | 'COUNT_100_TO_500' - | 'COUNT_500_TO_1000' - | 'COUNT_OVER_1000'; - - /** - * Expected total transaction volume per month in USD equivalent - */ - expectedMonthlyTransactionVolume?: - | 'VOLUME_UNDER_10K' - | 'VOLUME_10K_TO_100K' - | 'VOLUME_100K_TO_1M' - | 'VOLUME_1M_TO_10M' - | 'VOLUME_OVER_10M'; - - /** - * List of countries where the business expects to send payments (ISO 3166-1 - * alpha-2) - */ - expectedRecipientJurisdictions?: Array; - - /** - * Date of incorporation in ISO 8601 format (YYYY-MM-DD) - */ - incorporatedOn?: string; - - /** - * Legal name of the business - */ - legalName?: string; - - /** - * The intended purpose for using the Grid account - */ - purposeOfAccount?: - | 'CONTRACTOR_PAYOUTS' - | 'CREATOR_PAYOUTS' - | 'EMPLOYEE_PAYOUTS' - | 'MARKETPLACE_SELLER_PAYOUTS' - | 'SUPPLIER_PAYMENTS' - | 'CROSS_BORDER_B2B' - | 'AR_AUTOMATION' - | 'AP_AUTOMATION' - | 'EMBEDDED_PAYMENTS' - | 'PLATFORM_FEE_COLLECTION' - | 'P2P_TRANSFERS' - | 'CHARITABLE_DONATIONS' - | 'OTHER'; - - /** - * Business registration number - */ - registrationNumber?: string; - - /** - * The primary source of funds for the business - */ - sourceOfFunds?: string; - - /** - * Tax identification number - */ - taxId?: string; -} - export interface BwpBeneficiary { beneficiaryType: 'INDIVIDUAL'; @@ -689,14 +553,12 @@ export interface CopBeneficiary { countryOfResidence?: string; /** - * Identity document number — required by most Colombian banks + * The identity document number */ documentNumber?: string; /** - * Identity document type — required by most Colombian banks. CC: Cédula de - * Ciudadanía, CE: Cédula de Extranjería, TI: Tarjeta de Identidad, NIT: Número de - * Identificación Tributaria, PP: Passport + * Identity document type (Colombia) */ documentType?: 'CC' | 'CE' | 'TI' | 'NIT' | 'PP'; @@ -719,31 +581,31 @@ export interface CopBeneficiary { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: bankName, accountNumber, bankAccountType - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankAccountType, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export interface CopExternalAccountCreateInfo { accountType: 'COP_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + beneficiary: CopBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** - * The account number of the bank (BANK_TRANSFER only) + * The account number of the bank */ accountNumber?: string; /** - * The bank account type (BANK_TRANSFER only) + * The bank account type */ bankAccountType?: 'CHECKING' | 'SAVINGS'; /** - * The name of the bank (BANK_TRANSFER only) - */ - bankName?: string; - - /** - * The phone number in international format (MOBILE_MONEY only — Nequi, Daviplata) + * The phone number in international format */ phoneNumber?: string; } @@ -765,30 +627,25 @@ export interface DkkExternalAccountCreateInfo { } export interface EgpBeneficiary { - address: ExternalAccountsAPI.Address; - beneficiaryType: 'INDIVIDUAL'; - /** - * The country of residence of the beneficiary - */ - countryOfResidence: string; - /** * The full name of the beneficiary */ fullName: string; - /** - * The phone number of the beneficiary - */ - phoneNumber: string; + address?: ExternalAccountsAPI.Address; /** * The birth date of the beneficiary */ birthDate?: string; + /** + * The country of residence of the beneficiary + */ + countryOfResidence?: string; + /** * The email of the beneficiary */ @@ -798,14 +655,20 @@ export interface EgpBeneficiary { * The nationality of the beneficiary */ nationality?: string; -} -export interface EgpExternalAccountCreateInfo { /** - * The account number of the bank + * The phone number of the beneficiary */ - accountNumber: string; + phoneNumber?: string; +} +/** + * Required fields depend on the selected paymentRails: + * + * - BANK_TRANSFER: bankName, iban + * - MOBILE_MONEY: bankName, phoneNumber + */ +export interface EgpExternalAccountCreateInfo { accountType: 'EGP_ACCOUNT'; /** @@ -821,33 +684,33 @@ export interface EgpExternalAccountCreateInfo { iban?: string; /** - * The SWIFT/BIC code of the bank + * The phone number in international format */ - swiftCode?: string; + phoneNumber?: string; } export type EthereumWalletExternalAccountInfo = unknown; export interface EurBeneficiary { - address: ExternalAccountsAPI.Address; - beneficiaryType: 'INDIVIDUAL'; + /** + * The country of residence of the beneficiary + */ + countryOfResidence: string; + /** * The full name of the beneficiary */ fullName: string; + address?: ExternalAccountsAPI.Address; + /** * The birth date of the beneficiary */ birthDate?: string; - /** - * The country of residence of the beneficiary - */ - countryOfResidence?: string; - /** * The email of the beneficiary */ @@ -935,12 +798,17 @@ export interface GhsBeneficiary { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber - * - MOBILE_MONEY: phoneNumber + * - BANK_TRANSFER: accountNumber, bankName + * - MOBILE_MONEY: bankName, phoneNumber */ export interface GhsExternalAccountCreateInfo { accountType: 'GHS_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + beneficiary: GhsBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** @@ -1003,6 +871,11 @@ export interface GtqExternalAccountCreateInfo { */ bankAccountType: 'CHECKING' | 'SAVINGS'; + /** + * The name of the beneficiary's bank + */ + bankName: string; + beneficiary: GtqBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; } @@ -1100,25 +973,9 @@ export interface IdrExternalAccountCreateInfo { swiftCode: string; } -export interface IndividualCustomer { +export interface IndividualCustomer extends CustomersAPI.Customer { customerType: 'INDIVIDUAL'; - /** - * Platform-specific customer identifier - */ - platformCustomerId: string; - - /** - * Full UMA address (always present in responses, even if system-generated). This - * is an optional identifier to route payments to the customer. - */ - umaAddress: string; - - /** - * System-generated unique identifier - */ - id?: string; - address?: ExternalAccountsAPI.Address; /** @@ -1127,61 +984,60 @@ export interface IndividualCustomer { birthDate?: string; /** - * Creation timestamp + * Individual's full name */ - createdAt?: string; + fullName?: string; /** - * List of currency codes enabled for this customer. + * The current KYC status of a customer. `HOLD` means the customer is placed on + * hold and may be required to update or provide more information. */ - currencies?: Array; + kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'HOLD'; /** - * Email address for the customer. + * Country code (ISO 3166-1 alpha-2) */ - email?: string; + nationality?: string; +} - /** - * Individual's full name - */ - fullName?: string; +/** + * Required fields depend on the selected paymentRails: + * + * - NEFT: accountNumber, ifsc, rail + * - RTGS: accountNumber, ifsc, rail + * - UPI: vpa + */ +export interface InrExternalAccountCreateInfo { + accountType: 'INR_ACCOUNT'; - /** - * Whether the customer is marked as deleted - */ - isDeleted?: boolean; + beneficiary: ExternalAccountsAPI.InrBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** - * The current KYC status of a customer + * Indian bank account number (9–18 digits) */ - kycStatus?: 'UNVERIFIED' | 'PENDING' | 'APPROVED' | 'REJECTED'; + accountNumber?: string; /** - * Country code (ISO 3166-1 alpha-2) + * The name of the bank */ - nationality?: string; + bankName?: string; /** - * Country code (ISO 3166-1 alpha-2) representing the customer's regional identity - * and regulatory jurisdiction. + * The Indian Financial System Code (IFSC) of the beneficiary's bank branch + * (NEFT/RTGS) */ - region?: string; + ifsc?: string; /** - * Last update timestamp + * The payment rail to route the payout over, for currencies that support more than + * one (e.g. NEFT or RTGS for INR). */ - updatedAt?: string; -} - -export interface InrExternalAccountCreateInfo { - accountType: 'INR_ACCOUNT'; - - beneficiary: ExternalAccountsAPI.InrBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; + rail?: string; /** * The UPI Virtual Payment Address */ - vpa: string; + vpa?: string; } export interface JmdBeneficiary { @@ -1233,6 +1089,11 @@ export interface JmdExternalAccountCreateInfo { */ bankAccountType: 'CHECKING' | 'SAVINGS'; + /** + * The name of the bank + */ + bankName: string; + beneficiary: JmdBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** @@ -1484,12 +1345,17 @@ export interface PkrBeneficiary { /** * Required fields depend on the selected paymentRails: * - * - BANK_TRANSFER: accountNumber + * - BANK_TRANSFER: accountNumber, bankName * - MOBILE_MONEY: bankName, phoneNumber */ export interface PkrExternalAccountCreateInfo { accountType: 'PKR_ACCOUNT'; + /** + * The name of the bank + */ + bankName: string; + beneficiary: PkrBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** @@ -1497,11 +1363,6 @@ export interface PkrExternalAccountCreateInfo { */ accountNumber?: string; - /** - * The name of the bank - */ - bankName?: string; - /** * Pakistani IBAN (24 characters, starting with PK) */ @@ -1573,17 +1434,18 @@ export interface SgdExternalAccountCreateInfo { accountType: 'SGD_ACCOUNT'; - /** - * Name of the beneficiary's bank - */ - bankName: string; - beneficiary: ExternalAccountsAPI.SgdBeneficiary | ExternalAccountsAPI.BusinessBeneficiary; /** * The SWIFT/BIC code of the bank */ swiftCode: string; + + /** + * Name of the beneficiary's bank. When omitted, resolved from swiftCode via the + * payout partner bank directory at account creation. + */ + bankName?: string; } export interface SlvBeneficiary { @@ -1902,7 +1764,9 @@ export interface VerificationError { | 'APPLICANT_FRAUD' | 'APPLICANT_CRIMINAL_RECORD' | 'APPLICANT_REJECTED' - | 'MISSING_BENEFICIAL_OWNER'; + | 'MISSING_BENEFICIAL_OWNER' + | 'MISSING_CONTROL_PERSON' + | 'MISSING_GOOD_STANDING_DOCUMENT'; /** * Document types that would satisfy this requirement. The integrator can upload diff --git a/src/resources/tokens.ts b/src/resources/tokens.ts index c4d8fcd5..ca1203fb 100644 --- a/src/resources/tokens.ts +++ b/src/resources/tokens.ts @@ -121,6 +121,18 @@ export interface APIToken { clientSecret?: string; } +export interface APITokenCreateRequest { + /** + * Name of the token to help identify it + */ + name: string; + + /** + * A list of permissions to grant to the token + */ + permissions: Array; +} + /** * Permission of an API token that determines what actions the token can perform: * VIEW: Can view all data, including platform config, customers and transactions @@ -129,6 +141,28 @@ export interface APIToken { */ export type Permission = 'VIEW' | 'TRANSACT' | 'MANAGE'; +export interface TokenListResponse { + /** + * List of tokens matching the filter criteria + */ + data: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of tokens matching the criteria (excluding pagination) + */ + totalCount?: number; +} + export interface TokenCreateParams { /** * Name of the token to help identify it @@ -176,7 +210,9 @@ export interface TokenListParams extends DefaultPaginationParams { export declare namespace Tokens { export { type APIToken as APIToken, + type APITokenCreateRequest as APITokenCreateRequest, type Permission as Permission, + type TokenListResponse as TokenListResponse, type APITokensDefaultPagination as APITokensDefaultPagination, type TokenCreateParams as TokenCreateParams, type TokenListParams as TokenListParams, diff --git a/src/resources/transactions.ts b/src/resources/transactions.ts index 0105b57c..c3a2b500 100644 --- a/src/resources/transactions.ts +++ b/src/resources/transactions.ts @@ -5,6 +5,7 @@ import * as InvitationsAPI from './invitations'; import * as QuotesAPI from './quotes'; import * as TransferInAPI from './transfer-in'; import { TransactionsDefaultPagination } from './transfer-in'; +import * as SimulateAPI from './sandbox/cards/simulate'; import { APIPromise } from '../core/api-promise'; import { DefaultPagination, type DefaultPaginationParams, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; @@ -36,6 +37,11 @@ export class Transactions extends APIResource { * transactions can be filtered by customer ID, platform customer ID, UMA address, * date range, status, and transaction type. * + * Card transactions are included and identified by `type: CARD`. In Sandbox this + * is how you discover a `CardTransaction` id after simulating an authorization — + * list the transactions, take the card transaction's `id`, and pass it as the + * `cardTransactionId` to the clearing and return simulate endpoints. + * * @example * ```ts * // Automatically fetches more pages as needed. @@ -158,6 +164,11 @@ export interface IncomingTransaction { destination: unknown; + /** + * Whether this transaction credits or debits the customer's account. + */ + direction: 'CREDIT' | 'DEBIT'; + /** * Platform-specific ID of the customer (sender for outgoing, recipient for * incoming) @@ -236,6 +247,12 @@ export interface IncomingTransaction { */ rateDetails?: IncomingRateDetails; + /** + * The time at which the platform confirmed delivery of the receipt to their + * customer. + */ + receiptDeliveryConfirmedAt?: string; + /** * Included for all transactions except those with "CREATED" status */ @@ -267,6 +284,11 @@ export interface OutgoingTransaction { destination: unknown; + /** + * Whether this transaction credits or debits the customer's account. + */ + direction: 'CREDIT' | 'DEBIT'; + /** * Platform-specific ID of the customer (sender for outgoing, recipient for * incoming) @@ -325,6 +347,12 @@ export interface OutgoingTransaction { */ exchangeRate?: number; + /** + * Expected settlement time at the beneficiary. Null for instant rails (settlement + * is immediate) and before a rail with deferred settlement is resolved. + */ + expectedSettlementAt?: string; + /** * If the transaction failed, this field provides the reason for failure. */ @@ -346,16 +374,60 @@ export interface OutgoingTransaction { */ paymentInstructions?: Array; + /** + * The payment rail used to settle this transaction (e.g. ACH, WIRE, NEFT, + * FASTER_PAYMENTS). Uses the same values as the PaymentRail sent on quote + * requests. Null when no external rail is used (e.g. instant or intra-network + * transfers, or non-direct-destination transactions) or before a rail is resolved. + */ + paymentRail?: + | 'ACH' + | 'ACH_COLOMBIA' + | 'BANK_TRANSFER' + | 'BRE_B' + | 'CIPS' + | 'FAST' + | 'FASTER_PAYMENTS' + | 'FEDNOW' + | 'INSTAPAY' + | 'MOBILE_MONEY' + | 'NEFT' + | 'PAYNOW' + | 'PESONET' + | 'PIX' + | 'RTGS' + | 'RTP' + | 'SEPA' + | 'SEPA_INSTANT' + | 'SPEI' + | 'SWIFT' + | 'UNIONPAY' + | 'UPI' + | 'WIRE' + | null; + /** * The ID of the quote that was used to trigger this payment */ quoteId?: string; + /** + * How the rail was chosen — MANUAL when the platform specified a paymentRail on + * the destination, AUTO when Lightspark selects it. Null when no rail is resolved. + */ + railSelectionMode?: 'AUTO' | 'MANUAL' | null; + /** * Details about the rate and fees for the transaction. */ rateDetails?: QuotesAPI.OutgoingRateDetails; + /** + * The time at which the platform confirmed delivery of the receipt to their + * customer. + */ + receiptDeliveryConfirmedAt?: string; + /** * Amount to be received by recipient in the recipient's currency */ @@ -370,7 +442,7 @@ export interface OutgoingTransaction { /** * The refund if transaction was refunded. */ - refund?: OutgoingTransaction.Refund; + refund?: SimulateAPI.Refund; /** * When the payment was or will be settled @@ -378,41 +450,15 @@ export interface OutgoingTransaction { settledAt?: string; /** - * When the transaction was last updated + * Expected number of seconds from quote creation to settlement. Null when not yet + * known. */ - updatedAt?: string; -} + settlementTimelineSeconds?: number | null; -export namespace OutgoingTransaction { /** - * The refund if transaction was refunded. + * When the transaction was last updated */ - export interface Refund { - /** - * When the refund was initiated - */ - initiatedAt: string; - - /** - * The unique reference ID of the refund - */ - reference: string; - - /** - * Current status of the refund - */ - status: 'PENDING' | 'COMPLETED' | 'FAILED'; - - /** - * Reason for the refund - */ - reason?: 'TRANSACTION_FAILED' | 'USER_CANCELLATION' | 'TIMEOUT'; - - /** - * When the refund was settled - */ - settledAt?: string; - } + updatedAt?: string; } /** @@ -442,6 +488,28 @@ export interface ReconciliationInstructions { transactionHash?: string; } +export interface TransactionListResponse { + /** + * List of transactions matching the criteria + */ + data: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of transactions matching the criteria (excluding pagination) + */ + totalCount?: number; +} + export type TransactionSourceOneOf = unknown; /** @@ -571,6 +639,7 @@ export declare namespace Transactions { type OutgoingTransaction as OutgoingTransaction, type OutgoingTransactionStatus as OutgoingTransactionStatus, type ReconciliationInstructions as ReconciliationInstructions, + type TransactionListResponse as TransactionListResponse, type TransactionSourceOneOf as TransactionSourceOneOf, type TransactionStatus as TransactionStatus, type TransactionType as TransactionType, diff --git a/src/resources/transfer-in.ts b/src/resources/transfer-in.ts index fcc7a295..fe801e37 100644 --- a/src/resources/transfer-in.ts +++ b/src/resources/transfer-in.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 CardsAPI from './cards'; import * as TransactionsAPI from './transactions'; import { APIPromise } from '../core/api-promise'; import { DefaultPagination } from '../core/pagination'; @@ -71,7 +72,35 @@ export interface InternalAccountReference { accountId: string; } -export type Transaction = TransactionsAPI.IncomingTransaction | TransactionsAPI.OutgoingTransaction; +/** + * Parent transaction row for a card authorization and all of the pulls / + * settlements / refunds that reconcile against it. Child events are rolled up into + * the `pullSummary`, `refundSummary`, and `settlementSummary` aggregates. + * Delivered as the payload of the generic transaction webhook stream (extends the + * Transaction model with a card destination type) on every transition. + */ +export type Transaction = + | TransactionsAPI.IncomingTransaction + | TransactionsAPI.OutgoingTransaction + | CardsAPI.CardTransaction; + +export interface TransferInRequest { + /** + * Destination internal account details + */ + destination: InternalAccountReference; + + /** + * Source external account details + */ + source: ExternalAccountReference; + + /** + * Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis + * for BTC) + */ + amount?: number; +} export interface TransferInCreateParams { /** @@ -103,6 +132,7 @@ export declare namespace TransferIn { type ExternalAccountReference as ExternalAccountReference, type InternalAccountReference as InternalAccountReference, type Transaction as Transaction, + type TransferInRequest as TransferInRequest, type TransferInCreateParams as TransferInCreateParams, }; } diff --git a/src/resources/transfer-out.ts b/src/resources/transfer-out.ts index b78bcd65..cc5f63ee 100644 --- a/src/resources/transfer-out.ts +++ b/src/resources/transfer-out.ts @@ -20,12 +20,14 @@ export class TransferOut extends APIResource { * destination: { * accountId: * 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965', + * paymentRail: 'ACH', * }, * source: { * accountId: * 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', * }, * amount: 12550, + * remittanceInformation: '12345', * }); * ``` */ @@ -43,11 +45,80 @@ export class TransferOut extends APIResource { } } +export interface TransferOutRequest { + /** + * Destination external account details + */ + destination: TransferOutRequest.Destination; + + /** + * Source internal account details + */ + source: TransferInAPI.InternalAccountReference; + + /** + * Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis + * for BTC) + */ + amount?: number; + + /** + * Free-form information about the payment that travels with it to the recipient. + * The field this populates depends on the payment rail: for ACH it populates the + * Addenda record, for FedNow and RTP it populates the remittanceInformation field, + * and for wires it populates the OBI (Originator to Beneficiary Information) / + * beneficiary information. + */ + remittanceInformation?: string; +} + +export namespace TransferOutRequest { + /** + * Destination external account details + */ + export interface Destination { + /** + * Reference to an external account ID + */ + accountId: string; + + /** + * The payment rail to use for the transfer. Must be one of the rails supported by + * the destination account. If not specified, the system will select a default + * rail. + */ + paymentRail?: + | 'ACH' + | 'ACH_COLOMBIA' + | 'BANK_TRANSFER' + | 'BRE_B' + | 'CIPS' + | 'FAST' + | 'FASTER_PAYMENTS' + | 'FEDNOW' + | 'INSTAPAY' + | 'MOBILE_MONEY' + | 'NEFT' + | 'PAYNOW' + | 'PESONET' + | 'PIX' + | 'RTGS' + | 'RTP' + | 'SEPA' + | 'SEPA_INSTANT' + | 'SPEI' + | 'SWIFT' + | 'UNIONPAY' + | 'UPI' + | 'WIRE'; + } +} + export interface TransferOutCreateParams { /** * Body param: Destination external account details */ - destination: TransferInAPI.ExternalAccountReference; + destination: TransferOutCreateParams.Destination; /** * Body param: Source internal account details @@ -60,6 +131,15 @@ export interface TransferOutCreateParams { */ amount?: number; + /** + * Body param: Free-form information about the payment that travels with it to the + * recipient. The field this populates depends on the payment rail: for ACH it + * populates the Addenda record, for FedNow and RTP it populates the + * remittanceInformation field, and for wires it populates the OBI (Originator to + * Beneficiary Information) / beneficiary information. + */ + remittanceInformation?: string; + /** * Header param: A unique identifier for the request. If the same key is sent * multiple times, the server will return the same response as the first request. @@ -67,6 +147,51 @@ export interface TransferOutCreateParams { 'Idempotency-Key'?: string; } +export namespace TransferOutCreateParams { + /** + * Destination external account details + */ + export interface Destination { + /** + * Reference to an external account ID + */ + accountId: string; + + /** + * The payment rail to use for the transfer. Must be one of the rails supported by + * the destination account. If not specified, the system will select a default + * rail. + */ + paymentRail?: + | 'ACH' + | 'ACH_COLOMBIA' + | 'BANK_TRANSFER' + | 'BRE_B' + | 'CIPS' + | 'FAST' + | 'FASTER_PAYMENTS' + | 'FEDNOW' + | 'INSTAPAY' + | 'MOBILE_MONEY' + | 'NEFT' + | 'PAYNOW' + | 'PESONET' + | 'PIX' + | 'RTGS' + | 'RTP' + | 'SEPA' + | 'SEPA_INSTANT' + | 'SPEI' + | 'SWIFT' + | 'UNIONPAY' + | 'UPI' + | 'WIRE'; + } +} + export declare namespace TransferOut { - export { type TransferOutCreateParams as TransferOutCreateParams }; + export { + type TransferOutRequest as TransferOutRequest, + type TransferOutCreateParams as TransferOutCreateParams, + }; } diff --git a/src/resources/uma-providers.ts b/src/resources/uma-providers.ts index 7a8f2205..87ac61bf 100644 --- a/src/resources/uma-providers.ts +++ b/src/resources/uma-providers.ts @@ -14,8 +14,8 @@ export class UmaProviders extends APIResource { list( query: UmaProviderListParams | null | undefined = {}, options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/uma-providers', DefaultPagination, { + ): PagePromise { + return this._client.getAPIList('/uma-providers', DefaultPagination, { query, ...options, __security: { basicAuth: true }, @@ -23,9 +23,9 @@ export class UmaProviders extends APIResource { } } -export type UmaProviderListResponsesDefaultPagination = DefaultPagination; +export type UmaProvidersDefaultPagination = DefaultPagination; -export interface UmaProviderListResponse { +export interface UmaProvider { /** * Whether this UMA Provider is on your allow list */ @@ -62,6 +62,28 @@ export interface UmaProviderListResponse { supportedRegions?: Array; } +export interface UmaProviderListResponse { + /** + * List of available UMA Providers using Grid + */ + data?: Array; + + /** + * Indicates if more results are available beyond this page + */ + hasMore?: boolean; + + /** + * Cursor to retrieve the next page of results (only present if hasMore is true) + */ + nextCursor?: string; + + /** + * Total number of transactions matching the criteria (excluding pagination) + */ + totalCount?: number; +} + export interface UmaProviderListParams extends DefaultPaginationParams { /** * The alpha-2 representation of a country, as defined by the ISO 3166-1 standard. @@ -92,8 +114,9 @@ export interface UmaProviderListParams extends DefaultPaginationParams { export declare namespace UmaProviders { export { + type UmaProvider as UmaProvider, type UmaProviderListResponse as UmaProviderListResponse, - type UmaProviderListResponsesDefaultPagination as UmaProviderListResponsesDefaultPagination, + type UmaProvidersDefaultPagination as UmaProvidersDefaultPagination, type UmaProviderListParams as UmaProviderListParams, }; } diff --git a/src/resources/verifications.ts b/src/resources/verifications.ts index 20fb80d7..c2ebff94 100644 --- a/src/resources/verifications.ts +++ b/src/resources/verifications.ts @@ -21,7 +21,7 @@ export class Verifications extends APIResource { * ); * ``` */ - retrieve(verificationID: string, options?: RequestOptions): APIPromise { + retrieve(verificationID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/verifications/${verificationID}`, { ...options, __security: { basicAuth: true }, @@ -35,7 +35,7 @@ export class Verifications extends APIResource { * @example * ```ts * // Automatically fetches more pages as needed. - * for await (const verificationListResponse of client.verifications.list()) { + * for await (const verification of client.verifications.list()) { * // ... * } * ``` @@ -43,8 +43,8 @@ export class Verifications extends APIResource { list( query: VerificationListParams | null | undefined = {}, options?: RequestOptions, - ): PagePromise { - return this._client.getAPIList('/verifications', DefaultPagination, { + ): PagePromise { + return this._client.getAPIList('/verifications', DefaultPagination, { query, ...options, __security: { basicAuth: true }, @@ -59,22 +59,64 @@ export class Verifications extends APIResource { * * Call this endpoint again after resolving errors to re-submit. * + * ### What to collect for KYB + * + * Before submitting a `BUSINESS` customer, collect the following via + * `POST /customers`, `POST /beneficial-owners`, and `POST /documents`: + * + * **Business identifying information** + * + * - Entity full legal name + * - Doing Business As (DBA) name, if applicable + * - Physical address — principal place of business + * - Countries of operation + * - Identification number — U.S. taxpayer identification number, or, for a foreign + * business without one, alternative government-issued documentation certifying + * the existence of the business + * + * **Ownership and control structure** — collected for **one control person** (an + * individual with significant responsibility to control, manage, or direct the + * legal entity) **and all beneficial owners** (every individual who owns 25% or + * more, directly or indirectly). For each, provide: + * + * - Full name + * - Date of birth + * - Address + * - Identification number: + * - U.S. persons — SSN or ITIN + * - Non-U.S. persons — one or more of: ITIN, passport (with country of + * issuance), alien identification card, or another government-issued photo ID + * evidencing nationality or residence + * + * **Required documents** + * + * - Company formation and existence documents (certificate of incorporation, + * articles of association, etc.) + * - Proof of ownership and control structure (organization and ownership chart, + * shareholder agreements, operating agreements, register of members, or + * certification of controlling person and beneficial owners) + * - Proof of address dated within the last 3 months (utility bill, bank statement, + * lease agreement, or official correspondence) + * - Tax ID or equivalent identifying-number documents + * - For non-U.S. beneficial owners — passport plus one additional + * government-issued ID + * * @example * ```ts - * const response = await client.verifications.submit({ + * const verification = await client.verifications.submit({ * customerId: * 'Customer:019542f5-b3e7-1d02-0000-000000000001', * }); * ``` */ - submit(body: VerificationSubmitParams, options?: RequestOptions): APIPromise { + submit(body: VerificationSubmitParams, options?: RequestOptions): APIPromise { return this._client.post('/verifications', { body, ...options, __security: { basicAuth: true } }); } } -export type VerificationListResponsesDefaultPagination = DefaultPagination; +export type VerificationsDefaultPagination = DefaultPagination; -export interface VerificationRetrieveResponse { +export interface Verification { /** * Unique identifier for this verification */ @@ -115,80 +157,31 @@ export interface VerificationRetrieveResponse { export interface VerificationListResponse { /** - * Unique identifier for this verification - */ - id: string; - - /** - * When this verification was created - */ - createdAt: string; - - /** - * The ID of the customer being verified + * List of verifications matching the filter criteria */ - customerId: string; + data: Array; /** - * List of issues preventing verification from proceeding. Empty when - * verificationStatus is APPROVED or IN_PROGRESS. + * Indicates if more results are available beyond this page */ - errors: Array; + hasMore: boolean; /** - * Current status of the KYC/KYB verification + * Cursor to retrieve the next page of results (only present if hasMore is true) */ - verificationStatus: - | 'RESOLVE_ERRORS' - | 'PENDING_MANUAL_REVIEW' - | 'IN_PROGRESS' - | 'APPROVED' - | 'REJECTED' - | 'READY_FOR_VERIFICATION'; + nextCursor?: string; /** - * When this verification was last updated + * Total number of results matching the criteria */ - updatedAt?: string; + totalCount?: number; } -export interface VerificationSubmitResponse { +export interface VerificationRequest { /** - * Unique identifier for this verification - */ - id: string; - - /** - * When this verification was created - */ - createdAt: string; - - /** - * The ID of the customer being verified + * The ID of the customer to verify */ customerId: string; - - /** - * List of issues preventing verification from proceeding. Empty when - * verificationStatus is APPROVED or IN_PROGRESS. - */ - errors: Array; - - /** - * Current status of the KYC/KYB verification - */ - verificationStatus: - | 'RESOLVE_ERRORS' - | 'PENDING_MANUAL_REVIEW' - | 'IN_PROGRESS' - | 'APPROVED' - | 'REJECTED' - | 'READY_FOR_VERIFICATION'; - - /** - * When this verification was last updated - */ - updatedAt?: string; } export interface VerificationListParams extends DefaultPaginationParams { @@ -223,10 +216,10 @@ export interface VerificationSubmitParams { export declare namespace Verifications { export { - type VerificationRetrieveResponse as VerificationRetrieveResponse, + type Verification as Verification, type VerificationListResponse as VerificationListResponse, - type VerificationSubmitResponse as VerificationSubmitResponse, - type VerificationListResponsesDefaultPagination as VerificationListResponsesDefaultPagination, + type VerificationRequest as VerificationRequest, + type VerificationsDefaultPagination as VerificationsDefaultPagination, type VerificationListParams as VerificationListParams, type VerificationSubmitParams as VerificationSubmitParams, }; diff --git a/src/resources/webhooks.ts b/src/resources/webhooks.ts index 0b583961..8f645945 100644 --- a/src/resources/webhooks.ts +++ b/src/resources/webhooks.ts @@ -1,12 +1,16 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; +import * as CardsAPI from './cards'; import * as InvitationsAPI from './invitations'; import * as ReceiverAPI from './receiver'; import * as Shared from './shared'; import * as TransactionsAPI from './transactions'; +import * as VerificationsAPI from './verifications'; import * as AgentsAPI from './agents/agents'; +import * as CustomersAPI from './customers/customers'; import * as InternalAccountsAPI from './sandbox/internal-accounts'; +import * as SandboxWebhooksAPI from './sandbox/webhooks'; export class Webhooks extends APIResource { unwrap(body: string): UnwrapWebhookEvent { @@ -33,10 +37,6 @@ export interface AgentActionWebhookEvent { */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'AGENT_ACTION.PENDING_APPROVAL'; } @@ -53,10 +53,6 @@ export interface IncomingPaymentWebhookEvent { */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'INCOMING_PAYMENT.PENDING' | 'INCOMING_PAYMENT.COMPLETED' | 'INCOMING_PAYMENT.FAILED'; } @@ -84,10 +80,6 @@ export interface OutgoingPaymentWebhookEvent { */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: | 'OUTGOING_PAYMENT.PENDING' | 'OUTGOING_PAYMENT.PROCESSING' @@ -99,24 +91,6 @@ export interface OutgoingPaymentWebhookEvent { | 'OUTGOING_PAYMENT.REFUND_FAILED'; } -export interface TestWebhookWebhookEvent { - /** - * Unique identifier for this webhook delivery (can be used for idempotency) - */ - id: string; - - /** - * ISO 8601 timestamp of when the webhook was sent - */ - timestamp: string; - - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ - type: 'TEST'; -} - export interface BulkUploadWebhookEvent { /** * Unique identifier for this webhook delivery (can be used for idempotency) @@ -130,10 +104,6 @@ export interface BulkUploadWebhookEvent { */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'BULK_UPLOAD.COMPLETED' | 'BULK_UPLOAD.FAILED'; } @@ -200,10 +170,6 @@ export interface InvitationClaimedWebhookEvent { */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'INVITATION.CLAIMED'; } @@ -213,17 +179,13 @@ export interface CustomerUpdateWebhookEvent { */ id: string; - data: Shared.IndividualCustomer | Shared.BusinessCustomer; + data: CustomersAPI.CustomerOneOf; /** * ISO 8601 timestamp of when the webhook was sent */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: | 'CUSTOMER.KYC_APPROVED' | 'CUSTOMER.KYC_REJECTED' @@ -246,10 +208,6 @@ export interface InternalAccountStatusWebhookEvent { */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'INTERNAL_ACCOUNT.BALANCE_UPDATED' | 'INTERNAL_ACCOUNT.STATUS_UPDATED'; } @@ -259,17 +217,13 @@ export interface VerificationUpdateWebhookEvent { */ id: string; - data: VerificationUpdateWebhookEvent.Data; + data: VerificationsAPI.Verification; /** * ISO 8601 timestamp of when the webhook was sent */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: | 'VERIFICATION.APPROVED' | 'VERIFICATION.REJECTED' @@ -278,242 +232,43 @@ export interface VerificationUpdateWebhookEvent { | 'VERIFICATION.PENDING_MANUAL_REVIEW'; } -export namespace VerificationUpdateWebhookEvent { - export interface Data { - /** - * Unique identifier for this verification - */ - id: string; - - /** - * When this verification was created - */ - createdAt: string; - - /** - * The ID of the customer being verified - */ - customerId: string; - - /** - * List of issues preventing verification from proceeding. Empty when - * verificationStatus is APPROVED or IN_PROGRESS. - */ - errors: Array; - - /** - * Current status of the KYC/KYB verification - */ - verificationStatus: - | 'RESOLVE_ERRORS' - | 'PENDING_MANUAL_REVIEW' - | 'IN_PROGRESS' - | 'APPROVED' - | 'REJECTED' - | 'READY_FOR_VERIFICATION'; - - /** - * When this verification was last updated - */ - updatedAt?: string; - } -} - export interface CardStateChangeWebhookEvent { /** * Unique identifier for this webhook delivery (can be used for idempotency) */ id: string; - data: CardStateChangeWebhookEvent.Data; + data: CardsAPI.Card; /** * ISO 8601 timestamp of when the webhook was sent */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'CARD.STATE_CHANGE'; } -export namespace CardStateChangeWebhookEvent { - export interface Data { - /** - * The id of the `Customer` who holds this card. - */ - cardholderId: string; - - /** - * Physical form factor of the card. Only `VIRTUAL` is supported in v1; `PHYSICAL` - * will be added in a later release. - */ - form: 'VIRTUAL'; - - /** - * Internal account ids bound to this card as funding sources, in priority order — - * the first entry is tried first by Authorization Decisioning. Every card has at - * least one funding source. - */ - fundingSources: Array; - - /** - * Lifecycle state of a card. - * - * | State | Description | - * | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | - * | `PENDING_ISSUE` | The card has been requested and is being provisioned with the issuer. | - * | `ACTIVE` | The card is live and can authorize transactions. | - * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | - * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | - */ - state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; - - /** - * Card network brand. Read-only — determined by Grid when the card is provisioned - * with the issuer. - */ - brand?: 'VISA' | 'MASTERCARD'; - - /** - * Card expiration month (1–12). - */ - expMonth?: number; - - /** - * Card expiration year (four digits). - */ - expYear?: number; - - /** - * Last four digits of the card PAN. - */ - last4?: string; - - /** - * URL of the card issuer's iframe that securely displays the PAN, CVV, and expiry - * to the cardholder. The full PAN and CVV never cross Grid's servers — render this - * URL in an iframe in your client to reveal card details. - */ - panEmbedUrl?: string; - - /** - * Platform-specific card identifier. Optional on create — system-generated if - * omitted, mirroring `platformCustomerId` semantics. - */ - platformCardId?: string; - - /** - * Reason associated with the current `state`. Populated when the card is `CLOSED` - * or when provisioning was rejected; otherwise null. - */ - stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID' | null; - } -} - export interface CardFundingSourceChangeWebhookEvent { /** * Unique identifier for this webhook delivery (can be used for idempotency) */ id: string; - data: CardFundingSourceChangeWebhookEvent.Data; + data: CardsAPI.Card; /** * ISO 8601 timestamp of when the webhook was sent */ timestamp: string; - /** - * Status-specific event type in OBJECT.EVENT dot-notation (e.g., - * OUTGOING_PAYMENT.COMPLETED) - */ type: 'CARD.FUNDING_SOURCE_CHANGE'; } -export namespace CardFundingSourceChangeWebhookEvent { - export interface Data { - /** - * The id of the `Customer` who holds this card. - */ - cardholderId: string; - - /** - * Physical form factor of the card. Only `VIRTUAL` is supported in v1; `PHYSICAL` - * will be added in a later release. - */ - form: 'VIRTUAL'; - - /** - * Internal account ids bound to this card as funding sources, in priority order — - * the first entry is tried first by Authorization Decisioning. Every card has at - * least one funding source. - */ - fundingSources: Array; - - /** - * Lifecycle state of a card. - * - * | State | Description | - * | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `PENDING_KYC` | The cardholder has not yet completed KYC. Cards in this state cannot transact. | - * | `PENDING_ISSUE` | The card has been requested and is being provisioned with the issuer. | - * | `ACTIVE` | The card is live and can authorize transactions. | - * | `FROZEN` | The card is temporarily disabled by the platform. New authorizations are declined with `CARD_PAUSED`. Existing settlements and refunds continue to reconcile. | - * | `CLOSED` | The card is permanently closed. Terminal, irreversible state. | - */ - state: 'PENDING_KYC' | 'PENDING_ISSUE' | 'ACTIVE' | 'FROZEN' | 'CLOSED'; - - /** - * Card network brand. Read-only — determined by Grid when the card is provisioned - * with the issuer. - */ - brand?: 'VISA' | 'MASTERCARD'; - - /** - * Card expiration month (1–12). - */ - expMonth?: number; - - /** - * Card expiration year (four digits). - */ - expYear?: number; - - /** - * Last four digits of the card PAN. - */ - last4?: string; - - /** - * URL of the card issuer's iframe that securely displays the PAN, CVV, and expiry - * to the cardholder. The full PAN and CVV never cross Grid's servers — render this - * URL in an iframe in your client to reveal card details. - */ - panEmbedUrl?: string; - - /** - * Platform-specific card identifier. Optional on create — system-generated if - * omitted, mirroring `platformCustomerId` semantics. - */ - platformCardId?: string; - - /** - * Reason associated with the current `state`. Populated when the card is `CLOSED` - * or when provisioning was rejected; otherwise null. - */ - stateReason?: 'ISSUER_REJECTED' | 'CLOSED_BY_PLATFORM' | 'CLOSED_BY_GRID' | null; - } -} - export type UnwrapWebhookEvent = | AgentActionWebhookEvent | IncomingPaymentWebhookEvent | OutgoingPaymentWebhookEvent - | TestWebhookWebhookEvent + | SandboxWebhooksAPI.TestWebhookRequest | BulkUploadWebhookEvent | InvitationClaimedWebhookEvent | CustomerUpdateWebhookEvent @@ -527,7 +282,6 @@ export declare namespace Webhooks { type AgentActionWebhookEvent as AgentActionWebhookEvent, type IncomingPaymentWebhookEvent as IncomingPaymentWebhookEvent, type OutgoingPaymentWebhookEvent as OutgoingPaymentWebhookEvent, - type TestWebhookWebhookEvent as TestWebhookWebhookEvent, type BulkUploadWebhookEvent as BulkUploadWebhookEvent, type InvitationClaimedWebhookEvent as InvitationClaimedWebhookEvent, type CustomerUpdateWebhookEvent as CustomerUpdateWebhookEvent, diff --git a/src/version.ts b/src/version.ts index 29d3ce71..d6d803fa 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.8.0'; // x-release-please-version +export const VERSION = '1.9.0'; // x-release-please-version diff --git a/tests/api-resources/agents/me/me.test.ts b/tests/api-resources/agents/me/me.test.ts index add3fcc7..ea8fb207 100644 --- a/tests/api-resources/agents/me/me.test.ts +++ b/tests/api-resources/agents/me/me.test.ts @@ -66,9 +66,10 @@ describe('resource me', () => { // Mock server tests are disabled test.skip('createTransferOut: required and optional params', async () => { const response = await client.agents.me.createTransferOut({ - destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' }, + destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965', paymentRail: 'ACH' }, source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' }, amount: 12550, + remittanceInformation: '12345', 'Idempotency-Key': '550e8400-e29b-41d4-a716-446655440000', }); }); diff --git a/tests/api-resources/agents/me/quotes.test.ts b/tests/api-resources/agents/me/quotes.test.ts index 78a2c58c..36949570 100644 --- a/tests/api-resources/agents/me/quotes.test.ts +++ b/tests/api-resources/agents/me/quotes.test.ts @@ -39,6 +39,7 @@ describe('resource quotes', () => { immediatelyExecute: false, lookupId: 'Lookup:019542f5-b3e7-1d02-0000-000000000009', purposeOfPayment: 'GIFT', + remittanceInformation: '12345', senderCustomerInfo: { FULL_NAME: 'bar', NATIONALITY: 'bar' }, 'Idempotency-Key': '', }); diff --git a/tests/api-resources/auth/credentials.test.ts b/tests/api-resources/auth/credentials.test.ts index 4755f4fc..25dd2650 100644 --- a/tests/api-resources/auth/credentials.test.ts +++ b/tests/api-resources/auth/credentials.test.ts @@ -36,7 +36,7 @@ describe('resource credentials', () => { type: 'EMAIL_OTP', }, 'Grid-Wallet-Signature': - 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ', + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', 'Request-Id': 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21', }); }); @@ -78,7 +78,7 @@ describe('resource credentials', () => { 'id', { 'Grid-Wallet-Signature': - 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ', + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', 'Request-Id': 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21', }, { path: '/_stainless_unknown_path' }, @@ -115,7 +115,13 @@ describe('resource credentials', () => { // Mock server tests are disabled test.skip('verify: only required params', async () => { - const responsePromise = client.auth.credentials.verify('id', { AuthCredentialVerifyRequest: {} }); + const responsePromise = client.auth.credentials.verify('id', { + AuthCredentialVerifyRequest: { + type: 'SMS_OTP', + encryptedOtpBundle: + '{"encappedPublic":"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838","ciphertext":"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc"}', + }, + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -128,7 +134,13 @@ describe('resource credentials', () => { // Mock server tests are disabled test.skip('verify: required and optional params', async () => { const response = await client.auth.credentials.verify('id', { - AuthCredentialVerifyRequest: {}, + AuthCredentialVerifyRequest: { + type: 'SMS_OTP', + encryptedOtpBundle: + '{"encappedPublic":"044f631a2d890bc6668d997ee184e190650d06adf970987568ec641214a00403b73effe1ef406c60a5cde8508a4484567ddb8056fbd493bee614cd727aef02a838","ciphertext":"1fa1023390a56539aa48cbb380aa28f544ed5cc04861566bb806e25ba026f14660eaf4140a05b388dd012eaa899759a6a92576cdca8c1b7d12e147bd96cc26ed9f74886794155d8ac5cf0fdc"}', + }, + 'Grid-Wallet-Signature': + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', 'Request-Id': 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21', }); }); diff --git a/tests/api-resources/auth/sessions.test.ts b/tests/api-resources/auth/sessions.test.ts index d25f0c0e..3dd25a74 100644 --- a/tests/api-resources/auth/sessions.test.ts +++ b/tests/api-resources/auth/sessions.test.ts @@ -48,7 +48,7 @@ describe('resource sessions', () => { 'id', { 'Grid-Wallet-Signature': - 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ', + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', 'Request-Id': 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21', }, { path: '/_stainless_unknown_path' }, @@ -59,8 +59,10 @@ describe('resource sessions', () => { // Mock server tests are disabled test.skip('refresh: only required params', async () => { const responsePromise = client.auth.sessions.refresh('Session:019542f5-b3e7-1d02-0000-000000000003', { - clientPublicKey: - '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + AuthSessionRefreshRequest: { + clientPublicKey: + '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -74,10 +76,12 @@ describe('resource sessions', () => { // Mock server tests are disabled test.skip('refresh: required and optional params', async () => { const response = await client.auth.sessions.refresh('Session:019542f5-b3e7-1d02-0000-000000000003', { - clientPublicKey: - '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + AuthSessionRefreshRequest: { + clientPublicKey: + '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + }, 'Grid-Wallet-Signature': - 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ', + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', 'Request-Id': 'Request:019542f5-b3e7-1d02-0000-000000000010', }); }); diff --git a/tests/api-resources/customers/customers.test.ts b/tests/api-resources/customers/customers.test.ts index ed913509..c9fc8dca 100644 --- a/tests/api-resources/customers/customers.test.ts +++ b/tests/api-resources/customers/customers.test.ts @@ -41,10 +41,13 @@ describe('resource customers', () => { birthDate: '1990-01-15', currencies: ['USD', 'USDC'], email: 'john.doe@example.com', - fullName: 'Jane Smith', + fullName: 'John Michael Doe', + identifier: '123-45-6789', + idType: 'SSN', kycStatus: 'APPROVED', nationality: 'US', - platformCustomerId: 'ind-9f84e0c2', + phoneNumber: '+14155551234', + platformCustomerId: '9f84e0c2a72c4fa', region: 'US', umaAddress: '$john.doe@uma.domain.com', }, @@ -84,22 +87,23 @@ describe('resource customers', () => { customerType: 'INDIVIDUAL', address: { country: 'US', - line1: '456 Market St', - postalCode: '94103', + line1: '123 Main Street', + postalCode: '94105', city: 'San Francisco', line2: 'Apt 4B', state: 'CA', }, - birthDate: '1985-06-15', + birthDate: '1990-01-15', currencies: ['USD', 'EUR', 'USDC'], email: 'john.doe@example.com', - fullName: 'John Smith', + fullName: 'John Michael Doe', kycStatus: 'APPROVED', nationality: 'US', + phoneNumber: '+14155551234', umaAddress: '$john.doe@uma.domain.com', }, 'Grid-Wallet-Signature': - 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ', + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', 'Request-Id': 'Request:019542f5-b3e7-1d02-0000-000000000010', }); }); @@ -153,11 +157,8 @@ describe('resource customers', () => { }); // Mock server tests are disabled - test.skip('export: only required params', async () => { - const responsePromise = client.customers.export('id', { - clientPublicKey: - '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', - }); + test.skip('createKYCLink', async () => { + const responsePromise = client.customers.createKYCLink('customerId'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -168,19 +169,26 @@ describe('resource customers', () => { }); // Mock server tests are disabled - test.skip('export: required and optional params', async () => { - const response = await client.customers.export('id', { - clientPublicKey: - '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', - 'Grid-Wallet-Signature': - 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzaWduYXR1cmUiOiIzMDQ1MDIyMTAwLi4uIiwic2NoZW1lIjoiUDI1Nl9FQ0RTQV9TSEEyNTYifQ', - 'Request-Id': 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21', - }); + test.skip('createKYCLink: 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.customers.createKYCLink( + 'customerId', + { + KycLinkCreateRequest: { redirectUri: 'https://app.example.com/onboarding/completed' }, + 'Idempotency-Key': '', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(LightsparkGrid.NotFoundError); }); // Mock server tests are disabled - test.skip('generateKYCLink', async () => { - const responsePromise = client.customers.generateKYCLink('customerId'); + test.skip('export: only required params', async () => { + const responsePromise = client.customers.export('id', { + clientPublicKey: + '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -191,15 +199,14 @@ describe('resource customers', () => { }); // Mock server tests are disabled - test.skip('generateKYCLink: 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.customers.generateKYCLink( - 'customerId', - { redirectUri: 'https://app.example.com/onboarding/completed', 'Idempotency-Key': '' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(LightsparkGrid.NotFoundError); + test.skip('export: required and optional params', async () => { + const response = await client.customers.export('id', { + clientPublicKey: + '04f45f2a22c908b9ce09a7150e514afd24627c401c38a4afc164e1ea783adaaa31d4245acfb88c2ebd42b47628d63ecabf345484f0a9f665b63c54c897d5578be2', + 'Grid-Wallet-Signature': + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', + 'Request-Id': 'Request:7c4a8d09-ca37-4e3e-9e0d-8c2b3e9a1f21', + }); }); // Mock server tests are disabled @@ -232,10 +239,10 @@ describe('resource customers', () => { }); // Mock server tests are disabled - test.skip('updateInternalAccount', async () => { + test.skip('updateInternalAccount: only required params', async () => { const responsePromise = client.customers.updateInternalAccount( 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002', - {}, + { InternalAccountUpdateRequest: {} }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -245,4 +252,17 @@ describe('resource customers', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // Mock server tests are disabled + test.skip('updateInternalAccount: required and optional params', async () => { + const response = await client.customers.updateInternalAccount( + 'InternalAccount:019542f5-b3e7-1d02-0000-000000000002', + { + InternalAccountUpdateRequest: { privateEnabled: true }, + 'Grid-Wallet-Signature': + 'eyJwdWJsaWNLZXkiOiIwMmExYjIuLi4iLCJzY2hlbWUiOiJTSUdOQVRVUkVfU0NIRU1FX1RLX0FQSV9QMjU2Iiwic2lnbmF0dXJlIjoiMzA0NTAyMjEwMC4uLiJ9', + 'Request-Id': 'Request:019542f5-b3e7-1d02-0000-000000000010', + }, + ); + }); }); diff --git a/tests/api-resources/documents.test.ts b/tests/api-resources/documents.test.ts index db3fcd0b..20862ae6 100644 --- a/tests/api-resources/documents.test.ts +++ b/tests/api-resources/documents.test.ts @@ -65,9 +65,11 @@ describe('resource documents', () => { // Mock server tests are disabled test.skip('replace: only required params', async () => { const responsePromise = client.documents.replace('documentId', { - country: 'US', - documentType: 'PASSPORT', - file: await toFile(Buffer.from('Example data'), 'README.md'), + DocumentReplaceRequest: { + country: 'US', + documentType: 'PASSPORT', + file: await toFile(Buffer.from('Example data'), 'README.md'), + }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -81,22 +83,26 @@ describe('resource documents', () => { // Mock server tests are disabled test.skip('replace: required and optional params', async () => { const response = await client.documents.replace('documentId', { - country: 'US', - documentType: 'PASSPORT', - file: await toFile(Buffer.from('Example data'), 'README.md'), - documentNumber: 'A12345678', - issuingAuthority: 'U.S. Department of State', - side: 'FRONT', + DocumentReplaceRequest: { + country: 'US', + documentType: 'PASSPORT', + file: await toFile(Buffer.from('Example data'), 'README.md'), + documentNumber: 'A12345678', + issuingAuthority: 'U.S. Department of State', + side: 'FRONT', + }, }); }); // Mock server tests are disabled test.skip('upload: only required params', async () => { const responsePromise = client.documents.upload({ - country: 'US', - documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001', - documentType: 'PASSPORT', - file: await toFile(Buffer.from('Example data'), 'README.md'), + DocumentUploadRequest: { + country: 'US', + documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001', + documentType: 'PASSPORT', + file: await toFile(Buffer.from('Example data'), 'README.md'), + }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -110,13 +116,15 @@ describe('resource documents', () => { // Mock server tests are disabled test.skip('upload: required and optional params', async () => { const response = await client.documents.upload({ - country: 'US', - documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001', - documentType: 'PASSPORT', - file: await toFile(Buffer.from('Example data'), 'README.md'), - documentNumber: 'A12345678', - issuingAuthority: 'U.S. Department of State', - side: 'FRONT', + DocumentUploadRequest: { + country: 'US', + documentHolder: 'BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001', + documentType: 'PASSPORT', + file: await toFile(Buffer.from('Example data'), 'README.md'), + documentNumber: 'A12345678', + issuingAuthority: 'U.S. Department of State', + side: 'FRONT', + }, }); }); }); diff --git a/tests/api-resources/platform/external-accounts.test.ts b/tests/api-resources/platform/external-accounts.test.ts index eeae555d..299c7a7a 100644 --- a/tests/api-resources/platform/external-accounts.test.ts +++ b/tests/api-resources/platform/external-accounts.test.ts @@ -15,10 +15,17 @@ describe('resource externalAccounts', () => { test.skip('create: only required params', async () => { const responsePromise = client.platform.externalAccounts.create({ accountInfo: { - accountNumber: '12345678901', - accountType: 'USD_ACCOUNT', - beneficiary: { beneficiaryType: 'INDIVIDUAL', fullName: 'John Doe' }, - routingNumber: '123456789', + accountType: 'AED_ACCOUNT', + beneficiary: { + address: { + country: 'US', + line1: '123 Main Street', + postalCode: '94105', + }, + beneficiaryType: 'INDIVIDUAL', + fullName: 'fullName', + }, + iban: 'AE070331234567890123456', }, currency: 'USD', }); @@ -35,11 +42,8 @@ describe('resource externalAccounts', () => { test.skip('create: required and optional params', async () => { const response = await client.platform.externalAccounts.create({ accountInfo: { - accountNumber: '12345678901', - accountType: 'USD_ACCOUNT', + accountType: 'AED_ACCOUNT', beneficiary: { - beneficiaryType: 'INDIVIDUAL', - fullName: 'John Doe', address: { country: 'US', line1: '123 Main Street', @@ -48,13 +52,16 @@ describe('resource externalAccounts', () => { line2: 'Apt 4B', state: 'CA', }, - birthDate: '1990-01-15', + beneficiaryType: 'INDIVIDUAL', + fullName: 'fullName', + birthDate: 'birthDate', countryOfResidence: 'countryOfResidence', email: 'email', - nationality: 'US', + nationality: 'nationality', phoneNumber: 'phoneNumber', }, - routingNumber: '123456789', + iban: 'AE070331234567890123456', + swiftCode: 'EBILAEAD', }, currency: 'USD', platformAccountId: 'ext_acc_123456', diff --git a/tests/api-resources/quotes.test.ts b/tests/api-resources/quotes.test.ts index 15066c6c..5c6ff759 100644 --- a/tests/api-resources/quotes.test.ts +++ b/tests/api-resources/quotes.test.ts @@ -14,13 +14,10 @@ describe('resource quotes', () => { // Mock server tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.quotes.create({ - destination: { - destinationType: 'ACCOUNT', - accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', - }, - lockedCurrencyAmount: 10000, + destination: {}, + lockedCurrencyAmount: 1000, lockedCurrencySide: 'SENDING', - source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' }, + source: {}, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -34,17 +31,15 @@ describe('resource quotes', () => { // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.quotes.create({ - destination: { - destinationType: 'ACCOUNT', - accountId: 'ExternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123', - }, - lockedCurrencyAmount: 10000, + destination: {}, + lockedCurrencyAmount: 1000, lockedCurrencySide: 'SENDING', - source: { sourceType: 'ACCOUNT', accountId: 'InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' }, - description: 'Transfer between accounts, either internal or external.', + source: {}, + description: 'Invoice #1234 payment', immediatelyExecute: false, lookupId: 'Lookup:019542f5-b3e7-1d02-0000-000000000009', purposeOfPayment: 'GIFT', + remittanceInformation: '12345', senderCustomerInfo: { FULL_NAME: 'bar', NATIONALITY: 'bar' }, 'Idempotency-Key': '', }); diff --git a/tests/api-resources/transfer-out.test.ts b/tests/api-resources/transfer-out.test.ts index 61b5f0ac..ba908962 100644 --- a/tests/api-resources/transfer-out.test.ts +++ b/tests/api-resources/transfer-out.test.ts @@ -29,9 +29,10 @@ describe('resource transferOut', () => { // Mock server tests are disabled test.skip('create: required and optional params', async () => { const response = await client.transferOut.create({ - destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965' }, + destination: { accountId: 'ExternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965', paymentRail: 'ACH' }, source: { accountId: 'InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123' }, amount: 12550, + remittanceInformation: '12345', 'Idempotency-Key': '550e8400-e29b-41d4-a716-446655440000', }); });