From 4a69ddee525b1dcde3b33248260abeb58038d858 Mon Sep 17 00:00:00 2001 From: Stuart Turner Date: Mon, 24 Jul 2023 18:56:58 -0500 Subject: [PATCH] Update to Plaid v1.394.0 --- plaid-openapi | 2 +- .../AssetReport/AssetReportGetRequest.cs | 8 +++- src/Plaid/AssetReport/PlaidClient.cs | 2 +- .../Converters/WebhookBaseConverter.Map.cs | 13 +++--- .../AccountAssetsVerificationStatusEnum.cs | 2 +- ...dentityMatchScoreVerificationStatusEnum.cs | 2 +- .../AccountIdentityVerificationStatusEnum.cs | 2 +- .../Entity/AccountVerificationStatusEnum.cs | 2 +- src/Plaid/Entity/AddressMatchScore.cs | 2 +- src/Plaid/Entity/AssetReportTransaction.cs | 2 +- src/Plaid/Entity/CreditDocumentMetadata.cs | 3 ++ src/Plaid/Entity/EmailAddressMatchScore.cs | 2 +- .../IdentityVerificationCreateRequestUser.cs | 2 +- ...tityVerificationDocumentAddressResponse.cs | 41 ++++++++++++++++++ .../Entity/IdentityVerificationRequestUser.cs | 2 +- .../IncomeVerificationCreateRequestOptions.cs | 2 +- src/Plaid/Entity/Institution.cs | 4 +- ...nvestmentsTransactionsGetRequestOptions.cs | 6 +++ src/Plaid/Entity/LinkDeliverySessionStatus.cs | 6 +++ .../Entity/LinkTokenCreateRequestUpdate.cs | 2 +- src/Plaid/Entity/NameMatchScore.cs | 2 +- src/Plaid/Entity/NumbersAch.cs | 2 +- .../Entity/PaymentInitiationPaymentStatus.cs | 12 +++--- src/Plaid/Entity/PaymentMeta.cs | 2 +- src/Plaid/Entity/PersonalFinanceCategory.cs | 11 +++++ src/Plaid/Entity/PhoneNumberMatchScore.cs | 2 +- .../Entity/PhysicalDocumentExtractedData.cs | 16 +++++++ ...rocessorTokenCreateRequestProcessorEnum.cs | 6 +++ src/Plaid/Entity/RecurringTransfer.cs | 2 +- src/Plaid/Entity/RiskCheckStolenIdentity.cs | 2 +- .../Entity/RiskCheckSyntheticIdentity.cs | 2 +- src/Plaid/Entity/SignalInsights.cs | 14 +----- src/Plaid/Entity/SimulatedTransferSweep.cs | 6 +++ src/Plaid/Entity/StatementsAccount.cs | 31 +++++++++++++ src/Plaid/Entity/StatementsStatement.cs | 25 +++++++++++ src/Plaid/Entity/SweepStatus.cs | 43 +++++++++++++++++++ src/Plaid/Entity/Transaction.cs | 6 +-- src/Plaid/Entity/TransferAuthorization.cs | 2 +- src/Plaid/Entity/TransferSweep.cs | 6 +++ src/Plaid/Entity/UserAddress.cs | 6 +-- .../InstitutionsGetByIdRequest.cs | 2 +- .../Institutions/InstitutionsGetRequest.cs | 2 +- .../Institutions/InstitutionsSearchRequest.cs | 2 +- src/Plaid/Investments/PlaidClient.cs | 3 +- src/Plaid/Processor/PlaidClient.cs | 8 ++++ .../ProcessorTokenWebhookUpdateRequest.cs | 19 ++++++++ .../ProcessorTokenWebhookUpdateResponse.cs | 8 ++++ src/Plaid/Statements/PlaidClient.cs | 20 +++++++++ .../Statements/StatementsDownloadRequest.cs | 13 ++++++ .../Statements/StatementsDownloadResponse.cs | 8 ++++ src/Plaid/Statements/StatementsListRequest.cs | 8 ++++ .../Statements/StatementsListResponse.cs | 31 +++++++++++++ .../TransferAuthorizationCreateRequest.cs | 2 +- .../TransferCapabilitiesGetRequest.cs | 2 +- src/Plaid/Transfer/TransferCreateRequest.cs | 2 +- .../TransferRecurringCreateRequest.cs | 2 +- .../Transfer/TransferSweepListRequest.cs | 12 ++++++ .../IncomeVerificationStatusWebhook.cs | 2 +- .../InvestmentsHistoricalUpdateWebhook.cs | 39 +++++++++++++++++ .../Webhook/ProcessorDefaultUpdateWebhook.cs | 35 +++++++++++++++ .../ProcessorHistoricalUpdateWebhook.cs | 35 +++++++++++++++ .../Webhook/ProcessorInitialUpdateWebhook.cs | 35 +++++++++++++++ ...essorRecurringTransactionsUpdateWebhook.cs | 23 ++++++++++ .../ProcessorSyncUpdatesAvailableWebhook.cs | 37 ++++++++++++++++ .../ProcessorTransactionsRemovedWebhook.cs | 35 +++++++++++++++ .../Webhook/SyncUpdatesAvailableWebhook.cs | 2 +- 66 files changed, 627 insertions(+), 65 deletions(-) create mode 100644 src/Plaid/Entity/IdentityVerificationDocumentAddressResponse.cs create mode 100644 src/Plaid/Entity/StatementsAccount.cs create mode 100644 src/Plaid/Entity/StatementsStatement.cs create mode 100644 src/Plaid/Entity/SweepStatus.cs create mode 100644 src/Plaid/Processor/ProcessorTokenWebhookUpdateRequest.cs create mode 100644 src/Plaid/Processor/ProcessorTokenWebhookUpdateResponse.cs create mode 100644 src/Plaid/Statements/PlaidClient.cs create mode 100644 src/Plaid/Statements/StatementsDownloadRequest.cs create mode 100644 src/Plaid/Statements/StatementsDownloadResponse.cs create mode 100644 src/Plaid/Statements/StatementsListRequest.cs create mode 100644 src/Plaid/Statements/StatementsListResponse.cs create mode 100644 src/Plaid/Webhook/InvestmentsHistoricalUpdateWebhook.cs create mode 100644 src/Plaid/Webhook/ProcessorDefaultUpdateWebhook.cs create mode 100644 src/Plaid/Webhook/ProcessorHistoricalUpdateWebhook.cs create mode 100644 src/Plaid/Webhook/ProcessorInitialUpdateWebhook.cs create mode 100644 src/Plaid/Webhook/ProcessorRecurringTransactionsUpdateWebhook.cs create mode 100644 src/Plaid/Webhook/ProcessorSyncUpdatesAvailableWebhook.cs create mode 100644 src/Plaid/Webhook/ProcessorTransactionsRemovedWebhook.cs diff --git a/plaid-openapi b/plaid-openapi index dfecaf62..206f2bab 160000 --- a/plaid-openapi +++ b/plaid-openapi @@ -1 +1 @@ -Subproject commit dfecaf628d527a32550105575366fc077b1f4b8f +Subproject commit 206f2babcf998ad1287af2c8d1371b5f1d4ce141 diff --git a/src/Plaid/AssetReport/AssetReportGetRequest.cs b/src/Plaid/AssetReport/AssetReportGetRequest.cs index 8cc4fac1..3c5c158b 100644 --- a/src/Plaid/AssetReport/AssetReportGetRequest.cs +++ b/src/Plaid/AssetReport/AssetReportGetRequest.cs @@ -9,7 +9,13 @@ public partial class AssetReportGetRequest : RequestBase /// A token that can be provided to endpoints such as /asset_report/get or /asset_report/pdf/get to fetch or update an Asset Report. /// [JsonPropertyName("asset_report_token")] - public string AssetReportToken { get; set; } = default!; + public string? AssetReportToken { get; set; } = default!; + + /// + /// The user token associated with the User for which to create an asset report for. The latest asset report associated with the User will be returned + /// + [JsonPropertyName("user_token")] + public string? UserToken { get; set; } = default!; /// /// true if you would like to retrieve the Asset Report with Insights, false otherwise. This field defaults to false if omitted. diff --git a/src/Plaid/AssetReport/PlaidClient.cs b/src/Plaid/AssetReport/PlaidClient.cs index d1cfe483..30f2ab58 100644 --- a/src/Plaid/AssetReport/PlaidClient.cs +++ b/src/Plaid/AssetReport/PlaidClient.cs @@ -4,7 +4,7 @@ public sealed partial class PlaidClient { /// /// The /asset_report/create endpoint initiates the process of creating an Asset Report, which can then be retrieved by passing the asset_report_token return value to the /asset_report/get or /asset_report/pdf/get endpoints. - /// The Asset Report takes some time to be created and is not available immediately after calling /asset_report/create. When the Asset Report is ready to be retrieved using /asset_report/get or /asset_report/pdf/get, Plaid will fire a PRODUCT_READY webhook. For full details of the webhook schema, see Asset Report webhooks. + /// The Asset Report takes some time to be created and is not available immediately after calling /asset_report/create. The exact amount of time to create the report will vary depending on how many days of history are requested and will typically range from a few seconds to about one minute. When the Asset Report is ready to be retrieved using /asset_report/get or /asset_report/pdf/get, Plaid will fire a PRODUCT_READY webhook. For full details of the webhook schema, see Asset Report webhooks. /// The /asset_report/create endpoint creates an Asset Report at a moment in time. Asset Reports are immutable. To get an updated Asset Report, use the /asset_report/refresh endpoint. /// /// diff --git a/src/Plaid/Converters/WebhookBaseConverter.Map.cs b/src/Plaid/Converters/WebhookBaseConverter.Map.cs index 51839703..99156760 100644 --- a/src/Plaid/Converters/WebhookBaseConverter.Map.cs +++ b/src/Plaid/Converters/WebhookBaseConverter.Map.cs @@ -13,13 +13,13 @@ public partial class WebhookBaseConverter : JsonConverter [(WebhookType.IdentityVerification, WebhookCode.StepUpdated)] = typeof(IdentityVerificationStepUpdatedWebhook), [(WebhookType.IdentityVerification, WebhookCode.Retried)] = typeof(IdentityVerificationRetriedWebhook), [(WebhookType.IdentityVerification, WebhookCode.StatusUpdated)] = typeof(IdentityVerificationStatusUpdatedWebhook), - [(WebhookType.Transactions, WebhookCode.TransactionsRemoved)] = typeof(TransactionsRemovedWebhook), - [(WebhookType.Transactions, WebhookCode.DefaultUpdate)] = typeof(DefaultUpdateWebhook), - [(WebhookType.Transactions, WebhookCode.SyncUpdatesAvailable)] = typeof(SyncUpdatesAvailableWebhook), - [(WebhookType.Transactions, WebhookCode.RecurringTransactionsUpdate)] = typeof(RecurringTransactionsUpdateWebhook), + [(WebhookType.Transactions, WebhookCode.TransactionsRemoved)] = typeof(ProcessorTransactionsRemovedWebhook), + [(WebhookType.Transactions, WebhookCode.DefaultUpdate)] = typeof(ProcessorDefaultUpdateWebhook), + [(WebhookType.Transactions, WebhookCode.SyncUpdatesAvailable)] = typeof(ProcessorSyncUpdatesAvailableWebhook), + [(WebhookType.Transactions, WebhookCode.RecurringTransactionsUpdate)] = typeof(ProcessorRecurringTransactionsUpdateWebhook), [(WebhookType.Identity, WebhookCode.DefaultUpdate)] = typeof(IdentityDefaultUpdateWebhook), - [(WebhookType.Transactions, WebhookCode.HistoricalUpdate)] = typeof(HistoricalUpdateWebhook), - [(WebhookType.Transactions, WebhookCode.InitialUpdate)] = typeof(InitialUpdateWebhook), + [(WebhookType.Transactions, WebhookCode.HistoricalUpdate)] = typeof(ProcessorHistoricalUpdateWebhook), + [(WebhookType.Transactions, WebhookCode.InitialUpdate)] = typeof(ProcessorInitialUpdateWebhook), [(WebhookType.Auth, WebhookCode.AutomaticallyVerified)] = typeof(FallbackAuthMicrodepositAutoVerifiedWebhook), [(WebhookType.Auth, WebhookCode.VerificationExpired)] = typeof(FallbackAuthMicrodepositVerificationExpiredWebhook), [(WebhookType.Item, WebhookCode.WebhookUpdateAcknowledged)] = typeof(WebhookUpdateAcknowledgedWebhook), @@ -35,6 +35,7 @@ public partial class WebhookBaseConverter : JsonConverter [(WebhookType.Transfer, WebhookCode.RecurringTransferSkipped)] = typeof(RecurringTransferSkippedWebhook), [(WebhookType.Transfer, WebhookCode.RecurringCancelled)] = typeof(RecurringCancelledWebhook), [(WebhookType.InvestmentsTransactions, WebhookCode.DefaultUpdate)] = typeof(InvestmentsDefaultUpdateWebhook), + [(WebhookType.InvestmentsTransactions, WebhookCode.HistoricalUpdate)] = typeof(InvestmentsHistoricalUpdateWebhook), [(WebhookType.Holdings, WebhookCode.DefaultUpdate)] = typeof(HoldingsDefaultUpdateWebhook), [(WebhookType.Partner, WebhookCode.EndCustomerOauthStatusUpdated)] = typeof(PartnerEndCustomerOAuthStatusUpdatedWebhook), [(WebhookType.Liabilities, WebhookCode.DefaultUpdate)] = typeof(LiabilitiesDefaultUpdateWebhook), diff --git a/src/Plaid/Entity/AccountAssetsVerificationStatusEnum.cs b/src/Plaid/Entity/AccountAssetsVerificationStatusEnum.cs index a081bd8d..d867f628 100644 --- a/src/Plaid/Entity/AccountAssetsVerificationStatusEnum.cs +++ b/src/Plaid/Entity/AccountAssetsVerificationStatusEnum.cs @@ -18,7 +18,7 @@ public enum AccountAssetsVerificationStatusEnum PendingAutomaticVerification, /// - /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the two amounts. + /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the micro-deposit. /// [EnumMember(Value = "pending_manual_verification")] PendingManualVerification, diff --git a/src/Plaid/Entity/AccountIdentityMatchScoreVerificationStatusEnum.cs b/src/Plaid/Entity/AccountIdentityMatchScoreVerificationStatusEnum.cs index 1b99e9e2..ddf5e0bb 100644 --- a/src/Plaid/Entity/AccountIdentityMatchScoreVerificationStatusEnum.cs +++ b/src/Plaid/Entity/AccountIdentityMatchScoreVerificationStatusEnum.cs @@ -18,7 +18,7 @@ public enum AccountIdentityMatchScoreVerificationStatusEnum PendingAutomaticVerification, /// - /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the two amounts. + /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the micro-deposit. /// [EnumMember(Value = "pending_manual_verification")] PendingManualVerification, diff --git a/src/Plaid/Entity/AccountIdentityVerificationStatusEnum.cs b/src/Plaid/Entity/AccountIdentityVerificationStatusEnum.cs index 00b63de4..cfa7ed30 100644 --- a/src/Plaid/Entity/AccountIdentityVerificationStatusEnum.cs +++ b/src/Plaid/Entity/AccountIdentityVerificationStatusEnum.cs @@ -18,7 +18,7 @@ public enum AccountIdentityVerificationStatusEnum PendingAutomaticVerification, /// - /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the two amounts. + /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the micro-deposit. /// [EnumMember(Value = "pending_manual_verification")] PendingManualVerification, diff --git a/src/Plaid/Entity/AccountVerificationStatusEnum.cs b/src/Plaid/Entity/AccountVerificationStatusEnum.cs index 748c80d5..9ad4c28a 100644 --- a/src/Plaid/Entity/AccountVerificationStatusEnum.cs +++ b/src/Plaid/Entity/AccountVerificationStatusEnum.cs @@ -18,7 +18,7 @@ public enum AccountVerificationStatusEnum PendingAutomaticVerification, /// - /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the two amounts. + /// The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the micro-deposit. /// [EnumMember(Value = "pending_manual_verification")] PendingManualVerification, diff --git a/src/Plaid/Entity/AddressMatchScore.cs b/src/Plaid/Entity/AddressMatchScore.cs index 7f7c1623..12242522 100644 --- a/src/Plaid/Entity/AddressMatchScore.cs +++ b/src/Plaid/Entity/AddressMatchScore.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public record AddressMatchScore { /// - /// Match score for address. The score can range from 0 to 100 where 100 is a perfect match and 0 is a no match. If the address is missing from either the API or financial institution, this is null. + /// Match score for address. 100 is a perfect match, 99-90 is a strong match, 89-80 is a partial match, anything below 80 is considered a weak match. Typically, the match threshold should be set to a score of 80 or higher. If the address is missing from either the API or financial institution, this is null. /// [JsonPropertyName("score")] public int? Score { get; init; } = default!; diff --git a/src/Plaid/Entity/AssetReportTransaction.cs b/src/Plaid/Entity/AssetReportTransaction.cs index b2af7d97..494c186e 100644 --- a/src/Plaid/Entity/AssetReportTransaction.cs +++ b/src/Plaid/Entity/AssetReportTransaction.cs @@ -98,7 +98,7 @@ public record AssetReportTransaction /// /// Transaction information specific to inter-bank transfers. If the transaction was not an inter-bank transfer, all fields will be null. - /// If the transactions object was returned by a Transactions endpoint such as /transactions/get, the payment_meta key will always appear, but no data elements are guaranteed. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get, this field will only appear in an Asset Report with Insights. + /// If the transactions object was returned by a Transactions endpoint such as /transactions/sync or /transactions/get, the payment_meta key will always appear, but no data elements are guaranteed. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get`, this field will only appear in an Asset Report with Insights. /// [JsonPropertyName("payment_meta")] public Entity.PaymentMeta? PaymentMeta { get; init; } = default!; diff --git a/src/Plaid/Entity/CreditDocumentMetadata.cs b/src/Plaid/Entity/CreditDocumentMetadata.cs index d4703cb3..73f1a6c6 100644 --- a/src/Plaid/Entity/CreditDocumentMetadata.cs +++ b/src/Plaid/Entity/CreditDocumentMetadata.cs @@ -35,6 +35,9 @@ public record CreditDocumentMetadata /// /// The processing status of the document. + /// PROCESSING_COMPLETE: The document was successfully processed. + /// DOCUMENT_ERROR: The document could not be processed. Possible causes include: The document was an unacceptable document type such as an offer letter or bank statement, the document image was cropped or blurry, or the document was corrupted. + /// UNKNOWN or null: An internal error occurred. If this happens repeatedly, contact support or your Plaid account manager. /// [JsonPropertyName("status")] public string? Status { get; init; } = default!; diff --git a/src/Plaid/Entity/EmailAddressMatchScore.cs b/src/Plaid/Entity/EmailAddressMatchScore.cs index 159d1d04..b43068bb 100644 --- a/src/Plaid/Entity/EmailAddressMatchScore.cs +++ b/src/Plaid/Entity/EmailAddressMatchScore.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public record EmailAddressMatchScore { /// - /// Match score for normalized email. 100 is a perfect match and 0 is a no match. If the email is missing from either the API or financial institution, this is null. + /// Match score for normalized email. 100 is a perfect match, 99-70 is a partial match (matching the same email with different '+' extensions), anything below 70 is considered a mismatch. Typically, the match threshold should be set to a score of 70 or higher. If the email is missing from either the API or financial institution, this is null. /// [JsonPropertyName("score")] public int? Score { get; init; } = default!; diff --git a/src/Plaid/Entity/IdentityVerificationCreateRequestUser.cs b/src/Plaid/Entity/IdentityVerificationCreateRequestUser.cs index bba483d0..fd067458 100644 --- a/src/Plaid/Entity/IdentityVerificationCreateRequestUser.cs +++ b/src/Plaid/Entity/IdentityVerificationCreateRequestUser.cs @@ -40,7 +40,7 @@ public class IdentityVerificationCreateRequestUser public Entity.IdentityVerificationRequestUserName? Name { get; set; } = default!; /// - /// Home address for the user. + /// Home address for the user. For more context on this field, see Input Validation by Country. /// [JsonPropertyName("address")] public Entity.UserAddress? Address { get; set; } = default!; diff --git a/src/Plaid/Entity/IdentityVerificationDocumentAddressResponse.cs b/src/Plaid/Entity/IdentityVerificationDocumentAddressResponse.cs new file mode 100644 index 00000000..b46d02c4 --- /dev/null +++ b/src/Plaid/Entity/IdentityVerificationDocumentAddressResponse.cs @@ -0,0 +1,41 @@ +namespace Going.Plaid.Entity; + +/// +/// The address extracted from the document. The address must at least contain the following fields to be a valid address: street, city, country. If any are missing or unable to be extracted, the address will be null. +/// region, and postal_code may be null based on the addressing system. For example: +/// Addresses from the United Kingdom will not include a region +/// Addresses from Hong Kong will not include postal code +/// Note: Optical Character Recognition (OCR) technology may sometimes extract incorrect data from a document. +/// +public record IdentityVerificationDocumentAddressResponse +{ + /// + /// The full street address extracted from the document. + /// + [JsonPropertyName("street")] + public string Street { get; init; } = default!; + + /// + /// City extracted from the document. + /// + [JsonPropertyName("city")] + public string City { get; init; } = default!; + + /// + /// An ISO 3166-2 subdivision code extracted from the document. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. + /// + [JsonPropertyName("region")] + public string? Region { get; init; } = default!; + + /// + /// The postal code extracted from the document. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. + /// + [JsonPropertyName("postal_code")] + public string? PostalCode { get; init; } = default!; + + /// + /// Valid, capitalized, two-letter ISO code representing the country extracted from the document. Must be in ISO 3166-1 alpha-2 form. + /// + [JsonPropertyName("country")] + public string Country { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Entity/IdentityVerificationRequestUser.cs b/src/Plaid/Entity/IdentityVerificationRequestUser.cs index 4ee681b2..66a5a084 100644 --- a/src/Plaid/Entity/IdentityVerificationRequestUser.cs +++ b/src/Plaid/Entity/IdentityVerificationRequestUser.cs @@ -39,7 +39,7 @@ public class IdentityVerificationRequestUser public Entity.IdentityVerificationRequestUserName? Name { get; set; } = default!; /// - /// Home address for the user. + /// Home address for the user. For more context on this field, see Input Validation by Country. /// [JsonPropertyName("address")] public Entity.UserAddress? Address { get; set; } = default!; diff --git a/src/Plaid/Entity/IncomeVerificationCreateRequestOptions.cs b/src/Plaid/Entity/IncomeVerificationCreateRequestOptions.cs index 21008e07..232e8c6b 100644 --- a/src/Plaid/Entity/IncomeVerificationCreateRequestOptions.cs +++ b/src/Plaid/Entity/IncomeVerificationCreateRequestOptions.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public class IncomeVerificationCreateRequestOptions { /// - /// An array of access tokens corresponding to the Items that will be cross-referenced with the product data. Plaid will attempt to correlate transaction history from these Items with data from the user's paystub, such as date and amount. The verification status of the paystub as returned by /income/verification/paystubs/get will indicate if the verification status was successful, or, if not, why it failed. If the transactions product was not initialized for the Items during Link, it will be initialized after this Link session. + /// An array of access tokens corresponding to the Items that will be cross-referenced with the product data. Plaid will attempt to correlate transaction history from these Items with data from the user's paystub, such as date and amount. If the transactions product was not initialized for the Items during Link, it will be initialized after this Link session. /// [JsonPropertyName("access_tokens")] public IReadOnlyList? AccessTokens { get; set; } = default!; diff --git a/src/Plaid/Entity/Institution.cs b/src/Plaid/Entity/Institution.cs index 9d9be51e..b88e00bc 100644 --- a/src/Plaid/Entity/Institution.cs +++ b/src/Plaid/Entity/Institution.cs @@ -6,13 +6,13 @@ namespace Going.Plaid.Entity; public record Institution { /// - /// Unique identifier for the institution + /// Unique identifier for the institution. Note that the same institution may have multiple records, each with different institution IDs; for example, if the institution has migrated to OAuth, there may be separate institution_ids for the OAuth and non-OAuth versions of the institution. Institutions that operate in different countries or with multiple login portals may also have separate institution_ids for each country or portal. /// [JsonPropertyName("institution_id")] public string InstitutionId { get; init; } = default!; /// - /// The official name of the institution + /// The official name of the institution. /// [JsonPropertyName("name")] public string Name { get; init; } = default!; diff --git a/src/Plaid/Entity/InvestmentsTransactionsGetRequestOptions.cs b/src/Plaid/Entity/InvestmentsTransactionsGetRequestOptions.cs index b7daae1b..dff81bba 100644 --- a/src/Plaid/Entity/InvestmentsTransactionsGetRequestOptions.cs +++ b/src/Plaid/Entity/InvestmentsTransactionsGetRequestOptions.cs @@ -22,4 +22,10 @@ public class InvestmentsTransactionsGetRequestOptions /// [JsonPropertyName("offset")] public int? Offset { get; set; } = default!; + + /// + /// If the Item was not initialized with the investments product via the products array when calling /link/token/create, and async_update is set to true, the initial Investments extraction will happen asynchronously. Plaid will subsequently fire a HISTORICAL_UPDATE webhook when the extraction completes. When false, Plaid will wait to return a response until extraction completion and no HISTORICAL_UPDATE webhook will fire. Note that while the extraction is happening asynchronously, calls to /investments/transactions/get and /investments/refresh will return PRODUCT_NOT_READY errors until the extraction completes. + /// + [JsonPropertyName("async_update")] + public bool? AsyncUpdate { get; set; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/LinkDeliverySessionStatus.cs b/src/Plaid/Entity/LinkDeliverySessionStatus.cs index 39df8616..b68be9bb 100644 --- a/src/Plaid/Entity/LinkDeliverySessionStatus.cs +++ b/src/Plaid/Entity/LinkDeliverySessionStatus.cs @@ -17,6 +17,12 @@ public enum LinkDeliverySessionStatus [EnumMember(Value = "OPENED")] Opened, + /// + /// The session has been exited by the user + /// + [EnumMember(Value = "EXITED")] + Exited, + /// /// The session has been completed by the user /// diff --git a/src/Plaid/Entity/LinkTokenCreateRequestUpdate.cs b/src/Plaid/Entity/LinkTokenCreateRequestUpdate.cs index a9cedef4..13e9472c 100644 --- a/src/Plaid/Entity/LinkTokenCreateRequestUpdate.cs +++ b/src/Plaid/Entity/LinkTokenCreateRequestUpdate.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public class LinkTokenCreateRequestUpdate { /// - /// If true, enables update mode with Account Select. + /// If true, enables update mode with Account Select for institutions that do not use OAuth, or that use OAuth but do not have their own account selection flow. For institutions that have an OAuth account selection flow (i.e. most OAuth-enabled institutions), update mode with Account Select will always be enabled, regardless of the value of this field. /// [JsonPropertyName("account_selection_enabled")] public bool? AccountSelectionEnabled { get; set; } = default!; diff --git a/src/Plaid/Entity/NameMatchScore.cs b/src/Plaid/Entity/NameMatchScore.cs index d8cd2a34..54b97570 100644 --- a/src/Plaid/Entity/NameMatchScore.cs +++ b/src/Plaid/Entity/NameMatchScore.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public record NameMatchScore { /// - /// Represents the match score for name. 100 is a perfect score, 85-99 means a strong match, 50-84 is a partial match, less than 50 is a weak match and 0 is a complete mismatch. If the name is missing from either the API or financial institution, this is null. + /// Match score for name. 100 is a perfect score, 85-99 means a strong match, 84-70 is a partial match, any score less than 70 is a mismatch. Typically, the match threshold should be set to a score of 70 or higher. If the name is missing from either the API or financial institution, this is null. /// [JsonPropertyName("score")] public int? Score { get; init; } = default!; diff --git a/src/Plaid/Entity/NumbersAch.cs b/src/Plaid/Entity/NumbersAch.cs index da16ae7b..3ff15913 100644 --- a/src/Plaid/Entity/NumbersAch.cs +++ b/src/Plaid/Entity/NumbersAch.cs @@ -13,7 +13,7 @@ public record NumbersAch /// /// The ACH account number for the account. - /// Note that when using OAuth with Chase Bank (ins_56), Chase will issue "tokenized" routing and account numbers, which are not the user's actual account and routing numbers. These tokenized numbers should work identically to normal account and routing numbers. The digits returned in the mask field will continue to reflect the actual account number, rather than the tokenized account number; for this reason, when displaying account numbers to the user to help them identify their account in your UI, always use the mask rather than truncating the account number. If a user revokes their permissions to your app, the tokenized numbers will continue to work for ACH deposits, but not withdrawals. + /// Note that when using OAuth with Chase Bank (ins_56), Chase will issue "tokenized" routing and account numbers, which are not the user's actual account and routing numbers. These tokenized account numbers (also known as TANs) should work identically to normal account and routing numbers. The digits returned in the mask field will continue to reflect the actual account number, rather than the tokenized account number; for this reason, when displaying account numbers to the user to help them identify their account in your UI, always use the mask rather than truncating the account number. If a user revokes their permissions to your app, the tokenized numbers will continue to work for ACH deposits, but not withdrawals. /// [JsonPropertyName("account")] public string Account { get; init; } = default!; diff --git a/src/Plaid/Entity/PaymentInitiationPaymentStatus.cs b/src/Plaid/Entity/PaymentInitiationPaymentStatus.cs index 86c0876d..42f1c798 100644 --- a/src/Plaid/Entity/PaymentInitiationPaymentStatus.cs +++ b/src/Plaid/Entity/PaymentInitiationPaymentStatus.cs @@ -18,7 +18,7 @@ public enum PaymentInitiationPaymentStatus PaymentStatusProcessing, /// - /// The payment has been successfully authorised and accepted by the financial institution. Further status transitions can be to REJECTED and, when supported by the institution, to EXECUTED. + /// The payment has been successfully authorised and accepted by the financial institution. For successful payments, this is a potential terminal status. Further status transitions can be to REJECTED and, when supported by the institution, to EXECUTED. /// [EnumMember(Value = "PAYMENT_STATUS_INITIATED")] PaymentStatusInitiated, @@ -36,13 +36,13 @@ public enum PaymentInitiationPaymentStatus PaymentStatusInsufficientFunds, /// - /// The payment has failed to be initiated. This error is retryable once the root cause is resolved. + /// The payment has failed to be initiated. This error may be caused by transient system outages and is retryable once the root cause is resolved. /// [EnumMember(Value = "PAYMENT_STATUS_FAILED")] PaymentStatusFailed, /// - /// The payment has been blocked. This is a retryable error. + /// The payment has been blocked by Plaid. This can occur, for example, due to Plaid flagging the payment as potentially risky. This is a retryable error. /// [EnumMember(Value = "PAYMENT_STATUS_BLOCKED")] PaymentStatusBlocked, @@ -54,13 +54,13 @@ public enum PaymentInitiationPaymentStatus PaymentStatusUnknown, /// - /// The funds have successfully left the payer account and payment is considered complete. This status isn’t supported by some institutions. + /// The funds have successfully left the payer account and payment is considered complete. Not all institutions support this status: support is more common in the UK, and less common in the EU. For institutions where this status is not supported, the terminal status for a successful payment will be PAYMENT_STATUS_INITIATED. /// [EnumMember(Value = "PAYMENT_STATUS_EXECUTED")] PaymentStatusExecuted, /// - /// The payment has settled and funds are available for use. Payment settlement can only be guaranteed by using Plaid virtual accounts. A payment will typically settle within seconds to several days, depending on which payment rail is used. + /// The payment has settled and funds are available for use. A payment will typically settle within seconds to several days, depending on which payment rail is used. This status is only available to customers using Plaid Virtual Accounts. /// [EnumMember(Value = "PAYMENT_STATUS_SETTLED")] PaymentStatusSettled, @@ -72,7 +72,7 @@ public enum PaymentInitiationPaymentStatus PaymentStatusAuthorising, /// - /// The payment was cancelled during authorisation. + /// The payment was cancelled (typically by the end user) during authorisation. /// [EnumMember(Value = "PAYMENT_STATUS_CANCELLED")] PaymentStatusCancelled, diff --git a/src/Plaid/Entity/PaymentMeta.cs b/src/Plaid/Entity/PaymentMeta.cs index 824d2522..468e7802 100644 --- a/src/Plaid/Entity/PaymentMeta.cs +++ b/src/Plaid/Entity/PaymentMeta.cs @@ -2,7 +2,7 @@ namespace Going.Plaid.Entity; /// /// Transaction information specific to inter-bank transfers. If the transaction was not an inter-bank transfer, all fields will be null. -/// If the transactions object was returned by a Transactions endpoint such as /transactions/get, the payment_meta key will always appear, but no data elements are guaranteed. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get, this field will only appear in an Asset Report with Insights. +/// If the transactions object was returned by a Transactions endpoint such as /transactions/sync or /transactions/get, the payment_meta key will always appear, but no data elements are guaranteed. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get`, this field will only appear in an Asset Report with Insights. /// public record PaymentMeta { diff --git a/src/Plaid/Entity/PersonalFinanceCategory.cs b/src/Plaid/Entity/PersonalFinanceCategory.cs index c97b833f..f49a2672 100644 --- a/src/Plaid/Entity/PersonalFinanceCategory.cs +++ b/src/Plaid/Entity/PersonalFinanceCategory.cs @@ -17,4 +17,15 @@ public record PersonalFinanceCategory /// [JsonPropertyName("detailed")] public string Detailed { get; init; } = default!; + + /// + /// A description of how confident we are that the provided categories accurately describe the transaction intent. + /// very_high: We are more than 98% confident that this category reflects the intent of the transaction. + /// high: We are more than 90% confident that this category reflects the intent of the transaction. + /// medium: We are moderately confident that this category reflects the intent of the transaction. + /// low: This category may reflect the intent, but there may be other categories that are more accurate. + /// unknown: Error + /// + [JsonPropertyName("confidence_level")] + public string? ConfidenceLevel { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/PhoneNumberMatchScore.cs b/src/Plaid/Entity/PhoneNumberMatchScore.cs index ca706493..4a406cb6 100644 --- a/src/Plaid/Entity/PhoneNumberMatchScore.cs +++ b/src/Plaid/Entity/PhoneNumberMatchScore.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public record PhoneNumberMatchScore { /// - /// Match score for normalized phone number. 100 is a perfect match and 0 is a no match. If the phone number is missing from either the API or financial institution, this is null. + /// Match score for normalized phone number. 100 is a perfect match, 99-70 is a partial match (matching the same phone number with extension against one without extension etc.), anything below 70 is considered a mismatch. Typically, the match threshold should be set to a score of 70 or higher. If the phone number is missing from either the API or financial institution, this is null. /// [JsonPropertyName("score")] public int? Score { get; init; } = default!; diff --git a/src/Plaid/Entity/PhysicalDocumentExtractedData.cs b/src/Plaid/Entity/PhysicalDocumentExtractedData.cs index d0b3eba2..a10a2650 100644 --- a/src/Plaid/Entity/PhysicalDocumentExtractedData.cs +++ b/src/Plaid/Entity/PhysicalDocumentExtractedData.cs @@ -34,4 +34,20 @@ public record PhysicalDocumentExtractedData /// [JsonPropertyName("issuing_region")] public string? IssuingRegion { get; init; } = default!; + + /// + /// A date extracted from the document in the format YYYY-MM-DD (RFC 3339 Section 5.6). + /// + [JsonPropertyName("date_of_birth")] + public DateOnly? DateOfBirth { get; init; } = default!; + + /// + /// The address extracted from the document. The address must at least contain the following fields to be a valid address: street, city, country. If any are missing or unable to be extracted, the address will be null. + /// region, and postal_code may be null based on the addressing system. For example: + /// Addresses from the United Kingdom will not include a region + /// Addresses from Hong Kong will not include postal code + /// Note: Optical Character Recognition (OCR) technology may sometimes extract incorrect data from a document. + /// + [JsonPropertyName("address")] + public Entity.IdentityVerificationDocumentAddressResponse? Address { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs b/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs index c14c7e55..b4b27835 100644 --- a/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs +++ b/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs @@ -227,6 +227,12 @@ public enum ProcessorTokenCreateRequestProcessorEnum [EnumMember(Value = "fortress_trust")] FortressTrust, + /// + /// + /// + [EnumMember(Value = "bond")] + Bond, + /// /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. /// diff --git a/src/Plaid/Entity/RecurringTransfer.cs b/src/Plaid/Entity/RecurringTransfer.cs index 93a9fe9d..a29e0cdd 100644 --- a/src/Plaid/Entity/RecurringTransfer.cs +++ b/src/Plaid/Entity/RecurringTransfer.cs @@ -22,7 +22,7 @@ public record RecurringTransfer /// The next transfer origination date after bank holiday adjustment. /// [JsonPropertyName("next_origination_date")] - public DateOnly NextOriginationDate { get; init; } = default!; + public DateOnly? NextOriginationDate { get; init; } = default!; /// /// Plaid’s unique identifier for a test clock. diff --git a/src/Plaid/Entity/RiskCheckStolenIdentity.cs b/src/Plaid/Entity/RiskCheckStolenIdentity.cs index 4c8cd08f..86f8d7da 100644 --- a/src/Plaid/Entity/RiskCheckStolenIdentity.cs +++ b/src/Plaid/Entity/RiskCheckStolenIdentity.cs @@ -11,5 +11,5 @@ public record RiskCheckStolenIdentity /// A score from 0 to 100 indicating the likelihood that the user is a stolen identity. /// [JsonPropertyName("score")] - public int? Score { get; init; } = default!; + public int Score { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/RiskCheckSyntheticIdentity.cs b/src/Plaid/Entity/RiskCheckSyntheticIdentity.cs index bd67156d..6c661791 100644 --- a/src/Plaid/Entity/RiskCheckSyntheticIdentity.cs +++ b/src/Plaid/Entity/RiskCheckSyntheticIdentity.cs @@ -11,5 +11,5 @@ public record RiskCheckSyntheticIdentity /// A score from 0 to 100 indicating the likelihood that the user is a synthetic identity. /// [JsonPropertyName("score")] - public int? Score { get; init; } = default!; + public int Score { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/SignalInsights.cs b/src/Plaid/Entity/SignalInsights.cs index 2e6de78d..cd36518f 100644 --- a/src/Plaid/Entity/SignalInsights.cs +++ b/src/Plaid/Entity/SignalInsights.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Entity; /// -/// Signal insights including scores and attributes. +/// Signal insights including scores and attributes. This response is offered as an add-on to /transfer/authorization/create. To request access to these fields please contact your Plaid account manager. /// public record SignalInsights { @@ -11,18 +11,6 @@ public record SignalInsights [JsonPropertyName("scores")] public Entity.SignalEvaluateScores? Scores { get; init; } = default!; - /// - /// The core attributes object contains additional data that can be used to assess the ACH return risk. Examples of data include: - /// days_since_first_plaid_connection: The number of days since the first time the Item was connected to an application via Plaid - /// plaid_connections_count_7d: The number of times the Item has been connected to applications via Plaid over the past 7 days - /// plaid_connections_count_30d: The number of times the Item has been connected to applications via Plaid over the past 30 days - /// total_plaid_connections_count: The number of times the Item has been connected to applications via Plaid - /// is_savings_or_money_market_account: Indicates whether the ACH transaction funding account is a savings/money market account - /// For the full list and detailed documentation of core attributes available, or to request that core attributes not be returned, contact Sales or your Plaid account manager - /// - [JsonPropertyName("core_attributes")] - public Entity.SignalEvaluateCoreAttributes? CoreAttributes { get; init; } = default!; - /// /// If bank information was not available to be used in the Signal model, this array contains warnings describing why bank data is missing. If you want to receive an API error instead of Signal scores in the case of missing bank data, file a support ticket or contact your Plaid account manager. /// diff --git a/src/Plaid/Entity/SimulatedTransferSweep.cs b/src/Plaid/Entity/SimulatedTransferSweep.cs index 073ba40d..ca473ec9 100644 --- a/src/Plaid/Entity/SimulatedTransferSweep.cs +++ b/src/Plaid/Entity/SimulatedTransferSweep.cs @@ -42,4 +42,10 @@ public record SimulatedTransferSweep /// [JsonPropertyName("settled")] public DateOnly? Settled { get; init; } = default!; + + /// + /// The status of a sweep transfer + /// + [JsonPropertyName("status")] + public Entity.SweepStatus? Status { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/StatementsAccount.cs b/src/Plaid/Entity/StatementsAccount.cs new file mode 100644 index 00000000..01c2a6d6 --- /dev/null +++ b/src/Plaid/Entity/StatementsAccount.cs @@ -0,0 +1,31 @@ +namespace Going.Plaid.Entity; + +/// +/// Account associated with the item. +/// +public record StatementsAccount +{ + /// + /// Plaid's unique identifier for the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; + + /// + /// The name of the account, either assigned by the user or by the financial institution itself. + /// + [JsonPropertyName("account_name")] + public string AccountName { get; init; } = default!; + + /// + /// The type of account. Possible values are investment, credit, depository, loan, brokerage, other. + /// + [JsonPropertyName("account_type")] + public string AccountType { get; init; } = default!; + + /// + /// The list of statements' metadata associated with this account. + /// + [JsonPropertyName("statements")] + public IReadOnlyList Statements { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Entity/StatementsStatement.cs b/src/Plaid/Entity/StatementsStatement.cs new file mode 100644 index 00000000..46dc8a7c --- /dev/null +++ b/src/Plaid/Entity/StatementsStatement.cs @@ -0,0 +1,25 @@ +namespace Going.Plaid.Entity; + +/// +/// A statement's metadata associated with an account +/// +public record StatementsStatement +{ + /// + /// Plaid's unique identifier for the statement. + /// + [JsonPropertyName("statement_id")] + public string StatementId { get; init; } = default!; + + /// + /// Month of the year. Possible values: 1 through 12 (January through December). + /// + [JsonPropertyName("month")] + public int Month { get; init; } = default!; + + /// + /// Year. Possible values: 2010-{current_year}. + /// + [JsonPropertyName("year")] + public int Year { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Entity/SweepStatus.cs b/src/Plaid/Entity/SweepStatus.cs new file mode 100644 index 00000000..40a84fc3 --- /dev/null +++ b/src/Plaid/Entity/SweepStatus.cs @@ -0,0 +1,43 @@ +namespace Going.Plaid.Entity; + +/// +/// The status of a sweep transfer +/// +public enum SweepStatus +{ + /// + /// The sweep is currently pending + /// + [EnumMember(Value = "pending")] + Pending, + + /// + /// The sweep has been posted + /// + [EnumMember(Value = "posted")] + Posted, + + /// + /// The sweep has settled + /// + [EnumMember(Value = "settled")] + Settled, + + /// + /// The sweep has been returned + /// + [EnumMember(Value = "returned")] + Returned, + + /// + /// The sweep has failed + /// + [EnumMember(Value = "failed")] + Failed, + + /// + /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. + /// + [EnumMember(Value = "undefined")] + Undefined, +} \ No newline at end of file diff --git a/src/Plaid/Entity/Transaction.cs b/src/Plaid/Entity/Transaction.cs index a60e43c9..6af3c5b7 100644 --- a/src/Plaid/Entity/Transaction.cs +++ b/src/Plaid/Entity/Transaction.cs @@ -66,7 +66,7 @@ public record Transaction /// /// The merchant name or transaction description. - /// If the transactions object was returned by a Transactions endpoint such as /transactions/get, this field will always appear. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get, this field will only appear in an Asset Report with Insights. + /// If the transactions object was returned by a Transactions endpoint such as /transactions/sync or /transactions/get, this field will always appear. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get, this field will only appear in an Asset Report with Insights. /// [JsonPropertyName("name")] public string? Name { get; init; } = default!; @@ -78,14 +78,14 @@ public record Transaction public string? MerchantName { get; init; } = default!; /// - /// The string returned by the financial institution to describe the transaction. For transactions returned by /transactions/get, this field is in beta and will be omitted unless the client is both enrolled in the closed beta program and has set options.include_original_description to true. + /// The string returned by the financial institution to describe the transaction. For transactions returned by /transactions/sync or /transactions/get, this field is in beta and will be omitted unless the client is both enrolled in the closed beta program and has set options.include_original_description to true. /// [JsonPropertyName("original_description")] public string? OriginalDescription { get; init; } = default!; /// /// Transaction information specific to inter-bank transfers. If the transaction was not an inter-bank transfer, all fields will be null. - /// If the transactions object was returned by a Transactions endpoint such as /transactions/get, the payment_meta key will always appear, but no data elements are guaranteed. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get, this field will only appear in an Asset Report with Insights. + /// If the transactions object was returned by a Transactions endpoint such as /transactions/sync or /transactions/get, the payment_meta key will always appear, but no data elements are guaranteed. If the transactions object was returned by an Assets endpoint such as /asset_report/get/ or /asset_report/pdf/get`, this field will only appear in an Asset Report with Insights. /// [JsonPropertyName("payment_meta")] public Entity.PaymentMeta? PaymentMeta { get; init; } = default!; diff --git a/src/Plaid/Entity/TransferAuthorization.cs b/src/Plaid/Entity/TransferAuthorization.cs index 3cfda27a..6577eea9 100644 --- a/src/Plaid/Entity/TransferAuthorization.cs +++ b/src/Plaid/Entity/TransferAuthorization.cs @@ -30,7 +30,7 @@ public record TransferAuthorization public Entity.TransferAuthorizationDecisionRationale? DecisionRationale { get; init; } = default!; /// - /// Signal insights including scores and attributes. + /// Signal insights including scores and attributes. This response is offered as an add-on to /transfer/authorization/create. To request access to these fields please contact your Plaid account manager. /// [JsonPropertyName("signal_insights")] public Entity.SignalInsights? SignalInsights { get; init; } = default!; diff --git a/src/Plaid/Entity/TransferSweep.cs b/src/Plaid/Entity/TransferSweep.cs index a3396c3a..2aa9746b 100644 --- a/src/Plaid/Entity/TransferSweep.cs +++ b/src/Plaid/Entity/TransferSweep.cs @@ -44,4 +44,10 @@ public record TransferSweep /// [JsonPropertyName("settled")] public DateOnly? Settled { get; init; } = default!; + + /// + /// The status of a sweep transfer + /// + [JsonPropertyName("status")] + public Entity.SweepStatus? Status { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/UserAddress.cs b/src/Plaid/Entity/UserAddress.cs index 3c96b223..9f156efc 100644 --- a/src/Plaid/Entity/UserAddress.cs +++ b/src/Plaid/Entity/UserAddress.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Entity; /// -/// Home address for the user. +/// Home address for the user. For more context on this field, see Input Validation by Country. /// public class UserAddress { @@ -27,13 +27,13 @@ public class UserAddress /// An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. /// [JsonPropertyName("region")] - public string Region { get; set; } = default!; + public string? Region { get; set; } = default!; /// /// The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. /// [JsonPropertyName("postal_code")] - public string PostalCode { get; set; } = default!; + public string? PostalCode { get; set; } = default!; /// /// Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. diff --git a/src/Plaid/Institutions/InstitutionsGetByIdRequest.cs b/src/Plaid/Institutions/InstitutionsGetByIdRequest.cs index d4d06917..a4498741 100644 --- a/src/Plaid/Institutions/InstitutionsGetByIdRequest.cs +++ b/src/Plaid/Institutions/InstitutionsGetByIdRequest.cs @@ -12,7 +12,7 @@ public partial class InstitutionsGetByIdRequest : RequestBase public string InstitutionId { get; set; } = default!; /// - /// Specify an array of Plaid-supported country codes this institution supports, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the country_codes parameter is an optional parameter within the options object and will default to [US] if it is not supplied. + /// Specify which country or countries to include institutions from, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the country_codes parameter is an optional parameter within the options object and will default to [US] if it is not supplied. /// [JsonPropertyName("country_codes")] public IReadOnlyList CountryCodes { get; set; } = default!; diff --git a/src/Plaid/Institutions/InstitutionsGetRequest.cs b/src/Plaid/Institutions/InstitutionsGetRequest.cs index c1dbe574..89070839 100644 --- a/src/Plaid/Institutions/InstitutionsGetRequest.cs +++ b/src/Plaid/Institutions/InstitutionsGetRequest.cs @@ -18,7 +18,7 @@ public partial class InstitutionsGetRequest : RequestBase public int Offset { get; set; } = default!; /// - /// Specify an array of Plaid-supported country codes this institution supports, using the ISO-3166-1 alpha-2 country code standard. + /// Specify which country or countries to include institutions from, using the ISO-3166-1 alpha-2 country code standard. /// In API versions 2019-05-29 and earlier, the country_codes parameter is an optional parameter within the options object and will default to [US] if it is not supplied. /// [JsonPropertyName("country_codes")] diff --git a/src/Plaid/Institutions/InstitutionsSearchRequest.cs b/src/Plaid/Institutions/InstitutionsSearchRequest.cs index bac3eb3a..0112d891 100644 --- a/src/Plaid/Institutions/InstitutionsSearchRequest.cs +++ b/src/Plaid/Institutions/InstitutionsSearchRequest.cs @@ -18,7 +18,7 @@ public partial class InstitutionsSearchRequest : RequestBase public IReadOnlyList? Products { get; set; } = default!; /// - /// Specify an array of Plaid-supported country codes this institution supports, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the country_codes parameter is an optional parameter within the options object and will default to [US] if it is not supplied. + /// Specify which country or countries to include institutions from, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the country_codes parameter is an optional parameter within the options object and will default to [US] if it is not supplied. /// [JsonPropertyName("country_codes")] public IReadOnlyList CountryCodes { get; set; } = default!; diff --git a/src/Plaid/Investments/PlaidClient.cs b/src/Plaid/Investments/PlaidClient.cs index 539c754b..bbe540a7 100644 --- a/src/Plaid/Investments/PlaidClient.cs +++ b/src/Plaid/Investments/PlaidClient.cs @@ -14,7 +14,8 @@ public sealed partial class PlaidClient /// The /investments/transactions/get endpoint allows developers to retrieve up to 24 months of user-authorized transaction data for investment accounts. /// Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. /// Due to the potentially large number of investment transactions associated with an Item, results are paginated. Manipulate the count and offset parameters in conjunction with the total_investment_transactions response body field to fetch all available investment transactions. - /// Note that Investments does not have a webhook to indicate when initial transaction data has loaded. Instead, if transactions data is not ready when /investments/transactions/get is first called, Plaid will wait for the data. For this reason, calling /investments/transactions/get immediately after Link may take up to one to two minutes to return. + /// Note that Investments does not have a webhook to indicate when initial transaction data has loaded (unless you use the async_update option). Instead, if transactions data is not ready when /investments/transactions/get is first called, Plaid will wait for the data. For this reason, calling /investments/transactions/get immediately after Link may take up to one to two minutes to return. + /// Data returned by the asynchronous investments extraction flow (when async_update is set to true) may not be immediately available to /investments/transactions/get. To be alerted when the data is ready to be fetched, listen for the HISTORICAL_UPDATE webhook. If no investments history is ready when /investments/transactions/get is called, it will return a PRODUCT_NOT_READY error. /// /// public Task InvestmentsTransactionsGetAsync(Investments.InvestmentsTransactionsGetRequest request) => diff --git a/src/Plaid/Processor/PlaidClient.cs b/src/Plaid/Processor/PlaidClient.cs index 7d33ff2b..a300f964 100644 --- a/src/Plaid/Processor/PlaidClient.cs +++ b/src/Plaid/Processor/PlaidClient.cs @@ -142,6 +142,14 @@ public sealed partial class PlaidClient PostAsync("/processor/token/permissions/get", request) .ParseResponseAsync(); + /// + /// This endpoint allows you to update the webhook URL associated with a processor token. This request triggers a WEBHOOK_UPDATE_ACKNOWLEDGED webhook to the newly specified webhook URL. + /// + /// + public Task ProcessorTokenWebhookUpdateAsync(Processor.ProcessorTokenWebhookUpdateRequest request) => + PostAsync("/processor/token/webhook/update", request) + .ParseResponseAsync(); + /// /// Used to create a token suitable for sending to Stripe to enable Plaid-Stripe integrations. For a detailed guide on integrating Stripe, see Add Stripe to your app. /// Note that the Stripe bank account token is a one-time use token. To store bank account information for later use, you can use a Stripe customer object and create an associated bank account from the token, or you can use a Stripe Custom account and create an associated external bank account from the token. This bank account information should work indefinitely, unless the user's bank account information changes or they revoke Plaid's permissions to access their account. Stripe bank account information cannot be modified once the bank account token has been created. If you ever need to change the bank account details used by Stripe for a specific customer, have the user go through Link again and create a new bank account token from the new access_token. diff --git a/src/Plaid/Processor/ProcessorTokenWebhookUpdateRequest.cs b/src/Plaid/Processor/ProcessorTokenWebhookUpdateRequest.cs new file mode 100644 index 00000000..28a0dcc8 --- /dev/null +++ b/src/Plaid/Processor/ProcessorTokenWebhookUpdateRequest.cs @@ -0,0 +1,19 @@ +namespace Going.Plaid.Processor; + +/// +/// ProcessorTokenWebhookUpdateRequest defines the request schema for /processor/token/webhook/update +/// +public partial class ProcessorTokenWebhookUpdateRequest : RequestBase +{ + /// + /// The processor token obtained from the Plaid integration partner. Processor tokens are in the format: processor-<environment>-<identifier> + /// + [JsonPropertyName("processor_token")] + public string ProcessorToken { get; set; } = default!; + + /// + /// The new webhook URL to associate with the processor token. To remove a webhook from a processor token, set to null. + /// + [JsonPropertyName("webhook")] + public string? Webhook { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Processor/ProcessorTokenWebhookUpdateResponse.cs b/src/Plaid/Processor/ProcessorTokenWebhookUpdateResponse.cs new file mode 100644 index 00000000..1dffa2a2 --- /dev/null +++ b/src/Plaid/Processor/ProcessorTokenWebhookUpdateResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Processor; + +/// +/// ProcessorTokenWebhookUpdateResponse defines the response schema for /processor/token/webhook/update +/// +public record ProcessorTokenWebhookUpdateResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Statements/PlaidClient.cs b/src/Plaid/Statements/PlaidClient.cs new file mode 100644 index 00000000..39d963f2 --- /dev/null +++ b/src/Plaid/Statements/PlaidClient.cs @@ -0,0 +1,20 @@ +namespace Going.Plaid; + +public sealed partial class PlaidClient +{ + /// + /// The /statements/list endpoint retrieves a list of all statements associated with the provided item. + /// + /// + public Task StatementsListAsync(Statements.StatementsListRequest request) => + PostAsync("/statements/list", request) + .ParseResponseAsync(); + + /// + /// The /statements/download endpoint retrieves a single statement. + /// + /// + public Task StatementsDownloadAsync(Statements.StatementsDownloadRequest request) => + PostAsync("/statements/download", request) + .ParseResponseAsync(); +} \ No newline at end of file diff --git a/src/Plaid/Statements/StatementsDownloadRequest.cs b/src/Plaid/Statements/StatementsDownloadRequest.cs new file mode 100644 index 00000000..eaccd779 --- /dev/null +++ b/src/Plaid/Statements/StatementsDownloadRequest.cs @@ -0,0 +1,13 @@ +namespace Going.Plaid.Statements; + +/// +/// StatementsDownloadRequest defines the request schema for /statements/download +/// +public partial class StatementsDownloadRequest : RequestBase +{ + /// + /// Plaid's unique identifier for the statements. + /// + [JsonPropertyName("statement_id")] + public string StatementId { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Statements/StatementsDownloadResponse.cs b/src/Plaid/Statements/StatementsDownloadResponse.cs new file mode 100644 index 00000000..fe273c57 --- /dev/null +++ b/src/Plaid/Statements/StatementsDownloadResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Statements; + +/// +/// StatementsDownloadResponse defines the response schema for /statements/download. The response will contain a Plaid-Content-Hash header containing a SHA 256 checksum of the statement. This can be used to verify that the file being sent by Plaid is the same file that was downloaded to your systems. +/// +public record StatementsDownloadResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Statements/StatementsListRequest.cs b/src/Plaid/Statements/StatementsListRequest.cs new file mode 100644 index 00000000..234c892e --- /dev/null +++ b/src/Plaid/Statements/StatementsListRequest.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Statements; + +/// +/// StatementsListRequest defines the request schema for /statements/list +/// +public partial class StatementsListRequest : RequestBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Statements/StatementsListResponse.cs b/src/Plaid/Statements/StatementsListResponse.cs new file mode 100644 index 00000000..1f15ff1f --- /dev/null +++ b/src/Plaid/Statements/StatementsListResponse.cs @@ -0,0 +1,31 @@ +namespace Going.Plaid.Statements; + +/// +/// StatementsListResponse defines the response schema for /statements/list +/// +public record StatementsListResponse : ResponseBase +{ + /// + /// + /// + [JsonPropertyName("accounts")] + public IReadOnlyList Accounts { get; init; } = default!; + + /// + /// The Plaid Institution ID associated with the Item. + /// + [JsonPropertyName("institution_id")] + public string InstitutionId { get; init; } = default!; + + /// + /// The name of the institution associated with the Item. + /// + [JsonPropertyName("institution_name")] + public string InstitutionName { get; init; } = default!; + + /// + /// The Plaid Item ID. The item_id is always unique; linking the same account at the same institution twice will result in two Items with different item_id values. Like all Plaid identifiers, the item_id is case-sensitive. + /// + [JsonPropertyName("item_id")] + public string ItemId { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs b/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs index b61140e1..e5ca917e 100644 --- a/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs +++ b/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Transfer; public partial class TransferAuthorizationCreateRequest : RequestBase { /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Returned only if account_id was set on intent creation. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. /// [JsonPropertyName("account_id")] public string? AccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs b/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs index 08908da0..80aaaf7d 100644 --- a/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs +++ b/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Transfer; public partial class TransferCapabilitiesGetRequest : RequestBase { /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Returned only if account_id was set on intent creation. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. /// [JsonPropertyName("account_id")] public string? AccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferCreateRequest.cs b/src/Plaid/Transfer/TransferCreateRequest.cs index 1b105000..f1bf2c1a 100644 --- a/src/Plaid/Transfer/TransferCreateRequest.cs +++ b/src/Plaid/Transfer/TransferCreateRequest.cs @@ -14,7 +14,7 @@ public partial class TransferCreateRequest : RequestBase public string? IdempotencyKey { get; set; } = default!; /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Returned only if account_id was set on intent creation. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. /// [JsonPropertyName("account_id")] public string? AccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferRecurringCreateRequest.cs b/src/Plaid/Transfer/TransferRecurringCreateRequest.cs index e7e4af6e..fafe3dee 100644 --- a/src/Plaid/Transfer/TransferRecurringCreateRequest.cs +++ b/src/Plaid/Transfer/TransferRecurringCreateRequest.cs @@ -13,7 +13,7 @@ public partial class TransferRecurringCreateRequest : RequestBase public string IdempotencyKey { get; set; } = default!; /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Returned only if account_id was set on intent creation. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. /// [JsonPropertyName("account_id")] public string AccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferSweepListRequest.cs b/src/Plaid/Transfer/TransferSweepListRequest.cs index 65d8e079..f4bc1ff5 100644 --- a/src/Plaid/Transfer/TransferSweepListRequest.cs +++ b/src/Plaid/Transfer/TransferSweepListRequest.cs @@ -35,6 +35,12 @@ public partial class TransferSweepListRequest : RequestBase [JsonPropertyName("amount")] public string? Amount { get; set; } = default!; + /// + /// The status of a sweep transfer + /// + [JsonPropertyName("status")] + public Entity.SweepStatus? Status { get; set; } = default!; + /// /// Filter sweeps to only those with the specified originator client. /// @@ -46,4 +52,10 @@ public partial class TransferSweepListRequest : RequestBase /// [JsonPropertyName("funding_account_id")] public string? FundingAccountId { get; set; } = default!; + + /// + /// Filter sweeps to only those with the included transfer_id. + /// + [JsonPropertyName("transfer_id")] + public string? TransferId { get; set; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs b/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs index 5f456432..9d1fefd4 100644 --- a/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs +++ b/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs @@ -26,7 +26,7 @@ public record IncomeVerificationStatusWebhook : WebhookBase public string? UserId { get; init; } = default!; /// - /// VERIFICATION_STATUS_PROCESSING_COMPLETE: The income verification status processing has completed. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the /income/verification/paystubs/get endpoint and check the document metadata to see which documents were successfully parsed. + /// VERIFICATION_STATUS_PROCESSING_COMPLETE: The income verification status processing has completed. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the /credit/payroll_income/get endpoint and check the document metadata to see which documents were successfully parsed. /// VERIFICATION_STATUS_PROCESSING_FAILED: A failure occurred when attempting to process the verification documentation. /// VERIFICATION_STATUS_PENDING_APPROVAL: (deprecated) The income verification has been sent to the user for review. /// diff --git a/src/Plaid/Webhook/InvestmentsHistoricalUpdateWebhook.cs b/src/Plaid/Webhook/InvestmentsHistoricalUpdateWebhook.cs new file mode 100644 index 00000000..6c96d252 --- /dev/null +++ b/src/Plaid/Webhook/InvestmentsHistoricalUpdateWebhook.cs @@ -0,0 +1,39 @@ +namespace Going.Plaid.Webhook; + +/// +/// Fired after an asynchronous extraction on an investments account. +/// +public record InvestmentsHistoricalUpdateWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.InvestmentsTransactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.HistoricalUpdate; + + /// + /// The item_id of the Item associated with this webhook, warning, or error + /// + [JsonPropertyName("item_id")] + public string ItemId { get; init; } = default!; + + /// + /// We use standard HTTP response codes for success and failure notifications, and our errors are further classified by error_type. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-null error object will only be part of an API response when calling /item/get to view Item status. Otherwise, error fields will be null if no error has occurred; if an error has occurred, an error code will be returned instead. + /// + [JsonPropertyName("error")] + public Entity.PlaidError? Error { get; init; } = default!; + + /// + /// The number of new transactions reported since the last time this webhook was fired. + /// + [JsonPropertyName("new_investments_transactions")] + public decimal NewInvestmentsTransactions { get; init; } = default!; + + /// + /// The number of canceled transactions reported since the last time this webhook was fired. + /// + [JsonPropertyName("canceled_investments_transactions")] + public decimal CanceledInvestmentsTransactions { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/ProcessorDefaultUpdateWebhook.cs b/src/Plaid/Webhook/ProcessorDefaultUpdateWebhook.cs new file mode 100644 index 00000000..4b94f91d --- /dev/null +++ b/src/Plaid/Webhook/ProcessorDefaultUpdateWebhook.cs @@ -0,0 +1,35 @@ +namespace Going.Plaid.Webhook; + +/// +/// This webhook is only sent to Plaid processor partners. +/// Fired when new transaction data is available for an Item. Plaid will typically check for new transaction data several times a day. +/// This webhook is intended for use with /processor/transactions/get; if you are using the newer /processor/transactions/sync endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the SYNC_UPDATES_AVAILABLE webhook instead. +/// +public record ProcessorDefaultUpdateWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.Transactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.DefaultUpdate; + + /// + /// We use standard HTTP response codes for success and failure notifications, and our errors are further classified by error_type. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-null error object will only be part of an API response when calling /item/get to view Item status. Otherwise, error fields will be null if no error has occurred; if an error has occurred, an error code will be returned instead. + /// + [JsonPropertyName("error")] + public Entity.PlaidError? Error { get; init; } = default!; + + /// + /// The number of new transactions detected since the last time this webhook was fired. + /// + [JsonPropertyName("new_transactions")] + public decimal NewTransactions { get; init; } = default!; + + /// + /// The ID of the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/ProcessorHistoricalUpdateWebhook.cs b/src/Plaid/Webhook/ProcessorHistoricalUpdateWebhook.cs new file mode 100644 index 00000000..c0f39387 --- /dev/null +++ b/src/Plaid/Webhook/ProcessorHistoricalUpdateWebhook.cs @@ -0,0 +1,35 @@ +namespace Going.Plaid.Webhook; + +/// +/// This webhook is only sent to Plaid processor partners. +/// Fired when an Item's historical transaction pull is completed and Plaid has prepared as much historical transaction data as possible for the Item. Once this webhook has been fired, transaction data beyond the most recent 30 days can be fetched for the Item. If Account Select v2 is enabled, this webhook will also be fired if account selections for the Item are updated, with new_transactions set to the number of net new transactions pulled after the account selection update. +/// This webhook is intended for use with /processor/transactions/get; if you are using the newer /processor/transactions/sync endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the SYNC_UPDATES_AVAILABLE webhook instead. +/// +public record ProcessorHistoricalUpdateWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.Transactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.HistoricalUpdate; + + /// + /// We use standard HTTP response codes for success and failure notifications, and our errors are further classified by error_type. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-null error object will only be part of an API response when calling /item/get to view Item status. Otherwise, error fields will be null if no error has occurred; if an error has occurred, an error code will be returned instead. + /// + [JsonPropertyName("error")] + public Entity.PlaidError? Error { get; init; } = default!; + + /// + /// The number of new, unfetched transactions available + /// + [JsonPropertyName("new_transactions")] + public decimal NewTransactions { get; init; } = default!; + + /// + /// The ID of the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/ProcessorInitialUpdateWebhook.cs b/src/Plaid/Webhook/ProcessorInitialUpdateWebhook.cs new file mode 100644 index 00000000..6b1d775f --- /dev/null +++ b/src/Plaid/Webhook/ProcessorInitialUpdateWebhook.cs @@ -0,0 +1,35 @@ +namespace Going.Plaid.Webhook; + +/// +/// This webhook is only sent to Plaid processor partners. +/// Fired when an Item's initial transaction pull is completed. Once this webhook has been fired, transaction data for the most recent 30 days can be fetched for the Item. If Account Select v2 is enabled, this webhook will also be fired if account selections for the Item are updated, with new_transactions set to the number of net new transactions pulled after the account selection update. +/// This webhook is intended for use with /processor/transactions/get; if you are using the newer /processor/transactions/sync endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the SYNC_UPDATES_AVAILABLE webhook instead. +/// +public record ProcessorInitialUpdateWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.Transactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.InitialUpdate; + + /// + /// The error code associated with the webhook. + /// + [JsonPropertyName("error")] + public string? Error { get; init; } = default!; + + /// + /// The number of new, unfetched transactions available. + /// + [JsonPropertyName("new_transactions")] + public decimal NewTransactions { get; init; } = default!; + + /// + /// The ID of the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/ProcessorRecurringTransactionsUpdateWebhook.cs b/src/Plaid/Webhook/ProcessorRecurringTransactionsUpdateWebhook.cs new file mode 100644 index 00000000..fff93058 --- /dev/null +++ b/src/Plaid/Webhook/ProcessorRecurringTransactionsUpdateWebhook.cs @@ -0,0 +1,23 @@ +namespace Going.Plaid.Webhook; + +/// +/// This webhook is only sent to Plaid processor partners. +/// Fired when recurring transactions data is updated. This includes when a new recurring stream is detected or when a new transaction is added to an existing recurring stream. The RECURRING_TRANSACTIONS_UPDATE webhook will also fire when one or more attributes of the recurring stream changes, which is usually a result of the addition, update, or removal of transactions to the stream. +/// After receipt of this webhook, the updated data can be fetched from /processor/transactions/recurring/get. +/// +public record ProcessorRecurringTransactionsUpdateWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.Transactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.RecurringTransactionsUpdate; + + /// + /// The ID of the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/ProcessorSyncUpdatesAvailableWebhook.cs b/src/Plaid/Webhook/ProcessorSyncUpdatesAvailableWebhook.cs new file mode 100644 index 00000000..5c452d7f --- /dev/null +++ b/src/Plaid/Webhook/ProcessorSyncUpdatesAvailableWebhook.cs @@ -0,0 +1,37 @@ +namespace Going.Plaid.Webhook; + +/// +/// This webhook is only sent to Plaid processor partners. +/// Fired when an Item's transactions change. This can be due to any event resulting in new changes, such as an initial 30-day transactions fetch upon the initialization of an Item with transactions, the backfill of historical transactions that occurs shortly after, or when changes are populated from a regularly-scheduled transactions update job. It is recommended to listen for the SYNC_UPDATES_AVAILABLE webhook when using the /processor/transactions/sync endpoint. Note that when using /processor/transactions/sync the older webhooks INITIAL_UPDATE, HISTORICAL_UPDATE, DEFAULT_UPDATE, and TRANSACTIONS_REMOVED, which are intended for use with /processor/transactions/get, will also continue to be sent in order to maintain backwards compatibility. It is not necessary to listen for and respond to those webhooks when using /processor/transactions/sync. +/// After receipt of this webhook, the new changes can be fetched for the Item from /processor/transactions/sync. +/// Note that to receive this webhook for an Item, /processor/transactions/sync must have been called at least once on that Item. This means that, unlike the INITIAL_UPDATE and HISTORICAL_UPDATE webhooks, it will not fire immediately upon Item creation. If /transactions/sync is called on an Item that was *not* initialized with Transactions, the webhook will fire twice: once the first 30 days of transactions data has been fetched, and a second time when all available historical transactions data has been fetched. +/// This webhook will typically not fire in the Sandbox environment, due to the lack of dynamic transactions data. To test this webhook in Sandbox, call /sandbox/item/fire_webhook. +/// +public record ProcessorSyncUpdatesAvailableWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.Transactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.SyncUpdatesAvailable; + + /// + /// The ID of the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; + + /// + /// Indicates if initial pull information is available. + /// + [JsonPropertyName("initial_update_complete")] + public bool InitialUpdateComplete { get; init; } = default!; + + /// + /// Indicates if historical pull information is available. + /// + [JsonPropertyName("historical_update_complete")] + public bool HistoricalUpdateComplete { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/ProcessorTransactionsRemovedWebhook.cs b/src/Plaid/Webhook/ProcessorTransactionsRemovedWebhook.cs new file mode 100644 index 00000000..fc51929b --- /dev/null +++ b/src/Plaid/Webhook/ProcessorTransactionsRemovedWebhook.cs @@ -0,0 +1,35 @@ +namespace Going.Plaid.Webhook; + +/// +/// This webhook is only sent to Plaid processor partners. +/// Fired when transaction(s) for an Item are deleted. The deleted transaction IDs are included in the webhook payload. Plaid will typically check for deleted transaction data several times a day. +/// This webhook is intended for use with /processor/transactions/get; if you are using the newer /processor/transactions/sync endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the SYNC_UPDATES_AVAILABLE webhook instead. +/// +public record ProcessorTransactionsRemovedWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.Transactions; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.TransactionsRemoved; + + /// + /// We use standard HTTP response codes for success and failure notifications, and our errors are further classified by error_type. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-null error object will only be part of an API response when calling /item/get to view Item status. Otherwise, error fields will be null if no error has occurred; if an error has occurred, an error code will be returned instead. + /// + [JsonPropertyName("error")] + public Entity.PlaidError? Error { get; init; } = default!; + + /// + /// An array of transaction_ids corresponding to the removed transactions + /// + [JsonPropertyName("removed_transactions")] + public IReadOnlyList RemovedTransactions { get; init; } = default!; + + /// + /// The ID of the account. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/SyncUpdatesAvailableWebhook.cs b/src/Plaid/Webhook/SyncUpdatesAvailableWebhook.cs index 1350e65c..cd0878f0 100644 --- a/src/Plaid/Webhook/SyncUpdatesAvailableWebhook.cs +++ b/src/Plaid/Webhook/SyncUpdatesAvailableWebhook.cs @@ -4,7 +4,7 @@ namespace Going.Plaid.Webhook; /// Fired when an Item's transactions change. This can be due to any event resulting in new changes, such as an initial 30-day transactions fetch upon the initialization of an Item with transactions, the backfill of historical transactions that occurs shortly after, or when changes are populated from a regularly-scheduled transactions update job. It is recommended to listen for the SYNC_UPDATES_AVAILABLE webhook when using the /transactions/sync endpoint. Note that when using /transactions/sync the older webhooks INITIAL_UPDATE, HISTORICAL_UPDATE, DEFAULT_UPDATE, and TRANSACTIONS_REMOVED, which are intended for use with /transactions/get, will also continue to be sent in order to maintain backwards compatibility. It is not necessary to listen for and respond to those webhooks when using /transactions/sync. /// After receipt of this webhook, the new changes can be fetched for the Item from /transactions/sync. /// Note that to receive this webhook for an Item, /transactions/sync must have been called at least once on that Item. This means that, unlike the INITIAL_UPDATE and HISTORICAL_UPDATE webhooks, it will not fire immediately upon Item creation. If /transactions/sync is called on an Item that was *not* initialized with Transactions, the webhook will fire twice: once the first 30 days of transactions data has been fetched, and a second time when all available historical transactions data has been fetched. -/// This webhook will typically not fire in the Sandbox environment, due to the lack of dynamic transactions data. To test this webhook in Sandbox, call /sandbox/item/fire_webhook. +/// This webhook will fire in the Sandbox environment as it would in Production. It can also be manually triggered in Sandbox by calling /sandbox/item/fire_webhook. /// public record SyncUpdatesAvailableWebhook : WebhookBase {